# Graded algebras with basis¶

The category of graded algebras with a distinguished basis

EXAMPLES:

sage: C = GradedAlgebrasWithBasis(ZZ); C
Category of graded algebras with basis over Integer Ring
sage: sorted(C.super_categories(), key=str)
[Category of algebras with basis over Integer Ring,
Category of graded algebras over Integer Ring,
Category of graded modules with basis over Integer Ring]


TESTS:

sage: TestSuite(C).run()

class ElementMethods
degree()

The degree of this element.

Note

This raises an error if the element is not homogeneous. To obtain the maximum of the degrees of the homogeneous summands, use maximal_degree()

EXAMPLES:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: (x, y) = (S[2], S[3])
sage: x.homogeneous_degree()
2
sage: (x^3 + 4*y^2).homogeneous_degree()
6
sage: ((1 + x)^3).homogeneous_degree()
Traceback (most recent call last):
...
ValueError: Element is not homogeneous.


TESTS:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: S.zero().degree()
Traceback (most recent call last):
...
ValueError: The zero element does not have a well-defined degree.

homogeneous_degree()

The degree of this element.

Note

This raises an error if the element is not homogeneous. To obtain the maximum of the degrees of the homogeneous summands, use maximal_degree()

EXAMPLES:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: (x, y) = (S[2], S[3])
sage: x.homogeneous_degree()
2
sage: (x^3 + 4*y^2).homogeneous_degree()
6
sage: ((1 + x)^3).homogeneous_degree()
Traceback (most recent call last):
...
ValueError: Element is not homogeneous.


TESTS:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: S.zero().degree()
Traceback (most recent call last):
...
ValueError: The zero element does not have a well-defined degree.

is_homogeneous()

Return whether this element is homogeneous.

EXAMPLES:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: (x, y) = (S[2], S[3])
sage: (3*x).is_homogeneous()
True
sage: (x^3 - y^2).is_homogeneous()
True
sage: ((x + y)^2).is_homogeneous()
False

maximal_degree()

The maximum of the degrees of the homogeneous summands.

EXAMPLES:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: (x, y) = (S[2], S[3])
sage: x.maximal_degree()
2
sage: (x^3 + 4*y^2).maximal_degree()
6
sage: ((1 + x)^3).maximal_degree()
6


TESTS:

sage: S = NonCommutativeSymmetricFunctions(QQ).S()
sage: S.zero().degree()
Traceback (most recent call last):
...
ValueError: The zero element does not have a well-defined degree.