Bases: sage.categories.graded_modules.GradedModulesCategory
The category of graded modules with a distinguished basis.
EXAMPLES:
sage: C = GradedModulesWithBasis(ZZ); C
Category of graded modules with basis over Integer Ring
sage: sorted(C.super_categories(), key=str)
[Category of graded modules over Integer Ring,
Category of modules with basis over Integer Ring]
sage: C is ModulesWithBasis(ZZ).Graded()
True
TESTS:
sage: TestSuite(C).run()
The degree of this element in the graded module.
Note
This raises an error if the element is not homogeneous. Another implementation option would be to return the maximum of the degrees of the homogeneous summands.
EXAMPLES:
sage: A = GradedModulesWithBasis(ZZ).example()
sage: x = A(Partition((3,2,1)))
sage: y = A(Partition((4,4,1)))
sage: z = A(Partition((2,2,2)))
sage: x.degree()
6
sage: (x + 2*z).degree()
6
sage: (y - x).degree()
Traceback (most recent call last):
...
ValueError: Element is not homogeneous.
Return the homogeneous component of degree n of this element.
EXAMPLES:
sage: A = GradedModulesWithBasis(ZZ).example()
sage: x = A.an_element(); x
2*P[] + 2*P[1] + 3*P[2]
sage: x.homogeneous_component(-1)
0
sage: x.homogeneous_component(0)
2*P[]
sage: x.homogeneous_component(1)
2*P[1]
sage: x.homogeneous_component(2)
3*P[2]
sage: x.homogeneous_component(3)
0
TESTS:
Check that this really return A.zero() and not a plain 0:
sage: x.homogeneous_component(3).parent() is A
True
Return whether this element is homogeneous.
EXAMPLES:
sage: A = GradedModulesWithBasis(ZZ).example()
sage: x=A(Partition((3,2,1)))
sage: y=A(Partition((4,4,1)))
sage: z=A(Partition((2,2,2)))
sage: (3*x).is_homogeneous()
True
sage: (x - y).is_homogeneous()
False
sage: (x+2*z).is_homogeneous()
True
Return the sum of the homogeneous components of degree < n of this element
EXAMPLES:
sage: A = GradedModulesWithBasis(ZZ).example()
sage: x = A.an_element(); x
2*P[] + 2*P[1] + 3*P[2]
sage: x.truncate(0)
0
sage: x.truncate(1)
2*P[]
sage: x.truncate(2)
2*P[] + 2*P[1]
sage: x.truncate(3)
2*P[] + 2*P[1] + 3*P[2]
TESTS:
Check that this really return A.zero() and not a plain 0:
sage: x.truncate(0).parent() is A
True
Returns the basis for (an homogeneous component of) this graded module
INPUT:
If is None, returns a basis of the module.
Otherwise, returns the basis of the homogeneous component of degree
.
EXAMPLES:
sage: A = GradedModulesWithBasis(ZZ).example()
sage: A.basis(4)
Lazy family (Term map from Partitions to An example of a graded module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions of the integer 4}
Without arguments, the full basis is returned:
sage: A.basis()
Lazy family (Term map from Partitions to An example of a graded module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions}
sage: A.basis()
Lazy family (Term map from Partitions to An example of a graded module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions}