Filtered Modules With Basis¶
A filtered module with basis over a ring \(R\) means (for the purpose of this code) a filtered \(R\)-module \(M\) with filtration \((F_i)_{i \in I}\) (typically \(I = \NN\)) endowed with a basis \((b_j)_{j \in J}\) of \(M\) and a partition \(J = \bigsqcup_{i \in I} J_i\) of the set \(J\) (it is allowed that some \(J_i\) are empty) such that for every \(n \in I\), the subfamily \((b_j)_{j \in U_n}\), where \(U_n = \bigcup_{i \leq n} J_i\), is a basis of the \(R\)-submodule \(F_n\).
For every \(i \in I\), the \(R\)-submodule of \(M\) spanned by \((b_j)_{j \in J_i}\) is called the \(i\)-th graded component (aka the \(i\)-th homogeneous component) of the filtered module with basis \(M\); the elements of this submodule are referred to as homogeneous elements of degree \(i\).
See the class documentation
FilteredModulesWithBasis
for further details.
- class sage.categories.filtered_modules_with_basis.FilteredModulesWithBasis(base_category)[source]¶
- Bases: - FilteredModulesCategory- The category of filtered modules with a distinguished basis. - A filtered module with basis over a ring \(R\) means (for the purpose of this code) a filtered \(R\)-module \(M\) with filtration \((F_i)_{i \in I}\) (typically \(I = \NN\)) endowed with a basis \((b_j)_{j \in J}\) of \(M\) and a partition \(J = \bigsqcup_{i \in I} J_i\) of the set \(J\) (it is allowed that some \(J_i\) are empty) such that for every \(n \in I\), the subfamily \((b_j)_{j \in U_n}\), where \(U_n = \bigcup_{i \leq n} J_i\), is a basis of the \(R\)-submodule \(F_n\). - For every \(i \in I\), the \(R\)-submodule of \(M\) spanned by \((b_j)_{j \in J_i}\) is called the \(i\)-th graded component (aka the \(i\)-th homogeneous component) of the filtered module with basis \(M\); the elements of this submodule are referred to as homogeneous elements of degree \(i\). The \(R\)-module \(M\) is the direct sum of its \(i\)-th graded components over all \(i \in I\), and thus becomes a graded \(R\)-module with basis. Conversely, any graded \(R\)-module with basis canonically becomes a filtered \(R\)-module with basis (by defining \(F_n = \bigoplus_{i \leq n} G_i\) where \(G_i\) is the \(i\)-th graded component, and defining \(J_i\) as the indexing set of the basis of the \(i\)-th graded component). Hence, the notion of a filtered \(R\)-module with basis is equivalent to the notion of a graded \(R\)-module with basis. - However, the category of filtered \(R\)-modules with basis is not the category of graded \(R\)-modules with basis. Indeed, the morphisms of filtered \(R\)-modules with basis are defined to be morphisms of \(R\)-modules which send each \(F_n\) of the domain to the corresponding \(F_n\) of the target; in contrast, the morphisms of graded \(R\)-modules with basis must preserve each homogeneous component. Also, the notion of a filtered algebra with basis differs from that of a graded algebra with basis. - Note - Currently, to make use of the functionality of this class, an instance of - FilteredModulesWithBasisshould fulfill the contract of a- CombinatorialFreeModule(most likely by inheriting from it). It should also have the indexing set \(J\) encoded as its- _indicesattribute, and- _indices.subset(size=i)should yield the subset \(J_i\) (as an iterable). If the latter conditions are not satisfied, then- basis()must be overridden.- Note - One should implement a - degree_on_basismethod in the parent class in order to fully utilize the methods of this category. This might become a required abstract method in the future.- EXAMPLES: - sage: C = ModulesWithBasis(ZZ).Filtered(); C Category of filtered modules with basis over Integer Ring sage: sorted(C.super_categories(), key=str) [Category of filtered modules over Integer Ring, Category of modules with basis over Integer Ring] sage: C is ModulesWithBasis(ZZ).Filtered() True - >>> from sage.all import * >>> C = ModulesWithBasis(ZZ).Filtered(); C Category of filtered modules with basis over Integer Ring >>> sorted(C.super_categories(), key=str) [Category of filtered modules over Integer Ring, Category of modules with basis over Integer Ring] >>> C is ModulesWithBasis(ZZ).Filtered() True - class ElementMethods[source]¶
- Bases: - object- degree()[source]¶
- The degree of a nonzero homogeneous element - selfin the filtered module.- Note - This raises an error if the element is not homogeneous. To compute the maximum of the degrees of the homogeneous summands of a (not necessarily homogeneous) element, use - maximal_degree()instead.- EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A(Partition((Integer(3),Integer(2),Integer(1)))) >>> y = A(Partition((Integer(4),Integer(4),Integer(1)))) >>> z = A(Partition((Integer(2),Integer(2),Integer(2)))) >>> x.degree() 6 >>> (x + Integer(2)*z).degree() 6 >>> (y - x).degree() Traceback (most recent call last): ... ValueError: element is not homogeneous - An example in a graded algebra: - sage: # needs sage.combinat sage.modules 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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> S = NonCommutativeSymmetricFunctions(QQ).S() >>> (x, y) = (S[Integer(2)], S[Integer(3)]) >>> x.homogeneous_degree() 2 >>> (x**Integer(3) + Integer(4)*y**Integer(2)).homogeneous_degree() 6 >>> ((Integer(1) + x)**Integer(3)).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous - Let us now test a filtered algebra (but remember that the notion of homogeneity now depends on the choice of a basis): - sage: A = AlgebrasWithBasis(QQ).Filtered().example() sage: x,y,z = A.algebra_generators() sage: (x*y).homogeneous_degree() 2 sage: (y*x).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous sage: A.one().homogeneous_degree() 0 - >>> from sage.all import * >>> A = AlgebrasWithBasis(QQ).Filtered().example() >>> x,y,z = A.algebra_generators() >>> (x*y).homogeneous_degree() 2 >>> (y*x).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous >>> A.one().homogeneous_degree() 0 
 - degree_on_basis(m)[source]¶
