Search

Search papers and lessons

Tensor Network

Level 4 · 13 min read

A tensor network writes a huge array of quantum amplitudes as a chain of small arrays joined by bonds, so the cost depends on the entanglement across each cut rather than on the full size.

On this page

  • Colour = topic mix
  • Linear algebra
  • Quantum physics
  • Discrete math
  • Calculus
  • Probability
  • ReadReady to readNot yet

TL;DR

A quantum state of many qubits needs one amplitude for every combination of 0s and 1s, so the list doubles with each qubit. A tensor network stores that list as a chain of small arrays joined by shared indices called bonds. How big the bonds must be depends only on how much entanglement crosses each cut in the chain, and for most physically useful states that is far less than the full list.

Builds on: Tensor Contraction, Singular Value Decomposition (SVD), Quantum Entanglement, Qubit · Leads to: Jordan-Wigner Transformation, the DMRG and matrix product state review

Where it's used

  • Ground states of quantum magnets. The lowest-energy state of a one-dimensional chain of spins is the main target of the density matrix renormalization group, or DMRG, a renormalisation-group method that Steven White introduced in 1992. Its output is a matrix product state, a chain of small arrays, and physicists use it to find ground-state energies of chains with hundreds of sites that are far beyond exact diagonalisation.
  • Electrons in molecules. Quantum chemists treat the orbitals of a small molecule as the sites of a chain. The chain's bonds then carry the electron correlations, and the same DMRG machinery finds the lowest-energy configuration of the electrons.
  • Simulating quantum circuits. A quantum circuit with many gates can be written as a tensor network, and the cost of contracting that network tells you how hard the circuit is to imitate on an ordinary computer. This is one of the main ways researchers judge claims about quantum advantage.
  • Compressing neural networks. The same chain format, called a tensor train in machine learning, has been used to replace large weight matrices with products of smaller arrays, trading a little accuracy for many fewer parameters.

How it works

Take the two-qubit Bell state ∣ψ⟩=12(∣00⟩+∣11⟩)|\psi\rangle = \tfrac{1}{\sqrt{2}}(|00\rangle + |11\rangle), which is the simplest entangled state. Let s=1/2s = 1/\sqrt{2}, about 0.707.

  1. Write the amplitudes. The state has four amplitudes, one for each pair of bits: ψ00=s\psi_{00} = s, ψ01=0\psi_{01} = 0, ψ10=0\psi_{10} = 0 and ψ11=s\psi_{11} = s. Check: the squares add to s2+s2=0.5+0.5=1s^2 + s^2 = 0.5 + 0.5 = 1, as they must.
  2. Put the amplitudes in a grid. Let the first qubit choose the row and the second choose the column. The grid is (s00s)\begin{pmatrix} s & 0 \\ 0 & s \end{pmatrix}. This is the same data, now with two indices. Check: the grid has two rows and two columns, one for each value of each qubit.
  3. Find the singular values. The grid is already diagonal, so its singular value decomposition is trivial. Its two singular values are ss and ss. Check: multiplying the three SVD factors gives back the grid.
  4. Count the nonzero singular values. There are two, so the cut between the two qubits passes two independent pieces of information. Call the number of pieces the bond dimension of the cut. Here it is 2. Check: a product state, with no entanglement, has only one nonzero singular value.
  5. Split the grid into two small arrays joined by a bond. Put the square root of each singular value into both neighbours. Each small array is the 2×22 \times 2 matrix s\sqrt{s} on its diagonal, which is about 0.841 on each diagonal entry. The shared index kk runs from 1 to 2 and is the bond. Check: multiplying the two arrays gives 0.841⋅0.841=0.707=s0.841 \cdot 0.841 = 0.707 = s on the diagonal, which is the original amplitude.
  6. Truncate. Suppose we allow only bond dimension 1. Keep the largest singular value and drop the other. The discarded singular value is ss, about 0.707, and the share of the state's weight we keep is s2/(s2+s2)=0.5s^2 / (s^2 + s^2) = 0.5. Check: half the weight is lost, so a Bell state cannot be squeezed into a bond of size 1.
  7. Read the result. The Bell state needs bond dimension 2, and the entanglement across the cut is one bit. The bond holds exactly the information that the two qubits share.
flowchart LR
  A[Amplitudes of the whole state] --> B[Reshape at one cut into a matrix]
  B --> C[Singular value decomposition]
  C --> D[Keep the largest singular values]
  D --> E[Small arrays joined by a bond]

The math

