An index that is a pair
Worth reading first: Changing the condition number on purpose · An operator with no entries · A block nobody can call sparse.
Three fields of this collection are answers to one sentence: the matrix is too large to store. Sparsity says most of its entries are zero. A matrix-free operator says never form it, and let it be a subroutine. A hierarchical representation says its off-diagonal blocks are numerically low rank, and where they are cut is a decision.
This field is the fourth answer, and it is the only one that changes what an index is.
The size nobody quotes
A discretisation on a grid of n points along each of d axes has n^d unknowns. That number is quoted constantly and it is not the difficult one. The difficult one is the size of the matrix, which is the square of it: n^{2d}.
At n = 100 and d = 2 that is 10⁸ entries, which is 800 megabytes and merely annoying. At d = 3 it is 10¹², which is eight terabytes. At d = 5 it is 10²⁰, which is not a large number of entries — it is a number of entries with no physical meaning, exceeding the count of atoms in a gram of anything by enough that no improvement in storage will ever matter.
The sparsity field’s answer applies and is the right one for a finite-difference stencil: the matrix has at most 2d + 1 non-zeros a row, so it is 5n² numbers in two dimensions rather than n⁴. That is the answer this collection has used since the two-dimensional model problem arrived, and it is not what this field is about.
What this field is about is a stronger statement, available for the same matrices and for many that are not sparse at all:
The matrix is a sum of d Kronecker products of n × n matrices.
That is d·n² numbers. Nothing has been approximated, no tolerance has been chosen, and no property of the entries has been exploited. The matrix was never anything else. Writing it out as n^{2d} numbers was the mistake, and it is a mistake that is made because the notation for the alternative is not taught alongside the notation for the matrix.
What the product is
For A of size m × n and B of size p × q, the Kronecker product A ⊗ B is the mp × nq matrix built by replacing every entry of A with that entry times the whole of B. It has one row for each pair (i, p) and one column for each pair (j, q), which is the sentence this field turns on: its index is a pair.
The two-dimensional Laplacian on an interior grid is the standard example. Number the unknowns so that u_{i,j} is at position i·n + j, let T = tridiag(−1, 2, −1) be the one-dimensional operator, and the five-point stencil is exactly
A = T ⊗ I + I ⊗ T
The first term differences along the first index and leaves the second alone; the second does the reverse. That is what a Kronecker sum is, and the whole of the two-dimensional operator is in it.
For d axes there are d terms and the same construction, with the identity in every position but one. The storage is d·n² whatever d is, which is the property that makes the format worth having: the matrix’s size is exponential in d and its description is linear in it.
The spectrum, which is written down
The one-dimensional Laplacian has its whole spectrum in closed form. Its eigenvalues are
λ_k = 4 sin²(kπ / 2(n + 1)), k = 1 … n
with eigenvectors the discrete sines, and this collection has used them since the iterative field opened, to give the iterative field a rate that is known rather than measured.
The Kronecker sum inherits it exactly. If A has eigenvalues α and B has eigenvalues β, then A ⊗ I + I ⊗ B has eigenvalues α_i + β_j — every sum, one for each pair of indices — and its eigenvectors are the Kronecker products of theirs. So the spectrum of the d-dimensional model problem is every sum of d numbers drawn from that list of sines, and it is known before anything runs.
The hero figure is that statement, checked. The matrix is assembled at a size where a Jacobi decomposition of it can be afforded, its eigenvalues are computed and sorted, and they are compared against the closed form entry by entry. The largest disagreement anywhere is at the rounding level.
That is exact-ground-truth in a place it is rarely available. A collection that measures error has to
have something to measure against, and its usual recourse is a better approximation — a solve in higher
precision, a decomposition of a smaller problem — which is a comparison against a computation rather
than against an answer. Here there is an answer, for an operator nobody can store, at every d.
The product, which never needs the matrix
The practical half is a product. Given x with n^d entries, the multiplication (A_1 ⊗ A_2 ⊗ … ⊗ A_d)x is computed by reading x as a d-way array and applying each factor along its own index.
In two dimensions that is one line. Reshape x into an n × n matrix X and
(A ⊗ B) x = vec(A X Bᵀ)
with vec the same row-major reading that turned the grid into a vector in the first place. Two dense
matrix multiplications of n × n matrices — 2n³ multiplications — against the assembled route’s n⁴.
The count is the argument, and it is returned by the code beside the answer rather than described. At n = 10 and d = 3 the assembled route is 10⁶ multiplications and the reshaped one is 3·10⁴, and the two answers agree to 4·10⁻¹⁶ relative. At n = 256 and d = 3 the assembled route is 2.8·10¹⁴ and the reshaped one is 1.3·10¹⁰.
The general form of the saving is worth stating because it is the one place in this collection where a difficulty and its remedy scale together. The assembled product costs n^{2d} and the reshaped one costs d·n^{d+1}, so the ratio is n^{d−1}/d. Every index added multiplies the saving by another factor of n. Everywhere else on this site a remedy is a constant factor and the difficulty is not.
What it does not buy
A format that made a difficulty vanish would be worth suspecting, and this one does not.
The condition number is untouched. κ(A ⊗ B) = κ(A)·κ(B) exactly, which is easy to see from the singular values — those of a Kronecker product are all the products of the two sets — and is checked here on a pair of small matrices rather than asserted. Two well-conditioned factors give a product whose condition number is their product, and the d-fold version is a d-th power.
For the model problem the arithmetic is worse than that. The one-dimensional Laplacian’s condition number is about (2(n+1)/π)², so it grows like n². The Kronecker sum’s is the ratio of the largest sum to the smallest, and both scale with d — the largest eigenvalue is d times the largest one-dimensional eigenvalue and the smallest is d times the smallest — so the sum has the same condition number as one of its terms, independent of d.
That is a genuinely favourable accident and it is an accident of the sum. A Kronecker product of d copies of T has a condition number that is the d-th power of T’s, and T’s is already 4,135 at n = 100, so the cube of it is 7·10¹⁰. The distinction between the two constructions is not decoration.
Where it sits beside the other three
The four answers to the matrix is too large are not alternatives, and the difference between them is worth naming precisely because they are usually all available at once.
Sparsity is a property of the entries. An entry is zero or it is not; the problem decides, and a code either stores the non-zeros or it does not. Nothing is chosen.
A matrix-free operator is a property of the code. The entries may be anything; what is available is the action, and this collection has an essay about what survives when a matrix is only a subroutine. Again nothing is chosen — the problem hands over a subroutine or it does not.
A hierarchical representation is the first one whose cost is chosen. The off-diagonal blocks are numerically low rank, the place their singular values are cut is a number somebody types, and the storage is a function of that number rather than of the matrix.
A Kronecker representation is none of these. It is not an approximation at any accuracy, so there is nothing to choose; it is not a property of the entries, since a Kronecker product of two dense matrices is dense; and it is not a property of the code, since the entries are perfectly available. It is a property of how the problem was written down — of the fact that the domain is a product of intervals and the operator acts along one axis at a time.
The failure of the format is a failure of the geometry
The condition under which the representation exists is that the operator separates. A finite-difference Laplacian on a rectangle separates. The same operator on an L-shaped domain does not, because the index set is not a product; a variable coefficient a(x, y) that is not itself a product does not; and an unstructured mesh does not, because there are no axes to speak of.
That is a much sharper restriction than sparsity’s, which is why this field does not replace the others. What it replaces is the class of problems where it applies — tensor-product discretisations, which is most of what a finite-difference or spectral code produces, and separable kernels.
The refusal
The claim under test is the easiest mistake this field offers, and it is easy because both statements are true of something.
The eigenvalues of a Kronecker product are the products of the eigenvalues. The eigenvalues of a Kronecker sum are the sums. Confusing the two gives a spectrum with the right number of entries, the right sign, and a plausible spread, and it is wrong at every entry.
So the assertion is fed exactly that: the whole spectrum of T ⊗ I + I ⊗ T is computed from the assembled matrix, the set of pairwise products of T’s spectrum is formed, the two sorted lists are compared, and the claim that they agree is required to fail. It does, at the first entry — the smallest sum is 2λ₁ and the smallest product is λ₁², and for the five-point Laplacian at n = 5 those are 0.536 and 0.0719.
The second refusal in the same file is narrower and is about the code rather than the algebra. A mode-k unfolding is a specific matrix, and a routine that folded a mode-1 unfolding back along mode 2 would return an array of exactly the right shape whenever two of the dimensions happen to agree. That is fed a 3 × 3 × 2 array and required to fail.
What the rest of the field is
Everything above is about a matrix. The word tensor has not appeared, because none of it needs one: a Kronecker sum is an ordinary matrix with an index that happens to be a tuple, and its arithmetic is ordinary matrix arithmetic in a different order.
The rest of this field takes the same step one level further, to arrays with three or more indices treated as objects in their own right, and the news there is worse. Every theorem this collection has relied on about rank stops being true: the best low-rank approximation need not exist, the rank depends on the field the entries are read over, and there is no decomposition that is orthogonal and diagonal at once. What survives is not the definition of a decomposition but the algorithm — take the singular value decompositions of the reshapes — and existence, computability and a quasi-optimality factor all come back with it.
At other settings
Reads more easily once this is understood
Essays that name this one as worth reading first.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A solve that is d decompositions — both name condition number, discrete laplacian, exact ground truth, kronecker product, kronecker sum, model problem, separability
- The format that does not notice the dimension — both name curse of dimensionality, exact ground truth, separability, unfolding
- An iterate that must be made smaller — both name curse of dimensionality, kronecker sum, model problem
- A decomposition made only of SVDs — both name curse of dimensionality, unfolding
- A function of a matrix is not a function of its entries — both name condition number, exact ground truth
- A nearest point that is not there — both name separability, unfolding
Named objects
A flat tag is an object no other essay names yet.
Condition numberCurse of dimensionalityDiscrete laplacianExact ground truthKronecker productKronecker sumMatrix-freeModel problemSeparabilityUnfolding