CliffordAlgebra[{pvars,nvars,zvars}]
gives the Clifford algebra with generators pvars that square to
, nvars that square to
and zvars that square to
.
CliffordAlgebra[{pvars,nvars,zvars},alg]
takes the operation names and monomial order settings from the non-commutative algebra alg.
CliffordAlgebra
CliffordAlgebra[{pvars,nvars,zvars}]
gives the Clifford algebra with generators pvars that square to
, nvars that square to
and zvars that square to
.
CliffordAlgebra[{pvars,nvars,zvars},alg]
takes the operation names and monomial order settings from the non-commutative algebra alg.
Details
- CliffordAlgebra gives a NonCommutativeAlgebra object representing a Clifford algebra.
- CliffordAlgebra[{{x1,…,xp},{xp+1,…,xp+q},{xp+q+1,…,xp+q+r}}] returns a NonCommutativeAlgebra object representing the generalized Clifford algebra
, which is the unitary algebra given by generators {x1,…,xp+q+r} and relations
for
,
for
,
for
and
for
. - When there are no zero divisors, meaning zvars is empty, the notations
and
are commonly used to denote the Clifford algebra. - CliffordAlgebra[{pvars,nvars}] is equivalent to CliffordAlgebra[{pvars,nvars,{}}].
- CliffordAlgebra[{pvars}] is equivalent to CliffordAlgebra[{pvars,{},{}}].
- All elements of the Clifford algebra can be canonically represented as linear combinations of
, with
. NonCommutativeExpand computes the canonical representation of Clifford algebra elements.
Examples
open all close allBasic Examples (2)
Create a generalized Clifford algebra
:
alg = CliffordAlgebra[{{x}, {y}, {z}}]Compute the canonical form of an element of the algebra:
NonCommutativeExpand[(x + 2y + 3z)**(4x + 5y + 6z), alg]alg = CliffordAlgebra[{{e1, e2}, {e3, e4}}]Compute the Gröbner basis of a left ideal in the algebra:
NonCommutativeGroebnerBasis[{e1**e2 - e3**e4}, alg, Left]Scope (1)
Applications (3)
The Clifford algebra
is isomorphic to the quaternions:
alg = CliffordAlgebra[{{}, {e1, e2}}]NonCommutativeExpand[GeneralizedPower[NonCommutativeMultiply, (1 + 2 e1 + 3 e2 + 4 e1**e2), 5], alg]Do the same computation using the Quaternions package:
<<Quaternions`Quaternion[1, 2, 3, 4] ^ 5The Clifford algebra
is often called the Dirac algebra and has important applications in physics and mathematics, especially in relativistic field theory. This algebra has many representations as a matrix algebra, of which the best known involves the gamma or Dirac matrices. First, define the abstract algebra:
dirac = CliffordAlgebra[{{Γ^0}, {Γ^1, Γ^2, Γ^3}}]Define the matrix
as one-half the anticommutator of the generators; notice it is the timelike–positive Minkowski metric:
Table[Subscript[η, μν] = (1/2)NonCommutativeExpand[Anticommutator[Γ^μ, Γ^ν, dirac], dirac], {μ, 0, 3}, {ν, 0, 3}]A simple but important identity gives
:
NonCommutativeExpand[Underoverscript[∑, μ = 0, 3]Subscript[η, μμ]Γ^μ**Γ^μ, dirac]Table[NonCommutativeExpand[Underoverscript[∑, μ = 0, 3]Subscript[η, μμ]Γ^μ**Γ^ν**Γ^μ, dirac], {ν, 0, 3}]Define the contravariant gamma matrices in terms of the identity matrix
and Pauli matrices
as
:
γ^0 = BlockDiagonalMatrix[{IdentityMatrix[2], -IdentityMatrix[2]}];And
, where
denotes KroneckerProduct:
Table[γ^i = I KroneckerProduct[PauliMatrix[2], PauliMatrix[i]], {i, 3}];Table[MatrixForm[γ^μ], {μ, 0, 3}]Confirm the defining relations
; as this is a concrete matrix algebra, multiplication is now Dot (not NonCommutativeMultiply), and the unity is the identity matrix
(not
):
Table[Anticommutator[γ^μ, γ^ν, Dot] == 2Subscript[η, μν] IdentityMatrix[4], {μ, 0, 3}, {ν, 0, 3}]Underoverscript[∑, μ = 0, 3]Subscript[η, μμ]γ^μ.γ^μTable[Underoverscript[∑, μ = 0, 3]Subscript[η, μμ]γ^μ.γ^ν.γ^μ == -2γ^ν, {ν, 0, 3}]This example establishes the dimensionality of the Dirac algebra introduced in the previous example and shows what makes the representation in terms of the Dirac matrices special. First, define the Dirac algebra as before, but use a nicer-looking operator:
dirac = CliffordAlgebra[{{Γ^0}, {Γ^1, Γ^2, Γ^3}}, <|"Multiplication" -> CenterDot|>]By default, Sort places a single Dirac term after products of such terms:
Sort[{Γ^0, Γ^1·Γ^2}]This is because CenterDot comes alphabetically before Superscript (and, for that matter,
):
FullForm[Γ^0]Define an ordering function that sorts products after single terms:
order = Which[Head[#1] === CenterDot && Head[#2] === Superscript, -1, Head[#1] === Superscript && Head[#2] === CenterDot, 1, True, Order[#1, #2]]&;
Sort[{Γ^0, Γ^1·Γ^2}, order]Construct a general linear combination of products of the generators up to degree 4; any product with more terms will contain squares of generators that equal
:
lincomb = Table[Subscript[c, i], {i, 341}].Join[{1}, Table[Γ^μ, {μ, 0, 3}], Flatten@Table[Γ^μ·Γ^ν, {μ, 0, 3}, {ν, 0, 3}], Flatten@Table[Γ^μ·Γ^ν·Γ^ρ, {μ, 0, 3}, {ν, 0, 3}, {ρ, 0, 3}], Flatten@Table[Γ^μ·Γ^ν·Γ^ρ·Γ^σ, {μ, 0, 3}, {ν, 0, 3}, {ρ, 0, 3}, {σ, 0, 3}]];Simplify the expressions in the algebra using NonCommutativeExpand:
Short[lincomb = NonCommutativeExpand[lincomb, dirac], 5]This linear combination has 60 terms in it:
Length[lincomb]However, appearances can be deceiving. Many of the terms are just multiples of the unity vector
due to squaring of generators; delete all terms with no
in them and replace them with the unity:
Short[unitized = DeleteCases[lincomb, _ ? (FreeQ[Γ])] + 1]This vector has 16 basis vectors in it, so the algebra is 16 dimensional:
Length[unitized]Separate vectors from coefficients and sort them; the basis consists of all products of generators with increasing indices:
Sort[List@@Replace[unitized, v_ ? (FreeQ[c]) _ :> v, {1}], order]Define the four gamma matrices
; as
matrices, they are in a 16-dimensional vector space and thus have the lowest dimensionality of any matrix algebra that contains the Dirac algebra:
γ^0 = BlockDiagonalMatrix[{IdentityMatrix[2], -IdentityMatrix[2]}];
Table[γ^i = I KroneckerProduct[PauliMatrix[2], PauliMatrix[i]], {i, 3}];
Table[γ^μ//MatrixForm, {μ, 0, 3}]Form a general linear combination of the corresponding basis elements:
Table[Subscript[a, i], {i, 16}].Join[{IdentityMatrix[4]}, Table[γ^μ, {μ, 0, 3}], Flatten[Table[If[μ < ν, γ^μ.γ^ν, Nothing], {μ, 0, 3}, {ν, 0, 3}], 1], Flatten[Table[If[μ < ν < ρ, γ^μ.γ^ν.γ^ρ, Nothing], {μ, 0, 3}, {ν, 0, 3}, {ρ, 0, 3}], 2], { Dot@@Table[γ^μ, {μ, 0, 3}]}]//MatrixFormThe only solution to
is
, showing that the 16 matrices are linearly independent in the concrete matrix algebra, as expected:
Solve[% == ConstantArray[0, {4, 4}]]Properties & Relations (1)
CliffordAlgebra gives a NonCommutativeAlgebra with Clifford algebra structure:
CliffordAlgebra[{{x, y}, {z, t}, {}}]% === NonCommutativeAlgebra["Structure" -> {"Clifford", {{x, y}, {z, t}, {}}}]Related Guides
History
Text
Wolfram Research (2026), CliffordAlgebra, Wolfram Language function, https://reference.wolfram.com/language/ref/CliffordAlgebra.html.
CMS
Wolfram Language. 2026. "CliffordAlgebra." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CliffordAlgebra.html.
APA
Wolfram Language. (2026). CliffordAlgebra. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CliffordAlgebra.html
BibTeX
@misc{reference.wolfram_2026_cliffordalgebra, author="Wolfram Research", title="{CliffordAlgebra}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/CliffordAlgebra.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cliffordalgebra, organization={Wolfram Research}, title={CliffordAlgebra}, year={2026}, url={https://reference.wolfram.com/language/ref/CliffordAlgebra.html}, note=[Accessed: 12-June-2026]}