Definition: Matrix product state

Let the state of NN qubits have amplitudes ψs1s2…sN\psi_{s_1 s_2 \dots s_N}, where each sjs_j is 0 or 1. A matrix product state writes each amplitude as a product of small matrices,

ψs1s2…sN=∑α1,…,αN−1Aα1s1Aα1α2s2⋯AαN−1sN,\psi_{s_1 s_2 \dots s_N} = \sum_{\alpha_1, \dots, \alpha_{N-1}} A^{s_1}_{\alpha_1} A^{s_2}_{\alpha_1 \alpha_2} \cdots A^{s_N}_{\alpha_{N-1}},

where each AsjA^{s_j} is a matrix whose size is set by the bond indices α\alpha. The largest bond size is the bond dimension χ\chi. The ends use a row vector and a column vector, so the product is a single number.

Steps 1 and 2 in symbols: the grid

The amplitudes satisfy ∑a,b∣ψab∣2=1\sum_{a,b} |\psi_{ab}|^2 = 1, which is the normalisation condition from qubit states. For two qubits, put Mab=ψabM_{ab} = \psi_{ab}, with aa the first qubit's value and bb the second's. For the Bell state, M=(s00s)M = \begin{pmatrix} s & 0 \\ 0 & s \end{pmatrix}.

Step 3 in symbols: the singular value decomposition

Any matrix can be written M=UΣV†M = U \Sigma V^\dagger, where UU and VV have orthonormal columns, Σ\Sigma is diagonal, and its entries σ1≥σ2≥⋯≥0\sigma_1 \ge \sigma_2 \ge \cdots \ge 0 are the singular values (see Singular Value Decomposition (SVD)). For the Bell state, U=V=IU = V = I and Σ=diag⁡(s,s)\Sigma = \operatorname{diag}(s, s). The singular values are the Schmidt coefficients of the state, and the probabilities pk=σk2/∑jσj2p_k = \sigma_k^2 / \sum_j \sigma_j^2 give the weight of each piece.

Steps 4 and 5 in symbols: splitting the bond

Define Aak=UakσkA_{ak} = U_{ak} \sqrt{\sigma_k} and Bkb=σk (V†)kbB_{kb} = \sqrt{\sigma_k} \, (V^\dagger)_{kb}. Then ψab=∑kAakBkb\psi_{ab} = \sum_k A_{ak} B_{kb}, which is the matrix product ABAB and is exactly the contraction pattern from Tensor Contraction. The sum over kk is over the bond. For the Bell state, A=B=diag⁡(s,s)A = B = \operatorname{diag}(\sqrt{s}, \sqrt{s}), and AB=diag⁡(s,s)AB = \operatorname{diag}(s, s) as required.

Step 6 in symbols: truncation

Keep only the χ\chi largest singular values. The matrix MχM_\chi built from them is the best rank-χ\chi approximation to MM, and the squared error in the Frobenius norm is

∥M−Mχ∥F2=∑k>χσk2.\| M - M_\chi \|_F^2 = \sum_{k > \chi} \sigma_k^2.

For the Bell state with χ=1\chi = 1, the error is σ22=0.5\sigma_2^2 = 0.5, so the error in the norm is 0.5≈0.707\sqrt{0.5} \approx 0.707.

The general chain and its size

For NN qubits and bond dimension χ\chi, the chain holds about 2Nχ22 N \chi^2 numbers, since each of the NN small arrays has two slices of size χ×χ\chi \times \chi. The full list of amplitudes holds 2N2^N numbers. The chain is smaller whenever 2N2^N exceeds 2Nχ22 N \chi^2, which for large NN happens at a modest χ\chi.

Entanglement and the bond

Across one cut, the entanglement entropy is S=−∑kpklog⁡2pkS = -\sum_k p_k \log_2 p_k in bits. Because there are at most χ\chi singular values, S≤log⁡2χS \le \log_2 \chi. So a bond dimension χ\chi can represent entanglement entropy up to log⁡2χ\log_2 \chi bits across that cut, and no more without error. For the Bell state, p=(12,12)p = (\tfrac12, \tfrac12) and S=1S = 1 bit, the largest value a bond of size 2 allows.

Worked examples

Example
1. A product state needs bond dimension 1

