SymmetrizedArray[{pos1val1,pos2val2,…},dims,sym]
yields an array of dimensions dims whose entries are given by those in the rules posivali or through the symmetry sym.
SymmetrizedArray[list]
yields a symmetrized array version of list.
SymmetrizedArray
SymmetrizedArray[{pos1val1,pos2val2,…},dims,sym]
yields an array of dimensions dims whose entries are given by those in the rules posivali or through the symmetry sym.
SymmetrizedArray[list]
yields a symmetrized array version of list.
Details
- SymmetrizedArray[…] is converted to a structured array expression of the form SymmetrizedArray[StructuredData[dims,{comps,sym}]] that contains the independent components comps and the symmetry sym of the input.
- SymmetrizedArray takes unspecified elements to be 0.
- Normal[SymmetrizedArray[…]] gives the ordinary array corresponding to a symmetrized array object.
- SymmetrizedArrayRules[SymmetrizedArray[…]] gives the list of independent rules {pos1val1,pos2val2,…}.
- ArrayRules[SymmetrizedArray[…]] gives the list of both dependent and independent rules {pos1val1,pos2val2,…}.
- The elements in a SymmetrizedArray object need not be numeric.
- The position specifications posi can contain patterns.
- With rules posivali, the vali are evaluated separately for each independent component that matches posi.
- SymmetrizedArray[list] requires that list be a full array, with all parts at a particular level being lists of the same length.
- The individual elements of a symmetrized array cannot themselves be lists.
- SymmetrizedArray[rules] yields a symmetrized array, with dimensions exactly large enough to include elements whose positions have been explicitly specified.
- SymmetrizedArray[structureddata] is treated as a raw object by functions like AtomQ and for purposes of pattern matching.
Examples
open all close allBasic Examples (2)
Construct an antisymmetric array:
SymmetrizedArray[{{1, 2} -> a, {2, 3} -> b}, {3, 3}, Antisymmetric[{1, 2}]]Convert it to an ordinary matrix:
Normal[%]Convert an array with symmetry into its symmetrized form:
SymmetrizedArray[{{1, 4}, {4, 9}}]These are its independent components:
SymmetrizedArrayRules[%]Scope (8)
Construct a symmetrized array from rules:
SymmetrizedArray[{{1, 2} -> a, {2, 3} -> b}, {3, 3}, Antisymmetric[{1, 2}]]Normal[%]SymmetrizedArray form of an array with symmetry:
SymmetrizedArray[{{{a, b}, {b, c}}, {{b, c}, {c, d}}}]SymmetrizedArray form of an array with antisymmetry:
SymmetrizedArray[{{{0, 0, 0}, {0, 0, a}, {0, -a, 0}}, {{0, 0, -a}, {0, 0, 0}, {a, 0, 0}}, {{0, a, 0}, {-a, 0, 0}, {0, 0, 0}}}]Construct a symmetrized array of larger dimensions:
SymmetrizedArray[{{{a, b}, {b, c}}, {{b, c}, {c, d}}}, {10, 10, 10}]Let the Wolfram Language choose the minimal dimensions:
SymmetrizedArray[{{{a, b}, {b, c}}, {{b, c}, {c, d}}}, Automatic]Construct a random skew-symmetric array:
SymmetrizedArray[pos_ :> RandomInteger[10], {4, 4, 4}, Antisymmetric[{1, 2, 3}]]SymmetrizedArrayRules[%]Specify an arbitrary symmetry using generators:
SymmetrizedArray[pos_ :> a@@pos, {2, 2, 2, 2}, {{Cycles[{{1, 2}}], -1}, {Cycles[{{3, 4}}], 1}}]Normal[%]An empty list of generators represents no symmetry:
SymmetrizedArray[{{1, 2} -> a}, {3, 2}, {}]Normal[%]Use generators with any root of unity:
sym = {{{2, 1, 4, 3}, 1}, {{1, 3, 4, 2}, Exp[2 I Pi / 3]}}SymmetrizedArray[{{1, 1, 2, 2} -> a}, {2, 2, 2, 2}, sym]Normal[%]Symmetrized arrays include properties that give information about the array:
sa = SymmetrizedArray[{{1, 2} -> a, {2, 3} -> b}, {3, 3}, Antisymmetric[{1, 2}]]sa["Properties"]The "Summary" property gives a brief summary of information about the array:
sa["Summary"]The "StructuredAlgorithms" property gives a list of functions that have algorithms that use the structure of the representation:
sa["StructuredAlgorithms"]Applications (5)
Construct an antisymmetric array:
sa = SymmetrizedArray[{{1, 2, 3, 4} -> x, {1, 2, 4, 5} -> y}, {5, 5, 5, 5}, Antisymmetric[All]]Only the independent components are stored:
sa//InputFormExtract any component of the array:
sa[[2, 3, 4, 1]]sa[[2, 1]]Normal[%]Construct an antisymmetric matrix:
am = SymmetrizedArray[{{1, 2} -> a, {1, 3} -> b, {2, 3} -> c}, {3, 3}, Antisymmetric[All]]Multiple tensor product of the matrix with itself:
am4 = amamamamThe result contains only 15 independent components, all with different values:
SymmetrizedArrayRules[am4]The sparse and normal representations are larger:
SparseArray[am4]Normal[am4]//Flatten//LengthAntisymmetric arrays of ranks 4 and 10 in dimension 15:
SeedRandom[0];
sa4 = SymmetrizedArray[pos_ :> RandomInteger[10], ConstantArray[15, 4], Antisymmetric[All]];
sa10 = SymmetrizedArray[pos_ :> RandomInteger[10], ConstantArray[15, 10], Antisymmetric[All]];The wedge product of those antisymmetric arrays can be computed efficiently:
sa14 = sa4sa10The result can be presented in a shorter form through its Hodge dual:
HodgeDual[sa14]Normal[%]Construct the array of all sixth-order partial derivatives of a function of four variables:
vars = {x, y, z, t};d6 = D[f[x, y, z, t], {vars, 6}];It is a depth-6 array in dimension 4, and therefore it has 4096 entries:
Dimensions[d6]Apply[Times, %]It is also a fully symmetric array, due to commutation of the partial derivatives:
TensorSymmetry[d6]Most entries are repeated multiple times and therefore the array is large:
ByteCount[d6]The SymmetrizedArray representation stores each of the independent entries only once:
sd6 = Symmetrize[d6]ByteCount[sd6]The normal form of the array can be recovered using Normal:
Normal[sd6] === d6Construct a 4-variate distribution, using a symmetric matrix Σ:
dim = 4;
Σ = Normal@SymmetrizedArray[{i_, j_} :> Subscript[σ, i, j], {dim, dim}, Symmetric[{1, 2}]]dist = MultivariateTDistribution[Σ, 10];Define a function that computes a moment of that distribution for given variable indices:
vars = Array[x, dim];
moment[inds__] := Expectation[Times@@Part[vars, {inds}], varsdist]moment[1, 2, 1, 2, 1, 4]% == Moment[dist, {3, 2, 0, 1}]//SimplifyConstruct the array of moments of order 6:
order = 6;AbsoluteTiming[marray = Array[moment, Table[dim, order]];]Moment and cumulant arrays for a multivariate distribution are fully symmetric:
TensorSymmetry[marray]Use SymmetrizedArray to compute each independent moment only once:
AbsoluteTiming[smarray = SymmetrizedArray[{inds__} :> moment[inds], Table[dim, order], Symmetric[All]]]Both representations are equivalent:
smarray == marray{ByteCount[marray], ByteCount[smarray]}Properties & Relations (5)
If the same entry is specified several times, the average of those values is used:
SymmetrizedArray[{{1, 2} -> a, {1, 2} -> b, {2, 1} -> c}, {2, 2}, Symmetric[{1, 2}]]SymmetrizedArrayRules[%]For a nonsymmetric array, the result is a projected symmetrized part:
SymmetrizedArray[{{a, b}, {c, d}}, {2, 2}, Antisymmetric[{1, 2}]]Normal[%]//MatrixFormSymmetrizedArray offers a very compact representation of antisymmetric arrays:
d = 7;a = SymmetrizedArray[Range[d] -> 1, ConstantArray[d, d], Antisymmetric[Range[d]]]spa = SparseArray[a]ByteCount /@ {a, spa, Normal[a]}SymmetrizedArray allows a compact representation of symmetric arrays:
CrossMatrix[{2, 2, 2}]SymmetrizedArray[%]ByteCount[cross = CrossMatrix[{10, 10, 10, 10}]]ByteCount[SymmetrizedArray[cross]]A symmetric matrix can be represented using SymmetrizedArray or SymmetricMatrix:
array = SymmetrizedArray[{{1, 3} -> a, {2, 2} -> b}, {3, 3}, Symmetric[All]]matrix = SymmetricMatrix[{{0, 0, a}, {0, b, 0}, {a, 0, 0}}]The two representations are equal, but support different algorithms:
array == matrixSymmetrizedArray supports tensorial operations such as D, Flatten, Inner and Outer:
array["StructuredAlgorithms"]SymmetricMatrix supports matrix-specific operations such as KroneckerProduct:
matrix["StructuredAlgorithms"]HermitianMatrix bears an analogous relationship to SymmetrizedArray for Hermitian matrices:
With[{hm = HermitianMatrix[(| | | |
| -- | - | - |
| 0 | 0 | I |
| 0 | 2 | 0 |
| -I | 0 | 0 |)], sa = SymmetrizedArray[(| | | |
| -- | - | - |
| 0 | 0 | I |
| 0 | 2 | 0 |
| -I | 0 | 0 |)]},
{hm == sa, hm["StructuredAlgorithms"] == sa["StructuredAlgorithms"]}]Possible Issues (1)
Neat Examples (1)
Antisymmetric rank-4 array projected down to a symmetric matrix in different dimensions:
matrix[d_] := ArrayFlatten@
Normal@
Block[{c = 1},
SymmetrizedArray[_ :> c++, {d, d, d, d}, Antisymmetric[All]]
];
TensorSymmetry[matrix[12]]Equal elements correspond to the same color. White elements are zeros:
MatrixPlot[matrix[6]]MatrixPlot[matrix[12]]Tech Notes
Related Guides
Text
Wolfram Research (2012), SymmetrizedArray, Wolfram Language function, https://reference.wolfram.com/language/ref/SymmetrizedArray.html (updated 2020).
CMS
Wolfram Language. 2012. "SymmetrizedArray." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/SymmetrizedArray.html.
APA
Wolfram Language. (2012). SymmetrizedArray. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SymmetrizedArray.html
BibTeX
@misc{reference.wolfram_2026_symmetrizedarray, author="Wolfram Research", title="{SymmetrizedArray}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SymmetrizedArray.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_symmetrizedarray, organization={Wolfram Research}, title={SymmetrizedArray}, year={2020}, url={https://reference.wolfram.com/language/ref/SymmetrizedArray.html}, note=[Accessed: 13-June-2026]}