✦ For everyone, free.

Practical knowledge for real and everyday life

Home

8.20.2 Tensor Contraction Expansion

Tensor Contraction Expansion simplifies tensor expressions by contracting indices, uncovering mathematical relationships and structures.

Tensor Contraction Expansion is the application of the general index expansion operation specifically to an expression that contains one or more contracted (dummy) index pairs, producing the full, explicit form of the contraction: every free index resolved into its own separate equation, and within each equation, every contracted index written out as its complete sum of component products. It is the end-to-end expansion of a contraction from its compact symbolic form all the way down to plain arithmetic on named components, combining free-index expansion and implicit-sum expansion into a single, complete procedure applied to contraction expressions in particular.


The Two Layers Combined

Resolving Free Indices, Then Dummy Indices

Given a contraction such as C_k = A^i_{\ ik}, in which i is contracted and k is free, contraction expansion proceeds in two nested layers: first, one equation is produced for each value of the free index k; second, within each such equation, the contracted index i is expanded into its full sum:

C1 = i=1n Ai1i = A111 + A212 + + An1n

and likewise a separate, similarly expanded equation for C_2, C_3, and so on through C_n.

A Named Procedure for a Common Case

Contraction is by far the most frequent source of implicit summation in tensor expressions, so contraction expansion is singled out as its own named procedure even though it is built from nothing more than the two general expansion layers applied together; the naming reflects how often this exact combination — expand the surviving free indices, then expand the summed index inside each — is invoked in practice when checking or computing a contracted result.


Expanding Multiple Contracted Pairs at Once

Independent Contractions Nest as Independent Sums

When an expression contracts more than one index pair simultaneously, contraction expansion introduces one nested sum per contracted pair, all held inside whichever equation corresponds to the fixed values of the remaining free indices. For D^i_{\ l} = A^{ij}_{\ \ jk} B^k_{\ l} (with j and k both contracted, i and l free), a single fixed pair of free-index values expands into a double sum over j and k:

D11 = j=1n k=1n Ajk1j B1k

with product terms contributing to this one component alone, before the remaining free-index equations for other values of i and l are written out separately.

Sequential Versus Simultaneous Contraction

Contraction expansion of a multi-pair contraction can be organized either as one combined multiple sum, expanded all at once as shown above, or as a sequence of single contractions applied one after another, first contracting j to produce an intermediate tensor and then contracting k on that intermediate result. Both organizations expand to the same final set of terms, since the underlying summations commute, but the sequential organization is often preferred in manual work because it keeps each individual expansion step to a single sum.


Diagram of a Contraction Fully Expanded

Cₖ = Aᵢᵢₖ (i contracted, k free) expand free index k: one equation per k C₁ = A¹₁ + A²₁ + ... + Aⁿ₁ (sum over i) C₂ = A¹₂ + A²₂ + ... + Aⁿ₂ (sum over i) ... one such expanded equation for every value of k

Practical Applications

Verifying a Named Contraction by Hand

Contraction expansion is the method used to confirm, in a small concrete dimension, that a named contraction has been computed correctly, such as verifying that the contraction defining the Ricci tensor from the Riemann tensor, or the contraction defining a matrix trace, produces the expected numerical result when checked against an independently known answer.

Guiding Direct Numerical Implementation

Because contraction expansion specifies exactly which sums are nested inside which free-index loops, it directly corresponds to the loop structure of a numerical routine that evaluates a contraction: an outer loop (or nested outer loops) ranges over the free indices, and an inner loop (or nested inner loops) accumulates the terms of the contracted sum for each fixed combination of free-index values, mirroring the two-layer structure of the expansion exactly.