Clifford algebra elements

AUTHORS:

  • Travis Scrimshaw (2013-09-06): Initial version

  • Trevor Karn (2022-07-10): Rewrite multiplication using bitsets

class sage.algebras.clifford_algebra_element.CliffordAlgebraElement[source]

Bases: IndexedFreeModuleElement

An element in a Clifford algebra.

clifford_conjugate()[source]

Return the Clifford conjugate of self.

The Clifford conjugate of an element x of a Clifford algebra is defined as

x¯:=α(xt)=α(x)t

where α denotes the reflection automorphism and t the transposition.

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y + x*z
sage: c = elt.conjugate(); c
-x*z - 5*x - y + 3
sage: c.conjugate() == elt
True
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> c = elt.conjugate(); c
-x*z - 5*x - y + 3
>>> c.conjugate() == elt
True
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y + x*z
c = elt.conjugate(); c
c.conjugate() == elt
conjugate()[source]

Return the Clifford conjugate of self.

The Clifford conjugate of an element x of a Clifford algebra is defined as

x¯:=α(xt)=α(x)t

where α denotes the reflection automorphism and t the transposition.

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y + x*z
sage: c = elt.conjugate(); c
-x*z - 5*x - y + 3
sage: c.conjugate() == elt
True
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> c = elt.conjugate(); c
-x*z - 5*x - y + 3
>>> c.conjugate() == elt
True
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y + x*z
c = elt.conjugate(); c
c.conjugate() == elt
degree_negation()[source]

Return the image of the reflection automorphism on self.

The reflection automorphism of a Clifford algebra is defined as the linear endomorphism of this algebra which maps

x1x2xm(1)mx1x2xm.

It is an algebra automorphism of the Clifford algebra.

degree_negation() is an alias for reflection().

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y + x*z
sage: r = elt.reflection(); r
x*z - 5*x - y
sage: r.reflection() == elt
True
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> r = elt.reflection(); r
x*z - 5*x - y
>>> r.reflection() == elt
True
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y + x*z
r = elt.reflection(); r
r.reflection() == elt
list()[source]

Return the list of monomials and their coefficients in self (as a list of 2-tuples, each of which has the form (monomial, coefficient)).

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y
sage: elt.list()
[(1, 5), (01, 1)]
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y
>>> elt.list()
[(1, 5), (01, 1)]
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y
elt.list()
reflection()[source]

Return the image of the reflection automorphism on self.

The reflection automorphism of a Clifford algebra is defined as the linear endomorphism of this algebra which maps

x1x2xm(1)mx1x2xm.

It is an algebra automorphism of the Clifford algebra.

degree_negation() is an alias for reflection().

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y + x*z
sage: r = elt.reflection(); r
x*z - 5*x - y
sage: r.reflection() == elt
True
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> r = elt.reflection(); r
x*z - 5*x - y
>>> r.reflection() == elt
True
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y + x*z
r = elt.reflection(); r
r.reflection() == elt
support()[source]

Return the support of self.

This is the list of all monomials which appear with nonzero coefficient in self.

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y
sage: elt.support()
[1, 01]
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y
>>> elt.support()
[1, 01]
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y
elt.support()
transpose()[source]

Return the transpose of self.

The transpose is an anti-algebra involution of a Clifford algebra and is defined (using linearity) by

x1x2xmxmx2x1.

EXAMPLES:

sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
sage: Cl.<x,y,z> = CliffordAlgebra(Q)
sage: elt = 5*x + y + x*z
sage: t = elt.transpose(); t
-x*z + 5*x + y + 3
sage: t.transpose() == elt
True
sage: Cl.one().transpose()
1
>>> from sage.all import *
>>> Q = QuadraticForm(ZZ, Integer(3), [Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6)])
>>> Cl = CliffordAlgebra(Q, names=('x', 'y', 'z',)); (x, y, z,) = Cl._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> t = elt.transpose(); t
-x*z + 5*x + y + 3
>>> t.transpose() == elt
True
>>> Cl.one().transpose()
1
Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
Cl.<x,y,z> = CliffordAlgebra(Q)
elt = 5*x + y + x*z
t = elt.transpose(); t
t.transpose() == elt
Cl.one().transpose()
class sage.algebras.clifford_algebra_element.CohomologyRAAGElement[source]

Bases: CliffordAlgebraElement

An element in the cohomology of a right-angled Artin group.

See also

CohomologyRAAG

class sage.algebras.clifford_algebra_element.ExteriorAlgebraElement[source]

Bases: CliffordAlgebraElement

An element of an exterior algebra.

antiderivation(x)[source]

Return the interior product (also known as antiderivation) of self with respect to x (that is, the element ιx(self) of the exterior algebra).