Let the state be (∣0⟩+∣1⟩)/2(|0\rangle + |1\rangle)/\sqrt{2} on the first qubit and ∣0⟩|0\rangle on the second. Find the bond dimension across the cut.

  1. The amplitudes are ψ00=s\psi_{00} = s, ψ10=s\psi_{10} = s, and the other two are 0, where s=1/2s = 1/\sqrt{2}.
  2. The grid is M=(s0s0)M = \begin{pmatrix} s & 0 \\ s & 0 \end{pmatrix}, so MM has rank 1.
  3. Write M=uσv⊤M = u \sigma v^\top with u=12(1,1)⊤u = \tfrac{1}{\sqrt{2}}(1, 1)^\top, σ=1\sigma = 1 and v=(1,0)⊤v = (1, 0)^\top. Check: σuv⊤=12(1,1)⊤(1,0)\sigma u v^\top = \tfrac{1}{\sqrt{2}}(1, 1)^\top (1, 0), which is (s0s0)\begin{pmatrix} s & 0 \\ s & 0 \end{pmatrix}.
  4. There is one singular value, so the bond dimension is 1. The largest probability is p1=σ2/σ2=1p_1 = \sigma^2 / \sigma^2 = 1, and the entropy is −1⋅log⁡21=0-1 \cdot \log_2 1 = 0.
  5. Conclusion: a product state has no entanglement, and a chain with bond size 1 is exact. It is just a product of two single-qubit arrays.
Example
2. A three-site chain with bond dimension 2

Use three sites with bond dimension 2. The arrays are: for site 1, the row vectors A0=(1,0)A^0 = (1, 0) and A1=(0,1)A^1 = (0, 1). For site 2, the matrices A0=(1101)A^0 = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} and A1=(0110)A^1 = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. For site 3, the column vectors A0=(1,0)⊤A^0 = (1, 0)^\top and A1=(1,1)⊤A^1 = (1, 1)^\top. Find the amplitude for s1s2s3=001s_1 s_2 s_3 = 001.

  1. Multiply the first two arrays: Asite 10⋅Asite 20=(1,0)(1101)=(1,1)A^0_{\text{site 1}} \cdot A^0_{\text{site 2}} = (1, 0) \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} = (1, 1).
  2. Multiply by the third array: (1,1)⋅(1,1)⊤=2(1, 1) \cdot (1, 1)^\top = 2.
  3. So the unnormalised amplitude is ψ001=2\psi_{001} = 2.
  4. To normalise, compute all eight amplitudes the same way. They are 1,2,0,1,0,1,1,11, 2, 0, 1, 0, 1, 1, 1 for 000000 through 111111. Check: each has a value like the one above, and the list has eight entries.
  5. The squares sum to 1+4+0+1+0+1+1+1=91 + 4 + 0 + 1 + 0 + 1 + 1 + 1 = 9, so the norm is 9=3\sqrt{9} = 3.
  6. The normalised amplitude is ψ001=2/3\psi_{001} = 2/3, and the probability of measuring 001001 is (2/3)2=4/9(2/3)^2 = 4/9, about 0.444.
Example
3. A realistic chain: a hundred spins

Consider the ground state of a chain of N=100N = 100 spin-1/2 particles with short-range interactions. A full list of amplitudes has 21002^{100} entries. Estimate how many numbers a matrix product state needs with bond dimension χ=64\chi = 64, and how the count changes when χ\chi doubles.

  1. The full state needs 2100≈1.27×10302^{100} \approx 1.27 \times 10^{30} amplitudes. This is more than any computer can hold.
  2. The chain needs about 2Nχ22 N \chi^2 numbers. With N=100N = 100 and χ=64\chi = 64, χ2=4096\chi^2 = 4096.
  3. Multiply: 2×100×4096=819,2002 \times 100 \times 4096 = 819{,}200. So the chain holds about 8.2×1058.2 \times 10^5 numbers, which fits easily in memory.
  4. The ground states of gapped chains obey an area law: the entanglement across any cut stays bounded as the chain grows, so a fixed χ\chi can describe a long chain well. This is why the count grows only in proportion to NN.
  5. The bond dimension controls accuracy as well as size. Doubling χ\chi to 128 allows entropy up to log⁡2128=7\log_2 128 = 7 bits across each cut, instead of log⁡264=6\log_2 64 = 6 bits.

Try it: with N=100N = 100 and χ=128\chi = 128, how many numbers does the chain hold, and by what factor did it grow from χ=64\chi = 64? Answer: 2×100×1282=2×100×16384=3,276,8002 \times 100 \times 128^2 = 2 \times 100 \times 16384 = 3{,}276{,}800, about 3.3×1063.3 \times 10^6. The factor is 44, because the count scales with χ2\chi^2, and (128/64)2=4(128/64)^2 = 4.