- Return the degree of the basis element indexed by - min- self.- EXAMPLES: - sage: A = GradedModulesWithBasis(QQ).example() # needs sage.combinat sage.modules sage: A.degree_on_basis(Partition((2,1))) # needs sage.combinat sage.modules 3 sage: A.degree_on_basis(Partition((4,2,1,1,1,1))) # needs sage.combinat sage.modules 10 - >>> from sage.all import * >>> A = GradedModulesWithBasis(QQ).example() # needs sage.combinat sage.modules >>> A.degree_on_basis(Partition((Integer(2),Integer(1)))) # needs sage.combinat sage.modules 3 >>> A.degree_on_basis(Partition((Integer(4),Integer(2),Integer(1),Integer(1),Integer(1),Integer(1)))) # needs sage.combinat sage.modules 10 
 - homogeneous_component(n)[source]¶
- Return the homogeneous component of degree - nof the element- self.- Let \(m\) be an element of a filtered \(R\)-module \(M\) with basis. Then, \(m\) can be uniquely written in the form \(m = \sum_{i \in I} m_i\), where each \(m_i\) is a homogeneous element of degree \(i\). For \(n \in I\), we define the homogeneous component of degree \(n\) of the element \(m\) to be \(m_n\). - EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().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 sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Graded().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 sage: A = AlgebrasWithBasis(ZZ).Filtered().example() sage: G = A.algebra_generators() sage: g = A.an_element() - 2 * G['x'] * G['y']; g U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 sage: g.homogeneous_component(-1) 0 sage: g.homogeneous_component(0) 1 sage: g.homogeneous_component(2) -2*U['x']*U['y'] sage: g.homogeneous_component(5) 0 sage: g.homogeneous_component(7) U['x']^2*U['y']^2*U['z']^3 sage: g.homogeneous_component(8) 0 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A.an_element(); x 2*P[] + 2*P[1] + 3*P[2] >>> x.homogeneous_component(-Integer(1)) 0 >>> x.homogeneous_component(Integer(0)) 2*P[] >>> x.homogeneous_component(Integer(1)) 2*P[1] >>> x.homogeneous_component(Integer(2)) 3*P[2] >>> x.homogeneous_component(Integer(3)) 0 >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Graded().example() >>> x = A.an_element(); x 2*P[] + 2*P[1] + 3*P[2] >>> x.homogeneous_component(-Integer(1)) 0 >>> x.homogeneous_component(Integer(0)) 2*P[] >>> x.homogeneous_component(Integer(1)) 2*P[1] >>> x.homogeneous_component(Integer(2)) 3*P[2] >>> x.homogeneous_component(Integer(3)) 0 >>> A = AlgebrasWithBasis(ZZ).Filtered().example() >>> G = A.algebra_generators() >>> g = A.an_element() - Integer(2) * G['x'] * G['y']; g U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 >>> g.homogeneous_component(-Integer(1)) 0 >>> g.homogeneous_component(Integer(0)) 1 >>> g.homogeneous_component(Integer(2)) -2*U['x']*U['y'] >>> g.homogeneous_component(Integer(5)) 0 >>> g.homogeneous_component(Integer(7)) U['x']^2*U['y']^2*U['z']^3 >>> g.homogeneous_component(Integer(8)) 0 
 - homogeneous_degree()[source]¶
- The degree of a nonzero homogeneous element - selfin the filtered module.- Note - This raises an error if the element is not homogeneous. To compute the maximum of the degrees of the homogeneous summands of a (not necessarily homogeneous) element, use - maximal_degree()instead.- EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A(Partition((Integer(3),Integer(2),Integer(1)))) >>> y = A(Partition((Integer(4),Integer(4),Integer(1)))) >>> z = A(Partition((Integer(2),Integer(2),Integer(2)))) >>> x.degree() 6 >>> (x + Integer(2)*z).degree() 6 >>> (y - x).degree() Traceback (most recent call last): ... ValueError: element is not homogeneous - An example in a graded algebra: - sage: # needs sage.combinat sage.modules 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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> S = NonCommutativeSymmetricFunctions(QQ).S() >>> (x, y) = (S[Integer(2)], S[Integer(3)]) >>> x.homogeneous_degree() 2 >>> (x**Integer(3) + Integer(4)*y**Integer(2)).homogeneous_degree() 6 >>> ((Integer(1) + x)**Integer(3)).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous - Let us now test a filtered algebra (but remember that the notion of homogeneity now depends on the choice of a basis): - sage: A = AlgebrasWithBasis(QQ).Filtered().example() sage: x,y,z = A.algebra_generators() sage: (x*y).homogeneous_degree() 2 sage: (y*x).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous sage: A.one().homogeneous_degree() 0 - >>> from sage.all import * >>> A = AlgebrasWithBasis(QQ).Filtered().example() >>> x,y,z = A.algebra_generators() >>> (x*y).homogeneous_degree() 2 >>> (y*x).homogeneous_degree() Traceback (most recent call last): ... ValueError: element is not homogeneous >>> A.one().homogeneous_degree() 0 
 - is_homogeneous()[source]¶
- Return whether the element - selfis homogeneous.- EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A(Partition((Integer(3),Integer(2),Integer(1)))) >>> y = A(Partition((Integer(4),Integer(4),Integer(1)))) >>> z = A(Partition((Integer(2),Integer(2),Integer(2)))) >>> (Integer(3)*x).is_homogeneous() True >>> (x - y).is_homogeneous() False >>> (x+Integer(2)*z).is_homogeneous() True - Here is an example with a graded algebra: - sage: # needs sage.combinat sage.modules 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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> S = NonCommutativeSymmetricFunctions(QQ).S() >>> (x, y) = (S[Integer(2)], S[Integer(3)]) >>> (Integer(3)*x).is_homogeneous() True >>> (x**Integer(3) - y**Integer(2)).is_homogeneous() True >>> ((x + y)**Integer(2)).is_homogeneous() False - Let us now test a filtered algebra (but remember that the notion of homogeneity now depends on the choice of a basis, or at least on a definition of homogeneous components): - sage: A = AlgebrasWithBasis(QQ).Filtered().example() sage: x,y,z = A.algebra_generators() sage: (x*y).is_homogeneous() True sage: (y*x).is_homogeneous() False sage: A.one().is_homogeneous() True sage: A.zero().is_homogeneous() True sage: (A.one()+x).is_homogeneous() False - >>> from sage.all import * >>> A = AlgebrasWithBasis(QQ).Filtered().example() >>> x,y,z = A.algebra_generators() >>> (x*y).is_homogeneous() True >>> (y*x).is_homogeneous() False >>> A.one().is_homogeneous() True >>> A.zero().is_homogeneous() True >>> (A.one()+x).is_homogeneous() False 
 - maximal_degree()[source]¶