If V is an R-module, and if α is a fixed element of V, then the interior product with respect to α is an R-linear map iα:Λ(V)Λ(V), determined by the following requirements:

  • iα(v)=α(v) for all vV=Λ1(V),

  • it is a graded derivation of degree 1: all x and y in Λ(V) satisfy

iα(xy)=(iαx)y+(1)degxx(iαy).

It can be shown that this map iα is graded of degree 1 (that is, sends Λk(V) into Λk1(V) for every k).

When V is a finite free R-module, the interior product can also be defined by

(iαω)(u1,,uk)=ω(α,u1,,uk),

where ωΛk(V) is thought of as an alternating multilinear mapping from V××V to R.

Since Sage is only dealing with exterior powers of modules of the form Rd for some nonnegative integer d, the element αV can be thought of as an element of V (by identifying the standard basis of V=Rd with its dual basis). This is how α should be passed to this method.

We then extend the interior product to all αΛ(V) by

iβγ=iγiβ.

INPUT:

  • x – element of (or coercing into) Λ1(V) (for example, an element of V); this plays the role of α in the above definition

EXAMPLES:

sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: x.interior_product(x)
1
sage: (x + x*y).interior_product(2*y)
-2*x
sage: (x*z + x*y*z).interior_product(2*y - x)
-2*x*z - y*z - z
sage: x.interior_product(E.one())
x
sage: E.one().interior_product(x)
0
sage: x.interior_product(E.zero())
0
sage: E.zero().interior_product(x)
0
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
>>> x.interior_product(x)
1
>>> (x + x*y).interior_product(Integer(2)*y)
-2*x
>>> (x*z + x*y*z).interior_product(Integer(2)*y - x)
-2*x*z - y*z - z
>>> x.interior_product(E.one())
x
>>> E.one().interior_product(x)
0
>>> x.interior_product(E.zero())
0
>>> E.zero().interior_product(x)
0
E.<x,y,z> = ExteriorAlgebra(QQ)
x.interior_product(x)
(x + x*y).interior_product(2*y)
(x*z + x*y*z).interior_product(2*y - x)
x.interior_product(E.one())
E.one().interior_product(x)
x.interior_product(E.zero())
E.zero().interior_product(x)

REFERENCES:

constant_coefficient()[source]

Return the constant coefficient of self.

Todo

Define a similar method for general Clifford algebras once the morphism to exterior algebras is implemented.

EXAMPLES:

sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: elt = 5*x + y + x*z + 10
sage: elt.constant_coefficient()
10
sage: x.constant_coefficient()
0
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z + Integer(10)
>>> elt.constant_coefficient()
10
>>> x.constant_coefficient()
0
E.<x,y,z> = ExteriorAlgebra(QQ)
elt = 5*x + y + x*z + 10
elt.constant_coefficient()
x.constant_coefficient()
hodge_dual()[source]

Return the Hodge dual of self.

The Hodge dual of an element α of the exterior algebra is defined as iασ, where σ is the volume form (volume_form()) and iα denotes the antiderivation function with respect to α (see interior_product() for the definition of this).

Note

The Hodge dual of the Hodge dual of a homogeneous element p of Λ(V) equals (1)k(nk)p, where n=dimV and k=deg(p)=|p|.

EXAMPLES:

sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: x.hodge_dual()
y*z
sage: (x*z).hodge_dual()
-y
sage: (x*y*z).hodge_dual()
1
sage: [a.hodge_dual().hodge_dual() for a in E.basis()]
[1, x, y, z, x*y, x*z, y*z, x*y*z]
sage: (x + x*y).hodge_dual()
y*z + z
sage: (x*z + x*y*z).hodge_dual()
-y + 1
sage: E = ExteriorAlgebra(QQ, 'wxyz')
sage: [a.hodge_dual().hodge_dual() for a in E.basis()]
[1, -w, -x, -y, -z, w*x, w*y, w*z, x*y, x*z, y*z,
 -w*x*y, -w*x*z, -w*y*z, -x*y*z, w*x*y*z]
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
>>> x.hodge_dual()
y*z
>>> (x*z).hodge_dual()
-y
>>> (x*y*z).hodge_dual()
1
>>> [a.hodge_dual().hodge_dual() for a in E.basis()]
[1, x, y, z, x*y, x*z, y*z, x*y*z]
>>> (x + x*y).hodge_dual()
y*z + z
>>> (x*z + x*y*z).hodge_dual()
-y + 1
>>> E = ExteriorAlgebra(QQ, 'wxyz')
>>> [a.hodge_dual().hodge_dual() for a in E.basis()]
[1, -w, -x, -y, -z, w*x, w*y, w*z, x*y, x*z, y*z,
 -w*x*y, -w*x*z, -w*y*z, -x*y*z, w*x*y*z]
