ArraySymbol[a]
represents an array with name a.
ArraySymbol[a,{n1,n2,…}]
represents an n1×n2×… array.
ArraySymbol[a,{n1,n2,…},dom]
represents an array with elements in the domain dom.
ArraySymbol[a,{n1,n2,…},dom, sym]
represents an array with the symmetry sym.
ArraySymbol
ArraySymbol[a]
represents an array with name a.
ArraySymbol[a,{n1,n2,…}]
represents an n1×n2×… array.
ArraySymbol[a,{n1,n2,…},dom]
represents an array with elements in the domain dom.
ArraySymbol[a,{n1,n2,…},dom, sym]
represents an array with the symmetry sym.
Details
- The name a in ArraySymbol[a,{n1,n2,…},dom, sym] can be any expression.
- Valid dimension specifications ni in ArraySymbol[a,{n1,n2,…},dom, sym] are positive integers. It is also possible to work with symbolic dimension specifications.
- Element domain specifications dom in ArraySymbol[a,{n1,n2,…},dom, sym] include:
-
Complexes complex numbers Integers integers Reals real numbers NonNegativeReals real numbers x with x≥0 PositiveReals real numbers x with x>0 - Some symmetry specifications have names:
-
Symmetric[{s1,…,sn}] full symmetry in the slots si Antisymmetric[{s1,…,sn}] antisymmetry in the slots si - In arithmetic and many other functions that work with lists, ArraySymbol objects do not automatically combine with other list arguments.
- Optimization functions, equation solvers and D recognize that ArraySymbol objects represent vector variables.
Examples
open all close allBasic Examples (1)
Assign the value of the variable a to represent an mnp array with name "a":
a = ArraySymbol["a", {m, n, p}]Arithmetic operations recognize that a is not a scalar:
a + b + {1, 2}a - aD recognizes that a is an array variable:
D[Total[a], a]Scope (7)
Compute derivatives with respect to an array variable:
a = ArraySymbol["a", {m, n, p}];D[a, a]D[Total[a], a]D[Transpose[a, 2], a]Compute derivatives involving array-valued functions:
a = ArraySymbol["a", {m, n, p}];
b = ArraySymbol["b", {p, q}];D[a[x].b[x], x]D[TensorProduct[a[x], b[x]], x]D[Tr[a[b]], b]Use an array variable in optimization:
a = ArraySymbol["a", {2, 2, 2}];Minimize[{Tr[a], ArrayDot[a, a, 3] <= 1}, a]Solve equations and inequalities involving an array variable:
a = ArraySymbol["a", {2, 2, 2}];Solve[a.{{1, 2}, {3, 4}} == {{{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}}, a]FindInstance[ArrayDot[a, a, 3] == 1 && Tr[a] >= 1, a, Reals]Array variable with no dimensionality information specified:
a = ArraySymbol["a"];Arithmetic operations recognize that a may not be scalar:
a + b + {1, 2}a = ArraySymbol["a", {3, 5, 7}, Reals];Refine recognizes that entries of the array are real:
Refine[Element[Indexed[a, {1, 2, 3}], Reals]]A rank-4 real-valued array variable, symmetric in three slots:
a = ArraySymbol["a", {4, 4, 4, 4}, Reals, Symmetric[{1, 2, 4}]];Any transposition involving those slots is equivalent to a:
TensorTranspose[a, Cycles[{{2, 4}}]]//TensorReduceApplications (3)
Derive a least-squares solution for data
given as a list of pairs
:
m = ArraySymbol["m", {n, 2}]Find the vector of vertical deviations
for the data:
dev = m.{-a, 1} - bDefine the sum of squares of the vertical deviations for the data:
squareDeviations = dev.devSet up the least-squares equations:
eqna = D[squareDeviations, a] == 0eqnb = D[squareDeviations, b] == 0n = 200;data = Table[{x, 3x + 20 + RandomReal[{-15, 15}]}, {x, 1, n}];Solve the least-squares problem for this data:
a x + b /. Solve[Normal[{eqna, eqnb}] /. m -> data, {a, b}][[1]]Show[{ListPlot[data], Plot[%, {x, 0, 200}, PlotStyle -> Red]}]Find an optimality condition for a portfolio optimization problem with the expected return
and standard deviation
:
x = ArraySymbol["x", {n}];
μ = ArraySymbol["μ", {n}];
Σ = ArraySymbol["Σ", {n, n}];
Subscript[μ, p] = μ.x;
Subscript[σ, p] = Sqrt[x.Σ.x];The goal is to maximize
when the vector
of asset weights satisfies Total[x]=1. The constraint can be used to represent
where the unconstrained vector variable
consists of the first
coordinates of
:
A = ArraySymbol["A", {n, n - 1}];
y = ArraySymbol["y", {n - 1}];
b = UnitVector[n, n];The maximum occurs at a critical point of
:
cond = D[Subscript[μ, p] / Subscript[σ, p] /. x -> A.y + b, y] == 0Express the condition in terms of
:
cond /. A.y + b -> xCompute the gradient of the log-likelihood function of the linear regression model represented by the equation
, where
are normally distributed random variables with mean zero and variance
:
y = ArraySymbol["y", {n}];
X = ArraySymbol["X", {n, k}];
β = ArraySymbol["β", {k}];
u = ArraySymbol["u", {n}];The log-likelihood function
is given by:
l = -n / 2Log[σsquared] - 1 / (2σsquared)u.uSubscript[l, β] = D[l /. u -> y - X.β, β]Express the result in terms of
:
Subscript[l, β] /. y - X.β -> uSubscript[l, σ^2] = D[l, σsquared]Properties & Relations (5)
Use TensorRank to get the rank of an array symbol:
TensorRank[ArraySymbol["a", {j, k, l}]]ArraySymbol["name"] represents an array of unknown rank:
TensorRank[ArraySymbol["a"]]Use TensorDimensions to get the dimensions of an array symbol:
TensorDimensions[ArraySymbol["a", {j, k, l}]]Use TensorSymmetry to get the symmetry of a matrix symbol:
TensorSymmetry[ArraySymbol["a", {d, d, d}, Reals, Antisymmetric[All]]]By default, no symmetry is assumed:
TensorSymmetry[ArraySymbol["a", {d, d, d}]]ArraySymbol[a,{m,n}] and MatrixSymbol[a,{m,n}] both represent matrices:
TensorDimensions[MatrixSymbol["a", {m, n}]] == TensorDimensions[ArraySymbol["a", {m, n}]]However, MatrixSymbol[a,m] represents a square matrix:
TensorDimensions[MatrixSymbol["a", m]]Whereas ArraySymbol[a,m] represents a vector:
TensorDimensions[ArraySymbol["a", m]]ArraySymbol[a,m] and VectorSymbol[a,m] both represent vectors:
TensorDimensions[VectorSymbol["a", m]] == TensorDimensions[ArraySymbol["a", m]]Related Guides
History
Text
Wolfram Research (2024), ArraySymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/ArraySymbol.html.
CMS
Wolfram Language. 2024. "ArraySymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArraySymbol.html.
APA
Wolfram Language. (2024). ArraySymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArraySymbol.html
BibTeX
@misc{reference.wolfram_2026_arraysymbol, author="Wolfram Research", title="{ArraySymbol}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/ArraySymbol.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_arraysymbol, organization={Wolfram Research}, title={ArraySymbol}, year={2024}, url={https://reference.wolfram.com/language/ref/ArraySymbol.html}, note=[Accessed: 12-June-2026]}