- The maximum of the degrees of the homogeneous components of - self.- This is also the smallest \(i\) such that - selfbelongs to \(F_i\). Hence, it does not depend on the basis of the parent of- self.- See also - EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().example() sage: x = A(Partition((3,2,1))) sage: y = A(Partition((4,4,1))) sage: z = A(Partition((2,2,2))) sage: x.maximal_degree() 6 sage: (x + 2*z).maximal_degree() 6 sage: (y - x).maximal_degree() 9 sage: (3*z).maximal_degree() 6 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A(Partition((Integer(3),Integer(2),Integer(1)))) >>> y = A(Partition((Integer(4),Integer(4),Integer(1)))) >>> z = A(Partition((Integer(2),Integer(2),Integer(2)))) >>> x.maximal_degree() 6 >>> (x + Integer(2)*z).maximal_degree() 6 >>> (y - x).maximal_degree() 9 >>> (Integer(3)*z).maximal_degree() 6 - Now, we test this on a graded algebra: - sage: # needs sage.combinat sage.modules 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 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> S = NonCommutativeSymmetricFunctions(QQ).S() >>> (x, y) = (S[Integer(2)], S[Integer(3)]) >>> x.maximal_degree() 2 >>> (x**Integer(3) + Integer(4)*y**Integer(2)).maximal_degree() 6 >>> ((Integer(1) + x)**Integer(3)).maximal_degree() 6 - Let us now test a filtered algebra: - sage: # needs sage.combinat sage.modules sage: A = AlgebrasWithBasis(QQ).Filtered().example() sage: x,y,z = A.algebra_generators() sage: (x*y).maximal_degree() 2 sage: (y*x).maximal_degree() 2 sage: A.one().maximal_degree() 0 sage: A.zero().maximal_degree() Traceback (most recent call last): ... ValueError: the zero element does not have a well-defined degree sage: (A.one()+x).maximal_degree() 1 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = AlgebrasWithBasis(QQ).Filtered().example() >>> x,y,z = A.algebra_generators() >>> (x*y).maximal_degree() 2 >>> (y*x).maximal_degree() 2 >>> A.one().maximal_degree() 0 >>> A.zero().maximal_degree() Traceback (most recent call last): ... ValueError: the zero element does not have a well-defined degree >>> (A.one()+x).maximal_degree() 1 
 - truncate(n)[source]¶
- Return the sum of the homogeneous components of degree strictly less than - nof- self.- See - homogeneous_component()for the notion of a homogeneous component.- EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Filtered().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] sage: # needs sage.combinat sage.modules sage: A = ModulesWithBasis(ZZ).Graded().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] sage: A = AlgebrasWithBasis(ZZ).Filtered().example() sage: G = A.algebra_generators() sage: g = A.an_element() - 2 * G['x'] * G['y']; g U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 sage: g.truncate(-1) 0 sage: g.truncate(0) 0 sage: g.truncate(2) 2*U['x'] + 3*U['y'] + 1 sage: g.truncate(3) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 sage: g.truncate(5) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 sage: g.truncate(7) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 sage: g.truncate(8) U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> x = A.an_element(); x 2*P[] + 2*P[1] + 3*P[2] >>> x.truncate(Integer(0)) 0 >>> x.truncate(Integer(1)) 2*P[] >>> x.truncate(Integer(2)) 2*P[] + 2*P[1] >>> x.truncate(Integer(3)) 2*P[] + 2*P[1] + 3*P[2] >>> # needs sage.combinat sage.modules >>> A = ModulesWithBasis(ZZ).Graded().example() >>> x = A.an_element(); x 2*P[] + 2*P[1] + 3*P[2] >>> x.truncate(Integer(0)) 0 >>> x.truncate(Integer(1)) 2*P[] >>> x.truncate(Integer(2)) 2*P[] + 2*P[1] >>> x.truncate(Integer(3)) 2*P[] + 2*P[1] + 3*P[2] >>> A = AlgebrasWithBasis(ZZ).Filtered().example() >>> G = A.algebra_generators() >>> g = A.an_element() - Integer(2) * G['x'] * G['y']; g U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 >>> g.truncate(-Integer(1)) 0 >>> g.truncate(Integer(0)) 0 >>> g.truncate(Integer(2)) 2*U['x'] + 3*U['y'] + 1 >>> g.truncate(Integer(3)) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 >>> g.truncate(Integer(5)) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 >>> g.truncate(Integer(7)) -2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 >>> g.truncate(Integer(8)) U['x']^2*U['y']^2*U['z']^3 - 2*U['x']*U['y'] + 2*U['x'] + 3*U['y'] + 1 
 
 - class FiniteDimensional(base_category)[source]¶
