Ask Your Question

Revision history [back]

This isn't perfect, but it's close: use GradedCommutativeAlgebra. The generators in odd degrees anti-commute, so if you want a polynomial algebra, double the degrees of the generators:

sage: S.<x,y> = GradedCommutativeAlgebra(QQ, degrees=(2, 4))
sage: S
Graded Commutative Algebra with generators ('x', 'y') in degrees (2, 4) with relations [0] over Rational Field
sage: (x*y).degree()
6
sage: S.basis(10)
[x*y^2, x^3*y, x^5]

This isn't perfect, but it's close: use GradedCommutativeAlgebra. The generators in odd degrees anti-commute, so if you want a an honest polynomial algebra, double the degrees of the generators:

sage: S.<x,y> = GradedCommutativeAlgebra(QQ, degrees=(2, 4))
sage: S
Graded Commutative Algebra with generators ('x', 'y') in degrees (2, 4) with relations [0] over Rational Field
sage: (x*y).degree()
6
sage: S.basis(10)
[x*y^2, x^3*y, x^5]