Goal

After this module you can compress a matrix with the truncated SVD and predict its error from the discarded singular values, reshape a many-body state into a matrix across any cut, read off its Schmidt values and entanglement entropy, and explain why low entanglement is what makes tensor networks efficient.

Notebooks

A quantum state of spins-1/2 is a list of complex numbers. Every extra spin doubles the list. Thirty spins already fill a laptop, and fifty would need more memory than any computer has. Yet people routinely compute ground states of chains with hundreds of spins to ten significant digits. Something must make those states much smaller than their nominal size.

That something is the same thing that makes a photograph compressible: the data is close to a matrix of low rank. A grayscale image is an matrix, but its rows are strongly correlated, so a few “layers” reproduce it well. The singular value decomposition (SVD) finds the best such layers and tells us exactly what we lose by dropping the rest.

In this module we build that idea from scratch. We start with the SVD and prove that truncating it is optimal (the Eckart-Young theorem). We then reshape a quantum state into a matrix, which turns the SVD into the Schmidt decomposition, and measure how compressible the state is with the entanglement entropy. Comparing ground states with random states shows which states tensor networks can handle, and the last section points to the matrix product state of Module 2.

The curse of dimensionality

A pure state of sites with levels each is

It is fixed by the amplitudes . In double-precision complex arithmetic each amplitude takes 16 bytes. For qubits () the notebook prints

1020304050
memory of 16 KiB16 MiB16 GiB16 TiB16 PiB

A 16 GiB laptop stops at . Each factor of 1024 in memory buys only ten more qubits, so no hardware improvement will rescue brute force. Applying an operator is worse: a dense Hamiltonian has entries.

The way out is to stop storing amplitudes and store a recipe for computing them instead, one whose size grows polynomially in . Such a recipe can only exist if the state has structure. The tool for finding structure in a table of numbers is the SVD.

The singular value decomposition

Definition 0.1 (Singular value decomposition).

Every complex matrix can be written as

where () and () have orthonormal columns , (𝟙), and holds the singular values . The number of nonzero is the rank of .

The second form of reads the product column by column. It writes as a sum of rank-1 layers . Each layer is an outer product of one column pattern and one row pattern , weighted by . The singular values measure how much each layer matters. Since and are isometries, the squared Frobenius norm is

So is the fraction of the total weight carried by layer . In the diagram language of Module 1, a matrix is a box with two legs and the SVD splits it into three pieces joined by a new leg, the bond, as drawn in Figure 0.1.

A m n = U s Vh r r U'U = 1 s sorted Vh Vh' = 1
Figure 0.1. The SVD as a tensor diagram. The two legs of A (dimensions m and n) end up on the isometries U and V-dagger; the new bond of dimension r carries the singular values. Blue and green mark left and right isometries, gold the diagonal.

The Eckart-Young theorem

Keeping the first layers of Definition 0.1 gives the truncated SVD

It has rank . The question is whether some other rank- matrix could do better. The answer is no (1).

Theorem 0.1 (Eckart-Young).

Let have singular values and let be its truncated SVD. For every matrix with ,

Here is the spectral norm (the largest singular value).

The two equalities are immediate: is already written as an SVD, so its singular values are . The work is in the inequalities.

Proof (spectral norm)

Since , its kernel has dimension at least . The span of has dimension . Two subspaces of with dimensions adding to more than intersect nontrivially, so there is a unit vector with and . Then

so .

For the Frobenius norm we need a statement about all singular values at once. Below, denotes the -th largest singular value of a matrix (so ), with once exceeds the number of singular values.