- Bases: - CategoryWithAxiom_over_base_ring- class ParentMethods[source]¶
- Bases: - object- hilbert_series(prec=None)[source]¶
- Return the Hilbert series of - selfas a polynomial.- Let \(R\) be a commutative ring (with unit). Let \(M = \bigcup_{n=0}^{\infty} M_n\) be a filtered \(R\)-module. The Hilbert series of \(M\) is the formal power series \[H(t) = \sum_{n=0}^{\infty} \ell(M_n / M_{n-1}) t^n,\]- where \(\ell(N)\) is the length of \(N\), which is the longest chain of submodules (over \(R\)), and by convention \(M_{-1} = \{0\}\). By the assumptions of the category, \(M_n / M_{n-1}\) is a free \(R\)-module, and so \(\ell(M_n / M_{n-1})\) is equal to the rank of \(M_n / M_{n-1}\). - EXAMPLES: - sage: OS = hyperplane_arrangements.braid(3).orlik_solomon_algebra(QQ) sage: OS.hilbert_series() 2*t^2 + 3*t + 1 sage: OS = matroids.Uniform(5, 3).orlik_solomon_algebra(ZZ) sage: OS.hilbert_series() t^3 + 3*t^2 + 3*t + 1 sage: OS = matroids.PG(2, 3).orlik_solomon_algebra(ZZ['x','y']) sage: OS.hilbert_series() 27*t^3 + 39*t^2 + 13*t + 1 - >>> from sage.all import * >>> OS = hyperplane_arrangements.braid(Integer(3)).orlik_solomon_algebra(QQ) >>> OS.hilbert_series() 2*t^2 + 3*t + 1 >>> OS = matroids.Uniform(Integer(5), Integer(3)).orlik_solomon_algebra(ZZ) >>> OS.hilbert_series() t^3 + 3*t^2 + 3*t + 1 >>> OS = matroids.PG(Integer(2), Integer(3)).orlik_solomon_algebra(ZZ['x','y']) >>> OS.hilbert_series() 27*t^3 + 39*t^2 + 13*t + 1 
 
 
 - class ParentMethods[source]¶
- Bases: - object- basis(d=None)[source]¶
- Return the basis for (the - d-th homogeneous component of)- self.- INPUT: - d– (default:- None) nonnegative integer or- None
 - OUTPUT: - If - dis- None, returns the basis of the module. Otherwise, returns the basis of the homogeneous component of degree- d(i.e., the subfamily of the basis of the whole module which consists only of the basis vectors lying in \(F_d \setminus \bigcup_{i<d} F_i\)).- The basis is always returned as a family. - EXAMPLES: - sage: A = ModulesWithBasis(ZZ).Filtered().example() sage: A.basis(4) Lazy family (Term map from Partitions to An example of a filtered module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions of the integer 4} - >>> from sage.all import * >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> A.basis(Integer(4)) Lazy family (Term map from Partitions to An example of a filtered 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 filtered 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 filtered module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions} - >>> from sage.all import * >>> A.basis() Lazy family (Term map from Partitions to An example of a filtered module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions} >>> A.basis() Lazy family (Term map from Partitions to An example of a filtered module with basis: the free module on partitions over Integer Ring(i))_{i in Partitions} - Checking this method on a filtered algebra. Note that this will typically raise a - NotImplementedErrorwhen this feature is not implemented.- sage: A = AlgebrasWithBasis(ZZ).Filtered().example() sage: A.basis(4) Traceback (most recent call last): ... NotImplementedError: infinite set - >>> from sage.all import * >>> A = AlgebrasWithBasis(ZZ).Filtered().example() >>> A.basis(Integer(4)) Traceback (most recent call last): ... NotImplementedError: infinite set - Without arguments, the full basis is returned: - sage: A.basis() Lazy family (Term map from Free abelian monoid indexed by {'x', 'y', 'z'} to An example of a filtered algebra with basis: the universal enveloping algebra of Lie algebra of RR^3 with cross product over Integer Ring(i))_{i in Free abelian monoid indexed by {'x', 'y', 'z'}} - >>> from sage.all import * >>> A.basis() Lazy family (Term map from Free abelian monoid indexed by {'x', 'y', 'z'} to An example of a filtered algebra with basis: the universal enveloping algebra of Lie algebra of RR^3 with cross product over Integer Ring(i))_{i in Free abelian monoid indexed by {'x', 'y', 'z'}} - An example with a graded algebra: - sage: E.<x,y> = ExteriorAlgebra(QQ) sage: E.basis() Lazy family (Term map from Subsets of {0,1} to The exterior algebra of rank 2 over Rational Field(i))_{i in Subsets of {0,1}} - >>> from sage.all import * >>> E = ExteriorAlgebra(QQ, names=('x', 'y',)); (x, y,) = E._first_ngens(2) >>> E.basis() Lazy family (Term map from Subsets of {0,1} to The exterior algebra of rank 2 over Rational Field(i))_{i in Subsets of {0,1}} 
 - from_graded_conversion()[source]¶
- Return the inverse of the canonical \(R\)-module isomorphism \(A \to \operatorname{gr} A\) induced by the basis of \(A\) (where \(A = ` ``self`\)). This inverse is an isomorphism \(\operatorname{gr} A \to A\). - This is an isomorphism of \(R\)-modules. See the class documentation - AssociatedGradedAlgebra.- See also - EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = Modules(QQ).WithBasis().Filtered().example() sage: p = -2 * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] sage: q = A.to_graded_conversion()(p); q -4*Bbar[[]] - 4*Bbar[[1]] - 6*Bbar[[2]] sage: A.from_graded_conversion()(q) == p True sage: q.parent() is A.graded_algebra() True - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = Modules(QQ).WithBasis().Filtered().example() >>> p = -Integer(2) * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] >>> q = A.to_graded_conversion()(p); q -4*Bbar[[]] - 4*Bbar[[1]] - 6*Bbar[[2]] >>> A.from_graded_conversion()(q) == p True >>> q.parent() is A.graded_algebra() True 
 - graded_algebra()[source]¶
