TensorSymmetry[tensor]
gives the symmetry of tensor under permutations of its slots.
TensorSymmetry[tensor,slots]
gives the symmetry under permutation of the specified list of slots.
TensorSymmetry
TensorSymmetry[tensor]
gives the symmetry of tensor under permutations of its slots.
TensorSymmetry[tensor,slots]
gives the symmetry under permutation of the specified list of slots.
Details and Options
- TensorSymmetry accepts any type of tensor, either symbolic or explicit, including any type of array.
- A general symmetry is specified by a generating set of pairs {perm,ϕ}, where perm is a permutation of the slots of the tensor, and ϕ is a root of unity. Each pair represents a symmetry of the tensor of the form ϕ TensorTranspose[tensor,perm]==tensor.
- Some symmetry specifications have names:
-
Symmetric[{s1,…,sn}] full symmetry in the slots si Antisymmetric[{s1,…,sn}] antisymmetry in the slots si ZeroSymmetric[{s1,…,sn}] symmetry of a zero tensor - The following options can be given:
-
Assumptions $Assumptions assumptions to make about tensors SameTest Automatic function to test equality of expressions Tolerance Automatic tolerance for approximate numbers - For exact and symbolic arrays, the option SameTest->f indicates that two entries aij… and akl… are taken to be equal if f[aij…,akl…] gives True.
- For approximate arrays, the option Tolerance->t can be used to indicate that all entries Abs[aij…]≤t are taken to be zero.
- For array entries Abs[aij…]>t, equality comparison is done except for the last
bits, where
is $MachineEpsilon for MachinePrecision arrays and
for arrays of Precision
.
Examples
open all close allBasic Examples (2)
TensorSymmetry[{{a, b}, {b, c}}]TensorSymmetry[{{0, a, b}, {-a, 0, c}, {-b, -c, 0}}]$Assumptions = A∈Arrays[{5, 5, 5}, Reals, Antisymmetric[{1, 2, 3}]];TensorSymmetry[A]Scope (7)
TensorSymmetry[{{{{-6, 4, -9}, {4, 5, 5}, {-9, 5, 10}}, {{4, -9, 1}, {-9, 2, 8}, {1, 8, -2}}, {{-9, 1, 0}, {1, -5, 6}, {0, 6, 6}}}, {{{4, -9, 1}, {-9, 2, 8}, {1, 8, -2}}, {{5, 2, -5}, {2, -5, 7}, {-5, 7, -3}}, {{5, 8, 6}, {8, 7, 2}, {6, 2, 10}}}, {{{-9, 1, 0}, {1, -5, 6}, {0, 6, 6}}, {{5, 8, 6}, {8, 7, 2}, {6, 2, 10}}, {{10, -2, 6}, {-2, -3, 10}, {6, 10, -1}}}}]Find symmetries in complex arrays:
TensorSymmetry[{{{0, -3}, {-3 E^-(2 I π/3), -4}}, {{-3 E^(2 I π/3), -4 E^(2 I π/3)}, {-4 E^-(2 I π/3), 0}}}]Symmetry of a SymmetrizedArray object:
a = SymmetrizedArray[{{1, 2, 3} -> 7}, {4, 4, 4}, Antisymmetric[{1, 2, 3}]]TensorSymmetry[a]Symmetry of a SparseArray object:
a = SparseArray[{{0, 7}, {-7, 0}}]TensorSymmetry[a]Specify the symmetry of a symbolic array:
$Assumptions = T∈Arrays[{B, B, B}, Reals, Antisymmetric[{1, 2, 3}]];TensorSymmetry[T]Symmetry of its tensor product with itself. Note the exchange symmetry:
TensorSymmetry[TT]A fully symmetric rank 3 array:
a = Normal@SymmetrizedArray[_ :> RandomInteger[10], {2, 2, 2}, Symmetric[All]]TensorSymmetry[a]Symmetry in a subset of slots:
TensorSymmetry[a, {2, 3}]Symmetry of an array of zeros:
TensorSymmetry[{{0, 0}, {0, 0}}]Options (3)
Assumptions (1)
SameTest (1)
This matrix is symmetric for a positive real
, but TensorSymmetry gives no symmetry:
m = {{1, Log[x ^ 2]}, {2 Log[x], 2}};TensorSymmetry[m]Use the option SameTest to get the correct answer:
TensorSymmetry[m, SameTest -> (Simplify[#1 - #2, x > 0] == 0&)]Tolerance (1)
Generate a fully symmetric random array of depth 4:
SeedRandom[123];a = Normal@Symmetrize[RandomReal[1, {5, 5, 5, 5}]];TensorSymmetry[a]The addition of a small perturbation breaks the symmetry:
a = a + RandomReal[10 ^ -11, {5, 5, 5, 5}];TensorSymmetry[a]The symmetry can be recovered by allowing some tolerance:
TensorSymmetry[a, Tolerance -> 10 ^ -10]Properties & Relations (5)
Test whether a matrix is symmetric:
m = {{a, 5}, {5, b}};SymmetricMatrixQ[m]Find the symmetry of the matrix:
TensorSymmetry[m]Test whether a matrix is antisymmetric:
m = {{0, I}, {-I, 0}};AntisymmetricMatrixQ[m]Find the symmetry of the matrix:
TensorSymmetry[m]Only a matrix of zeros can be simultaneously symmetric and antisymmetric:
m = {{0, 0}, {0, 0}}SymmetricMatrixQ[m]AntisymmetricMatrixQ[m]TensorSymmetry[m]Generation of special multidimensional symmetric arrays:
CrossMatrix[{5, 5, 5}]//TensorSymmetryDiamondMatrix[{5, 5, 5, 5}]//TensorSymmetryDiskMatrix[{6, 6}]//TensorSymmetryWith a different radius, there are other symmetries:
DiskMatrix[{5, 4, 5}]//TensorSymmetryDiskMatrix[{4, 5, 4, 5}]//TensorSymmetryThe symmetry of Symmetrize[tensor,sym] is at least sym:
m = RandomInteger[10, {2, 2, 2, 2}];sm = Normal@Symmetrize[m, Symmetric[{1, 2, 4}]]%//TensorSymmetryIn some cases the result of Symmetrize[tensor,sym] may have more symmetry than sym:
Normal@Symmetrize[sm, Symmetric[{3, 4}]]%//TensorSymmetryTech Notes
Related Guides
Text
Wolfram Research (2012), TensorSymmetry, Wolfram Language function, https://reference.wolfram.com/language/ref/TensorSymmetry.html (updated 2017).
CMS
Wolfram Language. 2012. "TensorSymmetry." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/TensorSymmetry.html.
APA
Wolfram Language. (2012). TensorSymmetry. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TensorSymmetry.html
BibTeX
@misc{reference.wolfram_2026_tensorsymmetry, author="Wolfram Research", title="{TensorSymmetry}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/TensorSymmetry.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_tensorsymmetry, organization={Wolfram Research}, title={TensorSymmetry}, year={2017}, url={https://reference.wolfram.com/language/ref/TensorSymmetry.html}, note=[Accessed: 13-June-2026]}