Common mistakes and tradeoffs

  • It is tempting to think a tensor network is just a compressed file format. In fact the bond dimension is set by entanglement, so a state with a lot of entanglement across a cut cannot be compressed much across that cut, whatever software you use.
  • It is tempting to think a larger bond dimension is always better. In fact it gives a more accurate state but costs more: in typical DMRG calculations the work per sweep grows roughly with χ3\chi^3, so doubling χ\chi can make each sweep about eight times slower.
  • It is tempting to think a matrix product state is exact for any state. In fact it is exact only when the bond dimension is large enough to hold all the entanglement across every cut. Truncation gives an approximation whose error is the sum of the discarded squared singular values.
  • It is tempting to think the chain format works in any dimension. In fact a matrix product state is a one-dimensional chain. A two-dimensional grid of qubits needs a different network, and the contractions become much harder to organise.

When to use it: for one-dimensional systems with short-range interactions, where the ground state has limited entanglement, and for circuits or states whose entanglement grows slowly.

When not to use it: for states with large entanglement across many cuts, such as highly entangled random states, where the bond dimension needed grows exponentially with the size of the system.

Alternatives: exact diagonalisation for very small systems, quantum Monte Carlo when the sign problem is absent, and other tensor networks such as the projected entangled pair state for two-dimensional systems.

History

Physicists were stuck on the fact that exact calculations on many-body quantum systems grow as 2N2^N, which limited them to small chains. In 1992 Steven White introduced the density matrix renormalization group, a numerical method that kept only the most important states at each step and found ground states of one-dimensional chains with high accuracy. It caught on because it worked far better than earlier renormalisation methods on the same systems. In 1995 Stellan Östlund and Stefan Rommer described the chain form of these states, which is now called a matrix product state. Ulrich Schollwöck's review of the method, first posted in 2010, made the connection widely known and set out the tools that use it today.

Recap

  • A quantum state of NN qubits has 2N2^N amplitudes, which quickly becomes too many to store.
  • Reshaping the amplitudes at one cut into a matrix and taking its SVD gives the singular values, and their number is the bond dimension of that cut.
  • Splitting the singular values across two small arrays joined by a bond gives a chain whose size depends on the bond dimension, not on 2N2^N.
  • Truncating to a smaller bond dimension loses exactly the discarded squared singular values.
  • Read next: the matrix product state review for the method in full, and Jordan-Wigner Transformation, which maps fermions onto the spin chains these networks handle best.

Check yourself

QuestionWhen you split the amplitudes of a two-qubit state across one cut and take the SVD, what does the number of nonzero singular values tell you?Show answer
It gives the bond dimension of that cut, which is the number of independent pieces of information that pass across it. A product state has one nonzero singular value, and an entangled state has more.
QuestionA chain of N=50N = 50 qubits has bond dimension χ=10\chi = 10. Estimate the number of numbers it holds, using 2Nχ22 N \chi^2, and compare it with the 2502^{50} amplitudes of the full state.Show answer
The chain holds about 2×50×100=10,0002 \times 50 \times 100 = 10{,}000 numbers. The full state has 250≈1.1×10152^{50} \approx 1.1 \times 10^{15} amplitudes, so the chain is smaller by a factor of about 101110^{11}.
QuestionWhy does the entanglement entropy across a cut give a lower bound on the bond dimension you need?Show answer
The entropy is computed from the singular values, and there are at most χ\chi of them. So the entropy can be at most log⁡2χ\log_2 \chi bits. If the entropy is larger than that, no bond of size χ\chi can hold the state exactly.
QuestionYou truncate a matrix product state to a smaller bond dimension and the discarded singular values are 0.10.1 and 0.050.05. What is the squared error in the Frobenius norm?Show answer
The squared error is the sum of the discarded squared singular values, 0.12+0.052=0.01+0.0025=0.01250.1^2 + 0.05^2 = 0.01 + 0.0025 = 0.0125. The error in the norm is about 0.0125≈0.112\sqrt{0.0125} \approx 0.112.
QuestionA researcher wants a two-dimensional grid of qubits described by a chain-shaped network. Why might a matrix product state be a poor choice, and what is the main reason?Show answer
A matrix product state is a one-dimensional chain, so its cuts do not match the geometry of a two-dimensional grid. The entanglement across a cut of a grid grows with the size of the boundary, which makes the bond dimension needed larger and harder to control, so a different network is usually chosen.

Sources