- Return the associated graded module to - self.- See - AssociatedGradedAlgebrafor the definition and the properties of this.- If the filtered module - selfwith basis is called \(A\), then this method returns \(\operatorname{gr} A\). The method- to_graded_conversion()returns the canonical \(R\)-module isomorphism \(A \to \operatorname{gr} A\) induced by the basis of \(A\), and the method- from_graded_conversion()returns the inverse of this isomorphism. The method- projection()projects elements of \(A\) onto \(\operatorname{gr} A\) according to their place in the filtration on \(A\).- Warning - When not overridden, this method returns the default implementation of an associated graded module – namely, - AssociatedGradedAlgebra(self), where- AssociatedGradedAlgebrais- AssociatedGradedAlgebra. But some instances of- FilteredModulesWithBasisoverride this method, as the associated graded module often is (isomorphic) to a simpler object (for instance, the associated graded module of a graded module can be identified with the graded module itself). Generic code that uses associated graded modules (such as the code of the- induced_graded_map()method below) should make sure to only communicate with them via the- to_graded_conversion(),- from_graded_conversion()and- projection()methods (in particular, do not expect there to be a conversion from- selfto- self.graded_algebra(); this currently does not work for Clifford algebras). Similarly, when overriding- graded_algebra(), make sure to accordingly redefine these three methods, unless their definitions below still apply to your case (this will happen whenever the basis of your- graded_algebra()has the same indexing set as- self, and the partition of this indexing set according to degree is the same as for- self).- EXAMPLES: - sage: A = ModulesWithBasis(ZZ).Filtered().example() sage: A.graded_algebra() Graded Module of An example of a filtered module with basis: the free module on partitions over Integer Ring - >>> from sage.all import * >>> A = ModulesWithBasis(ZZ).Filtered().example() >>> A.graded_algebra() Graded Module of An example of a filtered module with basis: the free module on partitions over Integer Ring 
 - hilbert_series(prec=None)[source]¶
- Return the Hilbert series of - self.- Let \(R\) be a commutative ring (with unit). Let \(M = \bigcup_{n=0}^{\infty} M_n\) be a filtered \(R\)-module. The Hilbert series of \(M\) is the formal power series \[H(t) = \sum_{n=0}^{\infty} \ell(M_n / M_{n-1}) t^n,\]- where \(\ell(N)\) is the length of \(N\), which is the longest chain of submodules (over \(R\)), and by convention \(M_{-1} = \{0\}\). By the assumptions of the category, \(M_n / M_{n-1}\) is a free \(R\)-module, and so \(\ell(M_n / M_{n-1})\) is equal to the rank of \(M_n / M_{n-1}\). - INPUT: - prec– (default: \(\infty\)) the precision
 - OUTPUT: - If the precision is finite, then this returns an element in the - PowerSeriesRingover- ZZ. Otherwise it returns an element in the- LazyPowerSeriesRingover- ZZ.- EXAMPLES: - sage: A = GradedModulesWithBasis(ZZ).example() sage: A.hilbert_series() 1 + t + 2*t^2 + 3*t^3 + 5*t^4 + 7*t^5 + 11*t^6 + O(t^7) sage: A.hilbert_series(10) 1 + t + 2*t^2 + 3*t^3 + 5*t^4 + 7*t^5 + 11*t^6 + 15*t^7 + 22*t^8 + 30*t^9 + O(t^10) - >>> from sage.all import * >>> A = GradedModulesWithBasis(ZZ).example() >>> A.hilbert_series() 1 + t + 2*t^2 + 3*t^3 + 5*t^4 + 7*t^5 + 11*t^6 + O(t^7) >>> A.hilbert_series(Integer(10)) 1 + t + 2*t^2 + 3*t^3 + 5*t^4 + 7*t^5 + 11*t^6 + 15*t^7 + 22*t^8 + 30*t^9 + O(t^10) 
 - homogeneous_component(d)[source]¶
- Return the - d-th homogeneous component of- self.- EXAMPLES: - sage: A = GradedModulesWithBasis(ZZ).example() sage: A.homogeneous_component(4) Degree 4 homogeneous component of An example of a graded module with basis: the free module on partitions over Integer Ring - >>> from sage.all import * >>> A = GradedModulesWithBasis(ZZ).example() >>> A.homogeneous_component(Integer(4)) Degree 4 homogeneous component of An example of a graded module with basis: the free module on partitions over Integer Ring 
 - homogeneous_component_basis(d)[source]¶
- Return a basis for the - d-th homogeneous component of- self.- EXAMPLES: - sage: A = GradedModulesWithBasis(ZZ).example() sage: A.homogeneous_component_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} sage: # needs sage.modules sage: cat = GradedModulesWithBasis(ZZ) sage: C = CombinatorialFreeModule(ZZ, ['a', 'b'], category=cat) sage: C.degree_on_basis = lambda x: 1 if x == 'a' else 2 sage: C.homogeneous_component_basis(1) Finite family {'a': B['a']} sage: C.homogeneous_component_basis(2) Finite family {'b': B['b']} - >>> from sage.all import * >>> A = GradedModulesWithBasis(ZZ).example() >>> A.homogeneous_component_basis(Integer(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} >>> # needs sage.modules >>> cat = GradedModulesWithBasis(ZZ) >>> C = CombinatorialFreeModule(ZZ, ['a', 'b'], category=cat) >>> C.degree_on_basis = lambda x: Integer(1) if x == 'a' else Integer(2) >>> C.homogeneous_component_basis(Integer(1)) Finite family {'a': B['a']} >>> C.homogeneous_component_basis(Integer(2)) Finite family {'b': B['b']} 
 - induced_graded_map(other, f)[source]¶
