8.21.3 Tensor Index to Matrix Translation
Tensor Index to Matrix Translation converts tensor indices into matrices by mapping multidimensional data to two-dimensional arrays through index contraction.
Tensor Index to Matrix Translation is the specific procedure for converting an index-notation expression built from tensors of order at most two into the corresponding matrix and vector expression, by mapping upper indices to row or column position according to a fixed convention, mapping contracted index pairs to matrix or matrix-vector multiplication, and mapping any remaining free indices to the row or column structure of the resulting matrix or vector. It is the most frequently used of the index-notation translations, since ordinary linear algebra notation is the target representation for the overwhelming majority of low-order tensor computations encountered in practice.
The Basic Correspondence
Vectors and Covectors
A (1,0) tensor vⁱ translates to a column vector v, with the upper index i indexing the row position of the vector's entries. A (0,1) tensor ωᵢ translates to a row vector ω^T (or, in a convention that reserves plain vectors for covectors, to a column vector understood as acting on the left), with the lower index i indexing the column position:
Mixed and Doubly-Covariant Rank-2 Tensors
A (1,1) tensor A^i_j translates to a square matrix A, with the upper index i as the row and the lower index j as the column, matching the convention that a matrix acting on a column vector produces another column vector via A^i_j v^j = (Av)^i. A (0,2) tensor such as the metric g_{ij} also translates to a square matrix, but one that acts on two vectors simultaneously rather than transforming a single vector, reflecting that both of its indices are lower and therefore both consumed by contraction against upper-indexed vectors, as in g_{ij}u^iv^j = u^T g v.
Translating Contraction Into Matrix Operations
A Single Contracted Pair Becomes Multiplication
Whenever an index-notation expression contracts one upper index of one tensor against one lower index of another, the translation is ordinary matrix multiplication, matrix-vector multiplication, or the inner product, depending on which of the two factors is rank one or rank two:
with the surviving free indices i and k corresponding to the row and column of the resulting product matrix, exactly matching the two remaining free indices of the index expression.
Fully Contracted Expressions Become Scalars
When every index in an expression is paired off by contraction, the matrix translation is a scalar quantity computed via matrix or vector operations that themselves reduce to a single number, such as the trace A^i_i ↔ tr(A) or the quadratic form g_{ij}v^iv^j ↔ v^T g v, both of which are standard matrix-notation idioms for a fully contracted index expression.
Where the Correspondence Breaks Down
Order Three and Above Has No Native Matrix Form
A tensor with three or more indices, such as T^i_{jk}, has no direct matrix analogue, since a matrix accommodates only two index slots; translating such a tensor requires either slicing it into a family of matrices (one matrix for each fixed value of one of its indices) or working with it directly in index notation without a matrix intermediary. Index-to-matrix translation is therefore inherently limited to rank-2 (and rank-1, rank-0) building blocks, even when it is used as one step within a larger calculation involving higher-order tensors.
Row/Column Convention Must Be Fixed and Consistent
Because the assignment of the upper index to rows and the lower index to columns (or vice versa) is a convention rather than a mathematical necessity, index-to-matrix translation requires this convention to be fixed once and applied consistently throughout a calculation; switching the convention partway through — for instance treating one tensor's upper index as a column index while treating another's upper index as a row index — produces a matrix expression that no longer matches the original index contractions correctly.
Diagram of the Translation for a Contraction Chain
Practical Use in Computation and Verification
Leveraging Matrix Software and Hardware
Translating an index expression into matrix form is the standard first step before evaluating it with numerical linear algebra software, since matrix multiplication, inversion, and decomposition routines are highly optimized and directly applicable once a contraction has been recognized as one of these standard matrix operations; this is the primary practical motivation for performing the translation at all, rather than evaluating the contraction directly from its index-level definition.
Cross-Checking a Derivation
An index-notation derivation that is easy to get wrong — through a misplaced index or an incorrect summation range — can often be checked by translating a small, concrete instance of it into matrices and vectors and confirming the matrix computation agrees with the value the index expression predicts, since matrix arithmetic in small dimensions is comparatively easy to carry out and verify by direct calculation.