Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Super modules with basis """ #***************************************************************************** # Copyright (C) 2015 Travis Scrimshaw <tscrim at ucdavis.edu> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #******************************************************************************
""" The category of super modules with a distinguished basis.
An `R`-*super module with a distinguished basis* is an `R`-super module equipped with an `R`-module basis whose elements are homogeneous.
EXAMPLES::
sage: C = GradedModulesWithBasis(ZZ); C Category of graded modules with basis over Integer Ring sage: sorted(C.super_categories(), key=str) [Category of filtered modules with basis over Integer Ring, Category of graded modules over Integer Ring] sage: C is ModulesWithBasis(ZZ).Graded() True
TESTS::
sage: TestSuite(C).run() """ """ Return the parity of the basis element indexed by ``m``.
OUTPUT:
``0`` if ``m`` is for an even element or ``1`` if ``m`` is for an odd element.
.. NOTE::
The default implementation assumes that the even/odd is determined by the parity of :meth:`degree`.
Overwrite this method if the even/odd behavior is desired to be independent.
EXAMPLES::
sage: Q = QuadraticForm(QQ, 2, [1,2,3]) sage: C.<x,y> = CliffordAlgebra(Q) sage: C._even_odd_on_basis((0,)) 1 sage: C._even_odd_on_basis((0,1)) 0 """
r""" Return whether this element is homogeneous, in the sense of a super module (i.e., is even or odd).
EXAMPLES::
sage: Q = QuadraticForm(QQ, 2, [1,2,3]) sage: C.<x,y> = CliffordAlgebra(Q) sage: a = x + y sage: a.is_super_homogeneous() True sage: a = x*y + 4 sage: a.is_super_homogeneous() True sage: a = x*y + x - 3*y + 4 sage: a.is_super_homogeneous() False
The exterior algebra has a `\ZZ` grading, which induces the `\ZZ / 2\ZZ` grading. However the definition of homogeneous elements differs because of the different gradings::
sage: E.<x,y> = ExteriorAlgebra(QQ) sage: a = x*y + 4 sage: a.is_super_homogeneous() True sage: a.is_homogeneous() False """ else:
""" Return ``0`` if ``self`` is an even element and ``1`` if ``self`` is an odd element.
EXAMPLES::
sage: Q = QuadraticForm(QQ, 2, [1,2,3]) sage: C.<x,y> = CliffordAlgebra(Q) sage: a = x + y sage: a.is_even_odd() 1 sage: a = x*y + 4 sage: a.is_even_odd() 0 sage: a = x + 4 sage: a.is_even_odd() Traceback (most recent call last): ... ValueError: element is not homogeneous
sage: E.<x,y> = ExteriorAlgebra(QQ) sage: (x*y).is_even_odd() 0 """ raise ValueError("the zero element does not have a well-defined degree")
""" Return the even component of ``self``.
EXAMPLES::
sage: Q = QuadraticForm(QQ, 2, [1,2,3]) sage: C.<x,y> = CliffordAlgebra(Q) sage: a = x*y + x - 3*y + 4 sage: a.even_component() x*y + 4
TESTS:
Check that this really return ``A.zero()`` and not a plain ``0``::
sage: a = x + y sage: a.even_component().parent() is C True """ for (i, c) in self if even_odd(i) == 0)
""" Return the odd component of ``self``.
EXAMPLES::
sage: Q = QuadraticForm(QQ, 2, [1,2,3]) sage: C.<x,y> = CliffordAlgebra(Q) sage: a = x*y + x - 3*y + 4 sage: a.odd_component() x - 3*y
TESTS:
Check that this really return ``A.zero()`` and not a plain ``0``::
sage: a = x*y sage: a.odd_component().parent() is C True """ for (i, c) in self if even_odd(i) == 1)
|