- Return the graded linear map between the associated graded modules of - selfand- othercanonically induced by the filtration-preserving map- f : self -> other.- Let \(A\) and \(B\) be two filtered modules with basis, and let \((F_i)_{i \in I}\) and \((G_i)_{i \in I}\) be their filtrations. Let \(f : A \to B\) be a linear map which preserves the filtration (i.e., satisfies \(f(F_i) \subseteq G_i\) for all \(i \in I\)). Then, there is a canonically defined graded linear map \(\operatorname{gr} f : \operatorname{gr} A \to \operatorname{gr} B\) which satisfies \[(\operatorname{gr} f) (p_i(a)) = p_i(f(a)) \qquad \text{for all } i \in I \text{ and } a \in F_i ,\]- where the \(p_i\) on the left hand side is the canonical projection from \(F_i\) onto the \(i\)-th graded component of \(\operatorname{gr} A\), while the \(p_i\) on the right hand side is the canonical projection from \(G_i\) onto the \(i\)-th graded component of \(\operatorname{gr} B\). - INPUT: - other– a filtered algebra with basis
- f– a filtration-preserving linear map from- selfto- other(can be given as a morphism or as a function)
 - OUTPUT: the graded linear map \(\operatorname{gr} f\) - EXAMPLES: - Example 1. - We start with the free \(\QQ\)-module with basis the set of all partitions: - sage: A = Modules(QQ).WithBasis().Filtered().example(); A # needs sage.combinat sage.modules An example of a filtered module with basis: the free module on partitions over Rational Field sage: M = A.indices(); M # needs sage.combinat sage.modules Partitions sage: p1, p2, p21, p321 = [A.basis()[Partition(i)] # needs sage.combinat sage.modules ....: for i in [[1], [2], [2,1], [3,2,1]]] - >>> from sage.all import * >>> A = Modules(QQ).WithBasis().Filtered().example(); A # needs sage.combinat sage.modules An example of a filtered module with basis: the free module on partitions over Rational Field >>> M = A.indices(); M # needs sage.combinat sage.modules Partitions >>> p1, p2, p21, p321 = [A.basis()[Partition(i)] # needs sage.combinat sage.modules ... for i in [[Integer(1)], [Integer(2)], [Integer(2),Integer(1)], [Integer(3),Integer(2),Integer(1)]]] - Let us define a map from - Ato itself which acts on the basis by sending every partition \(\lambda\) to the sum of the conjugates of all partitions \(\mu\) for which \(\lambda / \mu\) is a horizontal strip:- sage: # needs sage.combinat sage.modules sage: def map_on_basis(lam): ....: def mus(k): ....: return lam.remove_horizontal_border_strip(k) ....: return A.sum_of_monomials([Partition(mu).conjugate() ....: for k in range(sum(lam) + 1) ....: for mu in mus(k)]) sage: f = A.module_morphism(on_basis=map_on_basis, ....: codomain=A) sage: f(p1) P[] + P[1] sage: f(p2) P[] + P[1] + P[1, 1] sage: f(p21) P[1] + P[1, 1] + P[2] + P[2, 1] sage: f(p21 - p1) -P[] + P[1, 1] + P[2] + P[2, 1] sage: f(p321) P[2, 1] + P[2, 1, 1] + P[2, 2] + P[2, 2, 1] + P[3, 1] + P[3, 1, 1] + P[3, 2] + P[3, 2, 1] - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> def map_on_basis(lam): ... def mus(k): ... return lam.remove_horizontal_border_strip(k) ... return A.sum_of_monomials([Partition(mu).conjugate() ... for k in range(sum(lam) + Integer(1)) ... for mu in mus(k)]) >>> f = A.module_morphism(on_basis=map_on_basis, ... codomain=A) >>> f(p1) P[] + P[1] >>> f(p2) P[] + P[1] + P[1, 1] >>> f(p21) P[1] + P[1, 1] + P[2] + P[2, 1] >>> f(p21 - p1) -P[] + P[1, 1] + P[2] + P[2, 1] >>> f(p321) P[2, 1] + P[2, 1, 1] + P[2, 2] + P[2, 2, 1] + P[3, 1] + P[3, 1, 1] + P[3, 2] + P[3, 2, 1] - We now compute \(\operatorname{gr} f\) - sage: # needs sage.combinat sage.modules sage: grA = A.graded_algebra(); grA Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field sage: pp1, pp2, pp21, pp321 = [A.to_graded_conversion()(i) ....: for i in [p1, p2, p21, p321]] sage: pp2 + 4 * pp21 Bbar[[2]] + 4*Bbar[[2, 1]] sage: grf = A.induced_graded_map(A, f); grf Generic endomorphism of Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field sage: grf(pp1) Bbar[[1]] sage: grf(pp2 + 4 * pp21) Bbar[[1, 1]] + 4*Bbar[[2, 1]] - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> grA = A.graded_algebra(); grA Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field >>> pp1, pp2, pp21, pp321 = [A.to_graded_conversion()(i) ... for i in [p1, p2, p21, p321]] >>> pp2 + Integer(4) * pp21 Bbar[[2]] + 4*Bbar[[2, 1]] >>> grf = A.induced_graded_map(A, f); grf Generic endomorphism of Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field >>> grf(pp1) Bbar[[1]] >>> grf(pp2 + Integer(4) * pp21) Bbar[[1, 1]] + 4*Bbar[[2, 1]] - Example 2. - We shall now construct \(\operatorname{gr} f\) for a different map \(f\) out of the same - A; the new map \(f\) will lead into a graded algebra already, namely into the algebra of symmetric functions:- sage: # needs sage.combinat sage.modules sage: h = SymmetricFunctions(QQ).h() sage: def map_on_basis(lam): # redefining map_on_basis ....: def mus(k): ....: return lam.remove_horizontal_border_strip(k) ....: return h.sum_of_monomials([Partition(mu).conjugate() ....: for k in range(sum(lam) + 1) ....: for mu in mus(k)]) sage: f = A.module_morphism(on_basis=map_on_basis, ....: codomain=h) # redefining f sage: f(p1) h[] + h[1] sage: f(p2) h[] + h[1] + h[1, 1] sage: f(A.zero()) 0 sage: f(p2 - 3*p1) -2*h[] - 2*h[1] + h[1, 1] - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> h = SymmetricFunctions(QQ).h() >>> def map_on_basis(lam): # redefining map_on_basis ... def mus(k): ... return lam.remove_horizontal_border_strip(k) ... return h.sum_of_monomials([Partition(mu).conjugate() ... for k in range(sum(lam) + Integer(1)) ... for mu in mus(k)]) >>> f = A.module_morphism(on_basis=map_on_basis, ... codomain=h) # redefining f >>> f(p1) h[] + h[1] >>> f(p2) h[] + h[1] + h[1, 1] >>> f(A.zero()) 0 >>> f(p2 - Integer(3)*p1) -2*h[] - 2*h[1] + h[1, 1] - The algebra - hof symmetric functions in the \(h\)-basis is already graded, so its associated graded algebra is implemented as itself:- sage: # needs sage.combinat sage.modules sage: grh = h.graded_algebra(); grh is h True sage: grf = A.induced_graded_map(h, f); grf Generic morphism: From: Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field To: Symmetric Functions over Rational Field in the homogeneous basis sage: grf(pp1) h[1] sage: grf(pp2) h[1, 1] sage: grf(pp321) h[3, 2, 1] sage: grf(pp2 - 3*pp1) -3*h[1] + h[1, 1] sage: grf(pp21) h[2, 1] sage: grf(grA.zero()) 0 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> grh = h.graded_algebra(); grh is h True >>> grf = A.induced_graded_map(h, f); grf Generic morphism: From: Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field To: Symmetric Functions over Rational Field in the homogeneous basis >>> grf(pp1) h[1] >>> grf(pp2) h[1, 1] >>> grf(pp321) h[3, 2, 1] >>> grf(pp2 - Integer(3)*pp1) -3*h[1] + h[1, 1] >>> grf(pp21) h[2, 1] >>> grf(grA.zero()) 0 - Example 3. - After having had a graded module as the codomain, let us try to have one as the domain instead. Our new - fwill go from- hto- A:- sage: # needs sage.combinat sage.modules sage: def map_on_basis(lam): # redefining map_on_basis ....: def mus(k): ....: return lam.remove_horizontal_border_strip(k) ....: return A.sum_of_monomials([Partition(mu).conjugate() ....: for k in range(sum(lam) + 1) ....: for mu in mus(k)]) sage: f = h.module_morphism(on_basis=map_on_basis, ....: codomain=A) # redefining f sage: f(h[1]) P[] + P[1] sage: f(h[2]) P[] + P[1] + P[1, 1] sage: f(h[1, 1]) P[1] + P[2] sage: f(h[2, 2]) P[1, 1] + P[2, 1] + P[2, 2] sage: f(h[3, 2, 1]) P[2, 1] + P[2, 1, 1] + P[2, 2] + P[2, 2, 1] + P[3, 1] + P[3, 1, 1] + P[3, 2] + P[3, 2, 1] sage: f(h.one()) P[] sage: grf = h.induced_graded_map(A, f); grf Generic morphism: From: Symmetric Functions over Rational Field in the homogeneous basis To: Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field sage: grf(h[1]) Bbar[[1]] sage: grf(h[2]) Bbar[[1, 1]] sage: grf(h[1, 1]) Bbar[[2]] sage: grf(h[2, 2]) Bbar[[2, 2]] sage: grf(h[3, 2, 1]) Bbar[[3, 2, 1]] sage: grf(h.one()) Bbar[[]] - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> def map_on_basis(lam): # redefining map_on_basis ... def mus(k): ... return lam.remove_horizontal_border_strip(k) ... return A.sum_of_monomials([Partition(mu).conjugate() ... for k in range(sum(lam) + Integer(1)) ... for mu in mus(k)]) >>> f = h.module_morphism(on_basis=map_on_basis, ... codomain=A) # redefining f >>> f(h[Integer(1)]) P[] + P[1] >>> f(h[Integer(2)]) P[] + P[1] + P[1, 1] >>> f(h[Integer(1), Integer(1)]) P[1] + P[2] >>> f(h[Integer(2), Integer(2)]) P[1, 1] + P[2, 1] + P[2, 2] >>> f(h[Integer(3), Integer(2), Integer(1)]) P[2, 1] + P[2, 1, 1] + P[2, 2] + P[2, 2, 1] + P[3, 1] + P[3, 1, 1] + P[3, 2] + P[3, 2, 1] >>> f(h.one()) P[] >>> grf = h.induced_graded_map(A, f); grf Generic morphism: From: Symmetric Functions over Rational Field in the homogeneous basis To: Graded Module of An example of a filtered module with basis: the free module on partitions over Rational Field >>> grf(h[Integer(1)]) Bbar[[1]] >>> grf(h[Integer(2)]) Bbar[[1, 1]] >>> grf(h[Integer(1), Integer(1)]) Bbar[[2]] >>> grf(h[Integer(2), Integer(2)]) Bbar[[2, 2]] >>> grf(h[Integer(3), Integer(2), Integer(1)]) Bbar[[3, 2, 1]] >>> grf(h.one()) Bbar[[]] - Example 4. - The construct \(\operatorname{gr} f\) also makes sense when \(f\) is a filtration-preserving map between graded modules. - sage: # needs sage.combinat sage.modules sage: def map_on_basis(lam): # redefining map_on_basis ....: def mus(k): ....: return lam.remove_horizontal_border_strip(k) ....: return h.sum_of_monomials([Partition(mu).conjugate() ....: for k in range(sum(lam) + 1) ....: for mu in mus(k)]) sage: f = h.module_morphism(on_basis=map_on_basis, ....: codomain=h) # redefining f sage: f(h[1]) h[] + h[1] sage: f(h[2]) h[] + h[1] + h[1, 1] sage: f(h[1, 1]) h[1] + h[2] sage: f(h[2, 1]) h[1] + h[1, 1] + h[2] + h[2, 1] sage: f(h.one()) h[] sage: grf = h.induced_graded_map(h, f); grf Generic endomorphism of Symmetric Functions over Rational Field in the homogeneous basis sage: grf(h[1]) h[1] sage: grf(h[2]) h[1, 1] sage: grf(h[1, 1]) h[2] sage: grf(h[2, 1]) h[2, 1] sage: grf(h.one()) h[] - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> def map_on_basis(lam): # redefining map_on_basis ... def mus(k): ... return lam.remove_horizontal_border_strip(k) ... return h.sum_of_monomials([Partition(mu).conjugate() ... for k in range(sum(lam) + Integer(1)) ... for mu in mus(k)]) >>> f = h.module_morphism(on_basis=map_on_basis, ... codomain=h) # redefining f >>> f(h[Integer(1)]) h[] + h[1] >>> f(h[Integer(2)]) h[] + h[1] + h[1, 1] >>> f(h[Integer(1), Integer(1)]) h[1] + h[2] >>> f(h[Integer(2), Integer(1)]) h[1] + h[1, 1] + h[2] + h[2, 1] >>> f(h.one()) h[] >>> grf = h.induced_graded_map(h, f); grf Generic endomorphism of Symmetric Functions over Rational Field in the homogeneous basis >>> grf(h[Integer(1)]) h[1] >>> grf(h[Integer(2)]) h[1, 1] >>> grf(h[Integer(1), Integer(1)]) h[2] >>> grf(h[Integer(2), Integer(1)]) h[2, 1] >>> grf(h.one()) h[] 
 - projection(i)[source]¶
