# Super modules with basis#

class sage.categories.super_modules_with_basis.SuperModulesWithBasis(base_category)[source]#

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(QQ); C
Category of graded vector spaces with basis over Rational Field
sage: sorted(C.super_categories(), key=str)
[Category of filtered vector spaces with basis over Rational Field,
Category of graded modules with basis over Rational Field,
Category of graded vector spaces over Rational Field]
True

>>> from sage.all import *
Category of graded vector spaces with basis over Rational Field
>>> sorted(C.super_categories(), key=str)
[Category of filtered vector spaces with basis over Rational Field,
Category of graded modules with basis over Rational Field,
Category of graded vector spaces over Rational Field]
True

class ElementMethods[source]#

Bases: object

even_component()[source]#

Return the even component of self.

EXAMPLES:

sage: # needs sage.modules
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

>>> from sage.all import *
>>> # needs sage.modules
>>> Q = QuadraticForm(QQ, Integer(2), [Integer(1),Integer(2),Integer(3)])
>>> C = CliffordAlgebra(Q, names=('x', 'y',)); (x, y,) = C._first_ngens(2)
>>> a = x*y + x - Integer(3)*y + Integer(4)
>>> a.even_component()
x*y + 4

is_even_odd()[source]#

Return 0 if self is an even element and 1 if self is an odd element.

EXAMPLES:

sage: # needs sage.modules
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)                                     # needs sage.modules
sage: (x*y).is_even_odd()                                               # needs sage.modules
0

>>> from sage.all import *
>>> # needs sage.modules
>>> Q = QuadraticForm(QQ, Integer(2), [Integer(1),Integer(2),Integer(3)])
>>> C = CliffordAlgebra(Q, names=('x', 'y',)); (x, y,) = C._first_ngens(2)
>>> a = x + y
>>> a.is_even_odd()
1
>>> a = x*y + Integer(4)
>>> a.is_even_odd()
0
>>> a = x + Integer(4)
>>> a.is_even_odd()
Traceback (most recent call last):
...
ValueError: element is not homogeneous

>>> E = ExteriorAlgebra(QQ, names=('x', 'y',)); (x, y,) = E._first_ngens(2)# needs sage.modules
>>> (x*y).is_even_odd()                                               # needs sage.modules
0

is_super_homogeneous()[source]#

Return whether this element is homogeneous, in the sense of a super module (i.e., is even or odd).

EXAMPLES:

sage: # needs sage.modules
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

>>> from sage.all import *
>>> # needs sage.modules
>>> Q = QuadraticForm(QQ, Integer(2), [Integer(1),Integer(2),Integer(3)])
>>> C = CliffordAlgebra(Q, names=('x', 'y',)); (x, y,) = C._first_ngens(2)
>>> a = x + y
>>> a.is_super_homogeneous()
True
>>> a = x*y + Integer(4)
>>> a.is_super_homogeneous()
True
>>> a = x*y + x - Integer(3)*y + Integer(4)
>>> 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: # needs sage.combinat sage.modules
sage: E.<x,y> = ExteriorAlgebra(QQ)
sage: a = x*y + 4
sage: a.is_super_homogeneous()
True
sage: a.is_homogeneous()
False

>>> from sage.all import *
>>> # needs sage.combinat sage.modules
>>> E = ExteriorAlgebra(QQ, names=('x', 'y',)); (x, y,) = E._first_ngens(2)
>>> a = x*y + Integer(4)
>>> a.is_super_homogeneous()
True
>>> a.is_homogeneous()
False

odd_component()[source]#

Return the odd component of self.

EXAMPLES:

sage: # needs sage.modules
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

>>> from sage.all import *
>>> # needs sage.modules
>>> Q = QuadraticForm(QQ, Integer(2), [Integer(1),Integer(2),Integer(3)])
>>> C = CliffordAlgebra(Q, names=('x', 'y',)); (x, y,) = C._first_ngens(2)
>>> a = x*y + x - Integer(3)*y + Integer(4)
>>> a.odd_component()
x - 3*y

class ParentMethods[source]#

Bases: object