Lemma 0.1 (Weyl's inequality for singular values).

For any matrices , and indices with , .

Proof sketch

The spectral-norm part of Theorem 0.1, which we just proved, says , with the minimum reached at the truncated SVD. Let and be the truncated SVDs of and of ranks and . Then has rank at most , so

Proof (Frobenius norm)

Apply Lemma 0.1 with , and . Since we have , so for every . Squaring and summing over ,

Dividing by gives the relative error that every compression in this course reports,

We call the discarded weight. TEBD, DMRG and circuit simulation all truncate bonds in exactly this way and monitor to know how much they lost. (Mirsky later showed (2) that the truncated SVD is optimal in every unitarily invariant norm, not just these two.)

Worked example: compressing an image

The notebook draws a grayscale “landscape” from a closed formula (sky gradient, sun, wavy mountains with stripes, a checkerboard field and a diagonal road), so that the Julia and Python versions build the same matrix. Its largest singular values are . The first layer carries the average brightness; the rest fall over many decades.

Rank-k reconstructions of the test image for k = 1, 5, 20 (top), its singular values on a log scale with the three cuts marked (bottom left), and the relative error against k (bottom right). The measured error lies exactly on the discarded-weight formula, and rank 20 already looks like the original with 6 times fewer numbers.
Figure 0.2. Rank-k reconstructions of the test image for k = 1, 5, 20 (top), its singular values on a log scale with the three cuts marked (bottom left), and the relative error against k (bottom right). The measured error lies exactly on the discarded-weight formula, and rank 20 already looks like the original with 6 times fewer numbers.

The bottom right panel of Figure 0.2 is a check of . The measured (circles) lies on the curve computed from the singular values alone, and both notebooks find agreement to better than . In numbers:

kept rank 152050
relative error0.15450.07440.01020.0005
compression factor120x24x6.0x2.4x

To see that “best” is a strong claim, the notebook also tries three other rank-10 approximations. Keeping the 10 columns of largest norm and projecting onto them gives an error 5.73 times the optimum. A randomized range finder (project onto the span of for a test matrix ) gives 1.81 times the optimum. Rounding the optimal factors to two decimals gives 2.41 times the optimum. None beats , as Theorem 0.1 guarantees.

Counting numbers

Storing densely costs numbers. The truncated SVD stores ( numbers), () and (), so

Compression pays off for , which is for our image. The savings are linear in ; the error falls as fast as the singular values do. A spectrum that falls exponentially gives exponential accuracy for linear cost, and that is the situation tensor networks are built for.

The Schmidt decomposition

Now the main point. Split a chain of sites into a left block (sites ) and a right block (sites ). Group the left indices into one row index and the right indices into one column index . The amplitudes become a matrix

No number changes; we only read the same table as a matrix. Applying the SVD to this matrix gives a decomposition of the state, sketched in Figure 0.3.

s1 s2 s3 s4 s5 s6 psi reshape Psi (s1 s2 s3) (s4 s5 s6) SVD U s Vh Schmidt values
Figure 0.3. From a state to its Schmidt decomposition. The six physical legs are grouped into a row index (left block) and a column index (right block); the SVD of the resulting matrix gives the Schmidt vectors (U, V-dagger) and the Schmidt values s.
Proposition 0.1 (Schmidt decomposition).

For every normalized and every cut there are orthonormal states of the left block, orthonormal states of the right block and numbers such that

The Schmidt values are the nonzero singular values of , and their number (the Schmidt rank) is . The are unique.

Proof

Take the SVD , that is . Define and . Then

where the terms with drop out, leaving terms. Orthonormality follows from 𝟙 and 𝟙: , and similarly for . Normalization gives . Uniqueness of the is uniqueness of singular values, since are the eigenvalues of .

Three examples on qubits, which the notebook checks with the index conventions of Remark 0.1, are the following.

  • A product state has , a rank-1 matrix: one Schmidt value across every cut.
  • The GHZ state has exactly two Schmidt values across every cut.
  • The W state split after sites is , so its Schmidt values are and ; for , the notebook prints and .
Remark 0.1 (Index order in code).

We store states with site 1 as the most significant bit, the convention of kron. numpy is row-major, so psi.reshape(2**l, 2**(N-l)) is exactly . Julia is column-major, so reshape(psi, 2^(N-l), 2^l) gives . Both have the same singular values, which is all we use here; but when the Schmidt vectors matter (Module 2), the order has to be tracked carefully.

Entanglement entropy

The squared Schmidt values are non-negative and sum to one. They have a physical meaning. The reduced density matrix of the left block is

so the are the eigenvalues of (and of ). The Shannon entropy of this distribution is the entanglement entropy.

Definition 0.2 (Entanglement entropy).

The von Neumann entanglement entropy of across a cut with Schmidt values is

with the convention and the natural logarithm throughout the course.

Proposition 0.2 (Entropy bounds).

If the Schmidt rank across the cut is , then . The lower bound holds exactly for product states across the cut, and the upper bound exactly when all Schmidt values equal . In particular .

Proof

Each term is non-negative for , and the sum vanishes only when one . For the upper bound, is concave, so by Jensen’s inequality

with equality iff is constant. The last statement follows from , the smaller dimension of .

Product, GHZ, random and ground states

Which states have small entanglement in the sense of Definition 0.2? The notebook compares, on qubits, the product state , the GHZ state, a random state, and the ground state of the transverse-field Ising model (TFIM)

on an open chain, at the critical point and in the paramagnetic phase (3). The ground state comes from Lanczos using only the action ; its energy agrees with the exact free-fermion value to a few times . Figure 0.4 repeats the comparison at .

Left: Schmidt values across the central cut of an N = 14 chain, on a log scale. The product and GHZ states have one and two values; the TFIM ground states fall off exponentially (faster at g = 2 than at the critical point g = 1); the random state has 128 values of similar size. Right: entanglement entropy for every cut position. The random state follows Page's average (dashed), close to the maximal min(l, N - l) ln 2 (dotted); the ground states stay small and nearly flat.
Figure 0.4. Left: Schmidt values across the central cut of an N = 14 chain, on a log scale. The product and GHZ states have one and two values; the TFIM ground states fall off exponentially (faster at g = 2 than at the critical point g = 1); the random state has 128 values of similar size. Right: entanglement entropy for every cut position. The random state follows Page's average (dashed), close to the maximal min(l, N - l) ln 2 (dotted); the ground states stay small and nearly flat.

Two behaviours stand out.

Random states obey a volume law. For a state drawn uniformly at random, Page showed (4) that the average entropy of a block of dimension inside a total space of dimension () is

For the half cut of 12 qubits () this is , half a nat below the maximum allowed by Proposition 0.2. The notebook’s pseudo-random state gives . The entropy grows linearly in the size of the smaller block, its Schmidt values are all of the same size, and nothing can be thrown away: a random state is incompressible.

Ground states obey an area law. The TFIM ground states have half-chain entropies () and (), and their entropy hardly changes with the cut position. Their Schmidt values fall off exponentially: at the weight beyond the fourth value is already below . This is the area law: for ground states of local Hamiltonians with an energy gap, the entropy of a block scales with the size of its boundary, not its volume (5,6). In one dimension the boundary is one bond, so the entropy is bounded by a constant independent of . At a critical point the gap closes and the entropy grows, but only as for an open chain (7), still far below the volume law.

Truncating a state across one cut

What does it cost to keep only Schmidt values? Let be the discarded weight across the cut.

Proposition 0.3 (Truncation fidelity).

The normalized truncated state satisfies . Before normalization, , and no vector of Schmidt rank at most is closer to .

Proof

By orthonormality of the Schmidt vectors in Proposition 0.1, . The unnormalized difference is , with squared norm . Optimality is Theorem 0.1 applied to , since the vector 2-norm of is the Frobenius norm of and Schmidt rank is matrix rank.

The notebook checks this for . For the critical TFIM ground state the infidelity is at , at and at , equal to each time. For the random state, still loses of the weight.

Outlook: compress every cut

A single cut is not enough. After one SVD the left and right Schmidt vectors are still vectors of length . The fix is to repeat the SVD at every cut in turn: split off site 1, then site 2 from the remainder, and so on. Each step leaves an isometry for one site and a bond carrying the Schmidt values. The result is a matrix product state (MPS), a chain of small three-leg tensors, which is the subject of Module 2 and is previewed in Figure 0.5.

s1 s2 s3 s4 s5 A1 A2 A3 A4 A5 D1 D2 D3 D4 about N d D2 numbers instead of dN
Figure 0.5. Preview of Module 2. Repeating the SVD at every cut turns a state into a chain of three-leg tensors: one physical leg per site and one bond per cut (D1 to D4), whose dimension only needs to be as large as the Schmidt rank across that cut.

The bond dimension only needs to be as large as the number of Schmidt values we keep across cut . The notebook computes the smallest that keeps at every cut of the states, and the resulting storage (with at the open ends):

state for MPS numbersdense
product1 1 1 1 1 1 1 1 1 1 1244096
GHZ2 2 2 2 2 2 2 2 2 2 2884096
TFIM 2 4 5 5 5 5 5 5 5 4 24204096
TFIM 2 4 7 8 9 9 9 8 7 4 29884096
random2 4 8 16 32 64 32 16 8 4 2109204096

For ground states the bond dimension saturates; doubling roughly doubles the storage instead of squaring the dense size. For the random state the “MPS” is bigger than the vector it represents.

Warning

  • Random and highly excited states. Volume-law states need ; no tensor network compresses them. The same holds for states after long real-time evolution from a product state, whose entropy grows linearly in time (Module 3).
  • Critical points. The entropy grows like , so the required grows polynomially with system size. MPS still work, but convergence in must be checked.
  • Two dimensions. An area law in 2D means boundary length , so an MPS snaking through an lattice needs . That is why higher-dimensional networks (PEPS) exist.
  • A single cut says little. A small entropy at the middle cut does not guarantee small entropies elsewhere; every cut has to be checked, which is what an MPS does automatically.

Why it matters

The SVD gives the optimal compression across a cut and an exact price tag, the discarded weight . Ground states of local Hamiltonians have small entanglement across every cut, so they compress from numbers to . Every algorithm in the rest of the course (MPS canonical forms, TEBD, DMRG, circuit simulation) is this one idea applied repeatedly and locally.

Further reading

  • The original statement of the low-rank approximation theorem: (1).
  • Area laws and why they make ground states simple: (6); the 1D proof for gapped Hamiltonians: (5).
  • Entanglement entropy at critical points: (7).
  • Introductions to tensor networks that start from the same picture: (8,9); a modern review of MPS and their theory: (10).

Homework

The problems for this module are in Homework 0.

1.
Eckart C, Young G. The approximation of one matrix by another of lower rank. Psychometrika. 1936;1(3):211–8.
2.
Mirsky L. Symmetric gauge functions and unitarily invariant norms. The Quarterly Journal of Mathematics. 1960;11(1):50–9.
3.
Pfeuty P. The one-dimensional Ising model with a transverse field. Annals of Physics. 1970;57(1):79–90.
4.
Page DN. Average entropy of a subsystem. Physical Review Letters. 1993;71(9):1291–4.
5.
Hastings MB. An area law for one-dimensional quantum systems. Journal of Statistical Mechanics: Theory and Experiment. 2007;2007(08):P08024.
6.
Eisert J, Cramer M, Plenio MB. Colloquium: Area laws for the entanglement entropy. Reviews of Modern Physics. 2010;82(1):277–306.
7.
Calabrese P, Cardy J. Entanglement entropy and quantum field theory. Journal of Statistical Mechanics: Theory and Experiment. 2004;2004(06):P06002.
8.
Orús R. A practical introduction to tensor networks: Matrix product states and projected entangled pair states. Annals of Physics. 2014;349:117–58.
9.
Schollwöck U. The density-matrix renormalization group in the age of matrix product states. Annals of Physics. 2011;326(1):96–192.
10.
Cirac JI, Pérez-Garcı́a D, Schuch N, Verstraete F. Matrix product states and projected entangled pair states: Concepts, symmetries, theorems. Reviews of Modern Physics. 2021;93(4):045003.