- Return the \(i\)-th projection \(p_i : F_i \to G_i\) (in the notations of the class documentation - AssociatedGradedAlgebra, where \(A = ` ``self`\)).- This method actually does not return the map \(p_i\) itself, but an extension of \(p_i\) to the whole \(R\)-module \(A\). This extension is the composition of the \(R\)-module isomorphism \(A \to \operatorname{gr} A\) with the canonical projection of the graded \(R\)-module \(\operatorname{gr} A\) onto its \(i\)-th graded component \(G_i\). The codomain of this map is \(\operatorname{gr} A\), although its actual image is \(G_i\). The map \(p_i\) is obtained from this map by restricting its domain to \(F_i\) and its image to \(G_i\). - EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = Modules(ZZ).WithBasis().Filtered().example() sage: p = -2 * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] sage: q = A.projection(2)(p); q -6*Bbar[[2]] sage: q.parent() is A.graded_algebra() True sage: A.projection(3)(p) 0 - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = Modules(ZZ).WithBasis().Filtered().example() >>> p = -Integer(2) * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] >>> q = A.projection(Integer(2))(p); q -6*Bbar[[2]] >>> q.parent() is A.graded_algebra() True >>> A.projection(Integer(3))(p) 0 
 - to_graded_conversion()[source]¶
