Ask Your Question

Revision history [back]

This is not perfect, but it works: use GradedCommutativeAlgebra. This isn't perfect because such objects are graded commutative, not commutative, so if x and z are in odd degrees, then xz = -zx. You can deal with this by doubling all degrees to make sure nothing is in an odd degree.

P = GradedCommutativeAlgebra(QQ, names=('x', 'y', 'z'), degrees=(2, 4, 6))
P.inject_variables()

or

P.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 4, 6))

Then

I = P.ideal(x*y^2 + x^5, z*y + x^3*y)
Q = P.quotient(I)
Q.basis(18)

will return

[c^3, a*b*c^2, a^3*c^2, a^2*b^2*c]

This is not perfect, but it works: use GradedCommutativeAlgebra. This isn't perfect because such objects are graded commutative, not commutative, so if x and z are in odd degrees, then xz = -zx. You can deal with this by doubling all degrees to make sure nothing is in an odd degree.

P = GradedCommutativeAlgebra(QQ, names=('x', 'y', 'z'), degrees=(2, 4, 6))
P.inject_variables()

or

P.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 4, 6))

Then

I = P.ideal(x*y^2 + x^5, z*y + x^3*y)
Q = P.quotient(I)
Q.basis(18)

will return

[c^3, a*b*c^2, a^3*c^2, a^2*b^2*c]
[z^3, x*y*z^2, x^3*z^2, x^2*y^2*z]