gives the d-dimensional Levi-Civita totally antisymmetric tensor.
LeviCivitaTensor
gives the d-dimensional Levi-Civita totally antisymmetric tensor.
Details
- LeviCivitaTensor[d] gives a rank-d tensor with length d in each dimension.
- The elements of LeviCivitaTensor[d] are 0, -1, +1, and can be obtained by applying Signature to their indices.
- LeviCivitaTensor by default gives a SparseArray object. LeviCivitaTensor[d,List] returns a normal array, while LeviCivitaTensor[d,SymmetrizedArray] returns a symmetrized array.
Examples
open all close allBasic Examples (1)
LeviCivitaTensor[3]Normal[%]Scope (5)
LeviCivitaTensor returns a sparse array:
LeviCivitaTensor[4]Display the result as a normal array:
LeviCivitaTensor[2]//MatrixFormObtain the tensor as a normal array:
LeviCivitaTensor[3, List]LeviCivitaTensor[3].{x1, x2, x3}.{y1, y2, y3}Cross[{x1, x2, x3}, {y1, y2, y3}]Obtain a higher-dimensional result as a SymmetrizedArray object:
LeviCivitaTensor[15, SymmetrizedArray]Applications (2)
The infinitesimal rotation matrix
is the contraction of the angular velocity
with a Levi-Civita tensor:
ω = {ω1, ω2, ω3};
dR = TensorContract[LeviCivitaTensor[3, List]ω, {2, 4}]Many operations in rotational mechanics are contractions of vectors with
. Torque
:
dR.{Fx, Fy, Fz} == ω⨯{Fx, Fy, Fz}m dR.{x, y, z} == m ω⨯{x, y, z}The finite rotation matrix at time
is the matrix exponential of
:
Simplify[MatrixExp[t dR] == RotationMatrix[t Sqrt[ω.ω], ω], ω∈Reals && ω1^2 + ω2^2 + ω3^2 > 0]Hodge duality can be computed by contraction with the Levi-Civita tensor:
A = SymmetrizedArray[pos_ :> a@@pos, {5, 5, 5}, Antisymmetric[{1, 2, 3}]]HodgeDual[A]% === 1 / 3!TensorContract[ALeviCivitaTensor[5], {{1, 4}, {2, 5}, {3, 6}}]The contraction of a TensorProduct with the Levi-Civita tensor combines Symmetrize and HodgeDual:
B = SymmetrizedArray[pos_ :> a@@pos, {5, 5}, Antisymmetric[{1, 2}]]HodgeDual[Symmetrize[AB, Antisymmetric[Range[5]]]] == (1/5!)TensorContract[ABLeviCivitaTensor[5, SymmetrizedArray], {{1, 6}, {2, 7}, {3, 8}, {4, 9}, {5, 10}}]//SimplifyIn dimension three, Hodge duality is often used to identify the cross product and TensorWedge of vectors:
v = {vx, vy, vz};
w = {wx, wy, wz};
v⨯w == HodgeDual[vw] == TensorContract[(1/2!)TensorWedge[v, w]LeviCivitaTensor[3], {{1, 3}, {2, 4}}]Properties & Relations (8)
Components of the Levi-Civita tensor coincide with the value of Signature:
Array[Signature[{##}]&, {3, 3, 3}] == LeviCivitaTensor[3]LeviCivitaTensor[d,List] is equivalent to applying Normal to a Levi-Civita tensor:
LeviCivitaTensor[5, List] === Normal[LeviCivitaTensor[5]]A normal array contains
components:
ByteCount[LeviCivitaTensor[8, List]]The SparseArray representation of a Levi-Civita tensor contains
entries:
ByteCount[LeviCivitaTensor[8, SparseArray]]The SymmetrizedArray representation only stores a single component:
ByteCount[LeviCivitaTensor[8, SymmetrizedArray]]LeviCivitaTensor[d] has symmetry Antisymmetric[{1,…,d}]:
LeviCivitaTensor[4]TensorSymmetry[%]The LeviCivitaTensor in dimension
is the HodgeDual of 1 in that dimension:
LeviCivitaTensor[4, SymmetrizedArray] === HodgeDual[1, 4]The determinant Det[m] is the contraction of m's rows or columns into the Levi-Civita tensor:
m = Array[μ, {3, 3}];
Det[m] === TensorContract[m[[1]]m[[2]]m[[3]]LeviCivitaTensor[3, List], {{1, 4}, {2, 5}, {3, 6}}]Generalize to higher dimensions, using Inactive[TensorProduct] for efficiency:
det[m_] := With[{n = Length[m]},
Activate[TensorContract[Inactive[TensorProduct]@@Append[m, LeviCivitaTensor[n]], Table[{k, k + n}, {k, n}]]]];m = Array[μ, {6, 6}];
Det[m] == det[m]//SimplifyIf
is
, PfaffianDet[m] can be computed as
, where
is LeviCivitaTensor[2n], using TensorProduct and TensorContract:
m = Symmetrize[Table[a[i, j], {i, 4}, {j, 4}], Antisymmetric[{1, 2}]];
PfaffianDet[m] == (1/2^22!)TensorContract[mmLeviCivitaTensor[4], {{1, 5}, {2, 6}, {3, 7}, {4, 8}}]//SimplifyGeneralize to higher dimensions, using Inactive[TensorProduct] for efficiency:
pfaf[m_] := With[{n = Length[m] / 2},
(1/2^nn!)Activate[TensorContract[Inactive[TensorProduct]@@Append[ConstantArray[m, n], LeviCivitaTensor[2n]], Table[{k, k + 2n}, {k, 2n}]]]]m = Symmetrize[Table[a[i, j], {i, 6}, {j, 6}], Antisymmetric[{1, 2}]];
PfaffianDet[m] == pfaf[m]//SimplifyCross in dimension
is the contraction of
vectors into the Levi-Civita tensor:
α = Array[a, {4}];
β = Array[b, {4}];
γ = Array[c, {4}];
Cross[α, β, γ] === TensorContract[αβγLeviCivitaTensor[4, List], {{1, 4}, {2, 5}, {3, 6}}]Related Guides
-
▪
- Tensors
Text
Wolfram Research (2008), LeviCivitaTensor, Wolfram Language function, https://reference.wolfram.com/language/ref/LeviCivitaTensor.html (updated 2014).
CMS
Wolfram Language. 2008. "LeviCivitaTensor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/LeviCivitaTensor.html.
APA
Wolfram Language. (2008). LeviCivitaTensor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LeviCivitaTensor.html
BibTeX
@misc{reference.wolfram_2026_levicivitatensor, author="Wolfram Research", title="{LeviCivitaTensor}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LeviCivitaTensor.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_levicivitatensor, organization={Wolfram Research}, title={LeviCivitaTensor}, year={2014}, url={https://reference.wolfram.com/language/ref/LeviCivitaTensor.html}, note=[Accessed: 13-June-2026]}