E.<x,y,z> = ExteriorAlgebra(QQ)
x.hodge_dual()
(x*z).hodge_dual()
(x*y*z).hodge_dual()
[a.hodge_dual().hodge_dual() for a in E.basis()]
(x + x*y).hodge_dual()
(x*z + x*y*z).hodge_dual()
E = ExteriorAlgebra(QQ, 'wxyz')
[a.hodge_dual().hodge_dual() for a in E.basis()]
interior_product(x)[source]

Return the interior product (also known as antiderivation) of self with respect to x (that is, the element ιx(self) of the exterior algebra).

If V is an R-module, and if α is a fixed element of V, then the interior product with respect to α is an R-linear map iα:Λ(V)Λ(V), determined by the following requirements:

  • iα(v)=α(v) for all vV=Λ1(V),

  • it is a graded derivation of degree 1: all x and y in Λ(V) satisfy

iα(xy)=(iαx)y+(1)degxx(iαy).

It can be shown that this map iα is graded of degree 1 (that is, sends Λk(V) into Λk1(V) for every k).

When V is a finite free R-module, the interior product can also be defined by

(iαω)(u1,,uk)=ω(α,u1,,uk),

where ωΛk(V) is thought of as an alternating multilinear mapping from V××V to R.

Since Sage is only dealing with exterior powers of modules of the form Rd for some nonnegative integer d, the element αV can be thought of as an element of V (by identifying the standard basis of V=Rd with its dual basis). This is how α should be passed to this method.

We then extend the interior product to all αΛ(V) by

iβγ=iγiβ.

INPUT:

  • x – element of (or coercing into) Λ1(V) (for example, an element of V); this plays the role of α in the above definition

EXAMPLES:

sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: x.interior_product(x)
1
sage: (x + x*y).interior_product(2*y)
-2*x
sage: (x*z + x*y*z).interior_product(2*y - x)
-2*x*z - y*z - z
sage: x.interior_product(E.one())
x
sage: E.one().interior_product(x)
0
sage: x.interior_product(E.zero())
0
sage: E.zero().interior_product(x)
0
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
>>> x.interior_product(x)
1
>>> (x + x*y).interior_product(Integer(2)*y)
-2*x
>>> (x*z + x*y*z).interior_product(Integer(2)*y - x)
-2*x*z - y*z - z
>>> x.interior_product(E.one())
x
>>> E.one().interior_product(x)
0
>>> x.interior_product(E.zero())
0
>>> E.zero().interior_product(x)
0
E.<x,y,z> = ExteriorAlgebra(QQ)
x.interior_product(x)
(x + x*y).interior_product(2*y)
(x*z + x*y*z).interior_product(2*y - x)
x.interior_product(E.one())
E.one().interior_product(x)
x.interior_product(E.zero())
E.zero().interior_product(x)

REFERENCES:

reduce(I, left=True)[source]

Reduce self with respect to the elements in I.

INPUT:

  • I – list of exterior algebra elements or an ideal

  • left – boolean; if reduce as a left ideal (True) or right ideal (False), ignored if I is an ideal

EXAMPLES:

sage: E.<a,b,c,d> = ExteriorAlgebra(QQ)
sage: f = (a + b*c) * d
sage: f.reduce([a + b*c], True)
2*a*d
sage: f.reduce([a + b*c], False)
0

sage: I = E.ideal([a + b*c])
sage: f.reduce(I)
0
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('a', 'b', 'c', 'd',)); (a, b, c, d,) = E._first_ngens(4)
>>> f = (a + b*c) * d
>>> f.reduce([a + b*c], True)
2*a*d
>>> f.reduce([a + b*c], False)
0

>>> I = E.ideal([a + b*c])
>>> f.reduce(I)
0
E.<a,b,c,d> = ExteriorAlgebra(QQ)
f = (a + b*c) * d
f.reduce([a + b*c], True)
f.reduce([a + b*c], False)
I = E.ideal([a + b*c])
f.reduce(I)
scalar(other)[source]

Return the standard scalar product of self with other.

The standard scalar product of x,yΛ(V) is defined by x,y=xty, where a denotes the degree-0 term of a, and where xt denotes the transpose (transpose()) of x.

Todo

Define a similar method for general Clifford algebras once the morphism to exterior algebras is implemented.

EXAMPLES:

sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: elt = 5*x + y + x*z
sage: elt.scalar(z + 2*x)
0
sage: elt.transpose() * (z + 2*x)
-2*x*y + 5*x*z + y*z
>>> from sage.all import *
>>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
>>> elt = Integer(5)*x + y + x*z
>>> elt.scalar(z + Integer(2)*x)
0
>>> elt.transpose() * (z + Integer(2)*x)
-2*x*y + 5*x*z + y*z
E.<x,y,z> = ExteriorAlgebra(QQ)
elt = 5*x + y + x*z
elt.scalar(z + 2*x)
elt.transpose() * (z + 2*x)