Tensor unfoldings and mode ranks
Choose an explicit unfolding order and distinguish matrix ranks of tensor views from CP rank.
On this page
The question for today
What you’ll understand
- Construct mode unfoldings with a stated column ordering.
- Compute multilinear ranks and compare them with CP rank bounds.
- Explain why reshaping preserves Frobenius norm but changes the tested separation.
A tensor can be inspected as a matrix by choosing one index for rows and collecting the others into columns. Singular values of that view reveal which directions matter in that mode, but a different grouping asks a different separation question. Explicit indexing is therefore part of the mathematics, not an implementation footnote. We use real arrays and Frobenius norm, and we keep mode-unfolding ranks separate from the number of pure products needed to represent the tensor.
Declare the flattening before multiplying factors
For a three-way array of size n₁ by n₂ by n₃, the first unfolding has rows i and columns indexed by (j, k). Use j as the fast index, so column number is j + n₂(k − 1), with indices starting at one. In the second unfolding the remaining indices are (i, k), with i fast; in the third they are (i, j), again with i fast. For more modes, list remaining modes in increasing order and let the first listed index vary fastest.
Other books and software use different valid orders. Changing only the column order multiplies the unfolding by a permutation matrix, preserving singular values and matrix rank. However, formulas involving Kronecker or Khatri–Rao products must use the matching convention. A dimensionally correct product can still reconstruct permuted entries if its ordering is wrong. Writing one small slice example before deriving a large formula is an effective way to catch that error.
Mode ranks measure several different subspaces
The multilinear rank is the tuple rₙ = rank(T₍ₙ₎). Each component counts the dimension of the span of fibers in its mode. These ranks can differ: a tensor that uses one third-mode direction may still contain a full-rank matrix in the first two modes. Every nonzero pure tensor has all mode ranks one, and conversely a nonzero tensor with every mode rank one is pure.
If a tensor is a sum of R pure products, each unfolding is a sum of R rank-one matrices. Therefore every mode rank is at most R, giving a lower bound on CP rank. The tuple does not in general determine CP rank; later we will see a two-by-two-by-two tensor with mode ranks (2, 2, 2) but CP rank three. Matrix singular values supply useful bounds without collapsing all notions of tensor rank into one.
Rank and numerical rank answer different questions
Exact rank changes discontinuously when a singular value becomes exactly zero. Numerical rank instead depends on a tolerance and a selected norm or error budget. A small singular value may be negligible relative to measurement noise while remaining algebraically nonzero. Report the threshold or discarded Frobenius tail rather than declaring a tensor low rank without qualification. Scaling the entire data array changes absolute tolerances but not exact ranks.
Modewise low-rank approximations select subspaces for different indices. Their projections can be combined because they act on distinct modes, leading to Tucker compression. A single chosen unfolding may compress one direction well and leave the remaining structure large. Inspecting the full rank tuple and tail spectra reveals where storage reduction is possible and where a proposed mode size is still an essential information bottleneck.
Work it through
A tensor with one inactive mode direction
Let T have first third-index slice [[1, 0], [0, 2]] and second slice zero. Construct its first and third unfoldings, find all mode ranks, and compute its norm.
Using j-fast columns, T₍₁₎ = [[1, 0, 0, 0], [0, 2, 0, 0]]. Its nonzero singular values are two and one, so the first mode rank is two. The second unfolding has the same nonzero diagonal block and also rank two.
The third unfolding is [[1, 0, 0, 2], [0, 0, 0, 0]], using i-fast columns. It has one nonzero row and rank one, with singular value √5.
All views contain the same squared entry sum five. Thus the multilinear rank is (2, 2, 1) and the Frobenius norm is √5. Two pure coordinate terms represent T, while the first-mode lower bound rules out one, so its CP rank is two.
The mode ranks are (2, 2, 1), and the common Frobenius norm is √5. Different unfoldings reveal different separations.
The living notebook
Explore the model
Interactive lab · matrix
A matrix block can keep its rank while its spectrum changes
For each run Pause and Reset, then set both controls. Choose diagonal scale a = 2 and shear b = 0; predict singular values 2 and 1, matching the active block of the worked first unfolding. In a fresh run use a = 1 and b = 0; both singular values become 1 while matrix rank stays two. Readouts describe the selected final matrix. The lab illustrates one matrix view, not all unfoldings of an arbitrary tensor.
- Area scale · det A
- 1.4
- Singular values · σmax, σmin
- 1.597, 0.876
- Condition number · κ₂(A)
- 1.823
The selected matrix is A = [[a,b],[0,1]]. Playback interpolates geometry between the identity and A; readouts always describe A. Its determinant is a and its singular values come from AᵀA. Positive a makes every supported matrix invertible. This two-dimensional family is not a general eigensolver or a learned network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forSingular values describe directional size, while exact rank counts only which singular values are nonzero.
Pause & reason
Check your understanding
Your turn
Try it yourself
A two-by-two-by-two tensor has T₁₁₁ = 3, T₂₂₂ = 4, and all other entries zero. Determine its mode ranks, nonzero singular values in every unfolding, Frobenius norm, and CP rank.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The two nonzero coordinate terms occupy different rows and columns in every mode view.
Compare with the solution
Each unfolding has two orthogonal nonzero rows of lengths three and four, so its singular values are four and three and its rank is two. The multilinear rank is therefore (2, 2, 2). The squared entry sum is nine plus sixteen, giving Frobenius norm five. The displayed coordinate expression is a sum of two pure tensors, giving CP rank at most two; any mode unfolding gives the matching lower bound two. Thus CP rank is exactly two in this example, although the same rank tuple can occur for tensors of higher CP rank.
Keep the idea
Take it with you
- An unfolding formula must specify how its combined indices are ordered.
- Mode ranks are a tuple of matrix ranks and bound CP rank from below.
- Reshaping preserves Frobenius norm while changing the structural separation being tested.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.