- Return the canonical \(R\)-module isomorphism \(A \to \operatorname{gr} A\) induced by the basis of \(A\) (where \(A = ` ``self`\)). - This is an isomorphism of \(R\)-modules. See the class documentation - AssociatedGradedAlgebra.- See also - EXAMPLES: - sage: # needs sage.combinat sage.modules sage: A = Modules(QQ).WithBasis().Filtered().example() sage: p = -2 * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] sage: q = A.to_graded_conversion()(p); q -4*Bbar[[]] - 4*Bbar[[1]] - 6*Bbar[[2]] sage: q.parent() is A.graded_algebra() True - >>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = Modules(QQ).WithBasis().Filtered().example() >>> p = -Integer(2) * A.an_element(); p -4*P[] - 4*P[1] - 6*P[2] >>> q = A.to_graded_conversion()(p); q -4*Bbar[[]] - 4*Bbar[[1]] - 6*Bbar[[2]] >>> q.parent() is A.graded_algebra() True 
 
 - class Subobjects(category, *args)[source]¶
- Bases: - SubobjectsCategory- class ElementMethods[source]¶
- Bases: - object- degree()[source]¶
- Return the degree of - self.- EXAMPLES: - sage: # needs sage.modules sage: E.<x,y,z> = ExteriorAlgebra(QQ) sage: S = E.submodule([x + y, x*y - y*z, y]) sage: B = S.basis() sage: [B[0].lift(), B[1].lift(), B[2].lift()] [x, y, x*y - y*z] sage: B[0].degree() 1 sage: B[1].degree() 1 sage: (B[0] + 3*B[1]).degree() 1 - >>> from sage.all import * >>> # needs sage.modules >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3) >>> S = E.submodule([x + y, x*y - y*z, y]) >>> B = S.basis() >>> [B[Integer(0)].lift(), B[Integer(1)].lift(), B[Integer(2)].lift()] [x, y, x*y - y*z] >>> B[Integer(0)].degree() 1 >>> B[Integer(1)].degree() 1 >>> (B[Integer(0)] + Integer(3)*B[Integer(1)]).degree() 1 - The degree of inhomogeneous elements is not defined (following the behavior of the exterior algebra): - sage: (B[0] + B[2]).degree() # needs sage.modules Traceback (most recent call last): ... ValueError: element is not homogeneous - >>> from sage.all import * >>> (B[Integer(0)] + B[Integer(2)]).degree() # needs sage.modules Traceback (most recent call last): ... ValueError: element is not homogeneous - We can still get the maximal degree: - sage: (B[0] + B[2]).maximal_degree() # needs sage.modules 2 - >>> from sage.all import * >>> (B[Integer(0)] + B[Integer(2)]).maximal_degree() # needs sage.modules 2 
 - maximal_degree()[source]¶
- The maximum of the degrees of the homogeneous components of - self.- This is also the smallest \(i\) such that - selfbelongs to \(F_i\). Hence, it does not depend on the basis of the parent of- self.- See also - homogeneous_degree()- EXAMPLES: - sage: # needs sage.modules sage: E.<x,y,z> = ExteriorAlgebra(QQ) sage: F = E.submodule([x + 1, x*y - 1]) sage: B = F.basis() sage: [B[0].lift(), B[1].lift()] [-x*y + 1, x*y + x] sage: B[0].maximal_degree() 2 sage: B[1].maximal_degree() 2 - >>> from sage.all import * >>> # needs sage.modules >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3) >>> F = E.submodule([x + Integer(1), x*y - Integer(1)]) >>> B = F.basis() >>> [B[Integer(0)].lift(), B[Integer(1)].lift()] [-x*y + 1, x*y + x] >>> B[Integer(0)].maximal_degree() 2 >>> B[Integer(1)].maximal_degree() 2 
 
 - class ParentMethods[source]¶
- Bases: - object- degree_on_basis(m)[source]¶
- Return the degree of the basis element indexed by - min- self.- EXAMPLES: - sage: # needs sage.modules sage: E.<x,y,z> = ExteriorAlgebra(QQ) sage: S = E.submodule([x + y, x*y - y*z, y]) sage: B = S.basis() sage: [B[0].lift(), B[1].lift(), B[2].lift()] [x, y, x*y - y*z] sage: S.degree_on_basis(0) 1 sage: S.degree_on_basis(1) 1 sage: S.degree_on_basis(2) 2 - >>> from sage.all import * >>> # needs sage.modules >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3) >>> S = E.submodule([x + y, x*y - y*z, y]) >>> B = S.basis() >>> [B[Integer(0)].lift(), B[Integer(1)].lift(), B[Integer(2)].lift()] [x, y, x*y - y*z] >>> S.degree_on_basis(Integer(0)) 1 >>> S.degree_on_basis(Integer(1)) 1 >>> S.degree_on_basis(Integer(2)) 2