After this module you can write any state as a matrix product state, explain why ground states need small bond dimension and random states do not, bring an MPS into canonical form, compute norms, expectation values, entropies and correlation functions at cost , and compress an MPS with an error you can bound in advance.
Module 0 ended with an observation: across every cut of a chain, the ground state of the transverse-field Ising model (TFIM) has Schmidt values that fall off fast. Module 1 gave us the tools to act on that observation: tensors with named legs, contractions, and the SVD and QR factorizations of a tensor viewed as a matrix across any split of its legs.
In this module we put the two together. If a state is close to low rank across one cut, we can split it there with an SVD. If it is close to low rank across every cut, we can split it everywhere, and what is left is a chain of small three-leg tensors: a matrix product state (MPS). The idea goes back to finitely correlated states (1) and to the analysis of DMRG (2); reviews with the modern viewpoint are (3–5).
We build the MPS bottom up. First we show that every state is an MPS, and how large the bonds must be. Then we use the freedom in choosing the tensors (the gauge) to make the chain easy to work with, read the entanglement off a single tensor, compute correlation functions, and finally compress an MPS with an error that we can bound before we start.
The MPS ansatz
Throughout, a state of sites with local dimension is , and we picture its amplitude tensor as one box with legs.
Definition 2.1 (Matrix product state).
A matrix product state with bond dimensions is a state whose amplitudes are
with site tensors of shape (left bond, physical, right bond) and trivial end bonds . For fixed , is a matrix, so each amplitude is a product of matrices. The bond dimension of the MPS is .
The literature also writes or for the bond dimension; we use throughout. Figure 2.1 shows the diagram of Definition 2.1. Each tensor has one physical leg (drawn down, because in every overlap diagram the ket sits on top and its conjugate below) and two bond legs shared with its neighbours. Storing the MPS costs at most numbers instead of .
A1A2A3AN...a1a211s1s2s3sNFigure 2.1. A matrix product state. Each site tensor has a physical leg (down) and two bond legs; the dashed end bonds have dimension 1. Contracting all bonds gives the amplitude tensor of eq. (2.1).
Example 2.1 (Product and GHZ states).
A product state is an MPS with : . The GHZ state needs . Take in the bulk (the matrices and ), the row vector on the first site and the column vector on the last. The product of matrices vanishes unless all are equal. Homework 2 asks for the W state, which also has .
Every state is an MPS: sequential SVDs
How do we find the tensors for a given state? We peel off one site at a time with the SVD of Module 0. Group as the row index and as the column index, factor , keep as , and carry the remainder to the right. Then group (new bond, ) as rows and repeat. Figure 2.2 shows the steps.
psi...s1s2s3sNSVD (s1 | rest)A1a1R = S V^dag...s1s2s3sNN-2 more SVDsA1A2A3AN...centreFigure 2.2. Exact MPS by sequential SVDs. Each SVD leaves a left-orthogonal tensor (blue) behind and pushes the remainder to the right; after N-1 steps the remainder is the last site tensor, which carries the norm (gold).
How large do the bonds get? The answer is the Schmidt rank. Write for the matrix obtained by grouping sites as rows and as columns, and for its rank, the Schmidt rank across bond .
Theorem 2.1 (Exact MPS and the bond-dimension bound).
Every state is an MPS. The sequential-SVD construction gives bond dimensions , and no MPS representation of can have on any bond. All tensors except the last are left-orthogonal.
Proof
Lower bound. In any MPS, contracting the tensors left of bond gives a matrix and contracting the tensors right of it gives a matrix , with . Hence .
Construction. Suppose after steps we have , where is the matrix formed by the first site tensors and has orthonormal columns (𝟙; for take , ). Reshape the remainder into the matrix and take its compact SVD with . Set (reshaped) and . Then
𝟙𝟙
and 𝟙𝟙, so the induction continues and every with is left-orthogonal. Because 𝟙 has orthonormal columns it is injective, so , i.e. . Finally is at most the number of rows and the number of columns of .
Intuition
The bond after site is a channel through which the left part of the chain “talks” to the right part. It has to carry one label per Schmidt vector, no more and no less. The bound is just the dimension of the smaller side: near the edges the bonds are tiny, in the middle an arbitrary state needs .
So an exact MPS is no bargain: for qubits the bonds grow as (the notebooks print exactly this list for the TFIM ground state), and the exact MPS of a generic state has more parameters than the dense vector (Homework 2). The gain comes from truncating: keep only the largest singular values at each step. Whether that is accurate depends on how fast the Schmidt values decay, which is a question about entanglement.
Area law versus volume law
Recall the entanglement entropy across bond , , with the normalized Schmidt values. It controls the bond dimension in both directions.
Proposition 2.1 (Entropy is bounded by the log of the bond dimension).
If is an MPS with bond dimension on bond , then .
Proof
By Theorem 2.1 at most Schmidt probabilities are nonzero. Since is concave, Jensen’s inequality gives .
So a state with entropy across some cut needs there; the GHZ state of Example 2.1 saturates the bound with and . Two classes of states behave very differently, as Figure 2.3 shows.
A random state is nearly maximally entangled. Page’s formula (6) gives the average , so the entropy grows with the size of the smaller block, a volume law. Such a state needs and an MPS gains nothing.
The ground state of a gapped local Hamiltonian in one dimension obeys an area law: stays bounded by a constant independent of (7,8). In one dimension the “area” of a cut is a single bond. At a critical point the entropy grows only logarithmically, for an open chain with central charge (9); the TFIM at has , and the quimb notebook fits from a 60-site DMRG state.
Figure 2.3. Entanglement entropy across every bond of a 14-site chain, from exact diagonalization. The random state (red dots) follows the Page average and nearly reaches the largest possible value, ln 2 times the number of sites on the shorter side of the cut; the TFIM ground states stay below 0.42 at the critical point and below 0.16 in the gapped phase.
Intuition
In a ground state, entanglement is created by the Hamiltonian’s local terms. Only the terms that straddle a cut can entangle the two sides, and with a gap their effect decays exponentially away from the cut. So only a region of size about the correlation length near the cut contributes, whatever the length of the chain. A random state has no such structure: every site is entangled with every other.
The upshot is that MPS are an efficient description of exactly the states we care about in one dimension. Rigorous versions of this statement exist: gapped ground states can be approximated by MPS with growing only polynomially in and (7,10).
Gauge freedom and canonical forms
The tensors of an MPS are not unique. On any bond we can insert for an invertible matrix :
Every product of matrices in is unchanged, so the state is unchanged. The notebooks check this: a random changes a tensor by 36 to 52 in Frobenius norm (depending on the sample), while the state changes by . We spend this freedom on making tensors isometric.
Definition 2.2 (Left- and right-orthogonal tensors).
A site tensor is left-orthogonal, written , if : as a matrix it has orthonormal columns, 𝟙. It is right-orthogonal, written , if : as a matrix it has orthonormal rows, 𝟙.
In diagrams (Figure 2.4) the property in Definition 2.2 says that a left-orthogonal tensor contracted with its conjugate over its left bond and physical leg collapses to an identity wire on the right bond.
ALAL*=left-orthogonal: AL^dag AL = 1ARAR*=right-orthogonal: AR AR^dag = 1Figure 2.4. Isometries collapse. A left-orthogonal tensor (blue) and its conjugate, contracted over the left bond and the physical leg, give the identity on the right bond; a right-orthogonal tensor (green) does the same from the other side. Ket on top, bra (conjugate) at the bottom.
QR and LQ decompositions produce such tensors, and they let us move weight along the chain without changing the state.
Proposition 2.2 (Canonicalization by QR sweeps).
Any MPS can be brought, without changing the state, into the mixed canonical form with centre :
It takes one QR per site left of and one LQ per site right of , at total cost . The special cases and are the left- and right-canonical forms.
Proof
Sweep left to right for . Reshape into a matrix and factor it as with 𝟙. Replace and . This is the gauge transformation with when is invertible, and in any case the product is unchanged, so the state is unchanged. The new is left-orthogonal, and later steps never touch it again. Then sweep right to left for with the LQ factorization of the matrix, keep (right-orthogonal) and absorb into . Each factorization of a matrix costs .
In the sweep of Proposition 2.2, moving the centre by one site is a single QR (to the right) or LQ (to the left). The notebooks call these move_center_right! and move_center_left!; Hands-on 2.4 assembles them into canonicalize!. Why do we care? Because in mixed canonical form everything outside the centre becomes trivial.
ALALACARARAL*AL*AC*AR*AR*=ACAC*all left and right pairs collapse to identitiesFigure 2.5. Mixed canonical form with the centre (gold) on the third site. As in the isometry figure above, the blue pairs collapse from the left and the green pairs from the right, so the norm is the norm of the centre tensor alone; an operator on the centre site would sit between the two gold tensors.
The algebraic statement behind Figure 2.5 is that a block of left-orthogonal tensors is an isometry from its bond into the Hilbert space of its sites.
Lemma 2.1 (Blocks of isometries are isometries).
If are left-orthogonal, the states are orthonormal. The same holds for right-orthogonal blocks built from .
Proof
Induction on . Write for the matrix whose columns are the . Then 𝟙, with read as a matrix, and 𝟙𝟙. The base case is trivial. The right block is the mirror image.
Theorem 2.2 (Mixed canonical form makes things local).
Let be in mixed canonical form with centre , and read as a matrix. Then
;
for an operator on site , , at cost ;
if is its SVD, the diagonal of holds the Schmidt values of across bond .
Proof
By Lemma 2.1, , and the product states are orthonormal. Items 1 and 2 are the norm and the matrix element of a vector written in an orthonormal basis, with acting only on the middle factor. For item 3, insert the SVD:
The first bracket is the image of the orthonormal columns of under the isometry 𝟙, the second the image of the orthonormal columns of under the isometry onto the right block, so both families are orthonormal. This is a Schmidt decomposition across bond , and by uniqueness of the Schmidt values the are those of .
Intuition
The orthogonal tensors act as perfect, lossless “lenses” between the bond and the physical sites: they rotate the bond basis into an orthonormal set of block states without stretching anything. All the information about amplitudes, and therefore about norms and entanglement, sits in the one tensor that is not an isometry.
This theorem is the reason every MPS algorithm in this course keeps track of the orthogonality centre. Local expectation values become cheap, the entanglement spectrum of any bond is one SVD away, and (in the compression section below) truncating at the centre is optimal. In the notebooks entanglement_entropies (Hands-on 2.5) moves the centre from site 1 to site and reads off the centre tensor at each step, reproducing the dense Schmidt entropies to .
The Vidal form
Canonical forms keep the Schmidt values of one bond. Vidal’s form keeps them all at once (11):
with the diagonal matrix of Schmidt values on bond . Any canonical form is read off from by grouping each diamond of Figure 2.6 with a neighbour, so , and , with .
G1G2G3G4L1L2L3Figure 2.6. Vidal form for four sites: tensors G (Gamma) alternate with the diagonal Schmidt-value matrices L (Lambda, gold diamonds) on the bonds. Absorbing each diamond into the tensor on its right (L G) gives right-orthogonal tensors; absorbing it into the tensor on its left (G L) gives left-orthogonal ones.
The form is built by one SVD sweep from a right-canonical state: at bond the SVD of the centre gives and , and . That inverse is the weak point (see What breaks below).
Overlaps, expectation values and correlation functions
The overlap is the ket chain of stacked on the conjugated chain of with the physical legs joined. The good way to contract it is a zipper: carry a environment matrix (bra bond, ket bond) from left to right,
where are the tensors of and those of .
LAB*aa'sbb'=L'step 1: L with Acost D3 dstep 2: with B*cost D3 dFigure 2.7. One step of the zipper, eq. (2.5). Contracting the environment with the ket tensor first and the bra tensor second keeps every intermediate at three legs.
Proposition 2.3 (Cost of overlaps).
Evaluating in the order of Figure 2.7, costs operations and memory. Contracting with first costs , and contracting the ket chain first costs .
Proof
Step 1 sums over for each of the values of : multiplications, leaving a intermediate. Step 2 sums over for each of the values of : again . The alternative first contracts and over into a four-leg tensor with entries, at cost , and contracting it with costs another . Contracting the ket tensors among themselves first rebuilds the dense amplitude tensor.
Proposition 2.3 answers the third exercise of the upstream notebook: the zipper order is optimal (np.einsum_path in the Python notebook finds it and reports instead of operations at ), and timing the zipper at gives an exponent of about 2.2 to 2.6 in our runs (the exact value depends on the machine and the BLAS library), approaching 3 as grows. The other two upstream exercises have short answers:
Nearest-neighbour operators (Hands-on 2.2). When the sweep reaches site , absorb and together with the two-site operator between them and their conjugates, then skip site . The cost is for that step.
Operators far apart (Hands-on 2.3). For insert on the physical leg at step and at step ; all other steps are plain. The cost stays for any separation. Assembling the TFIM energy from calls of expval2 (Hands-on 2.2) and calls of expval reproduces the dense to all 12 printed digits.
In mixed canonical form with the centre on site (Theorem 2.2) the environments left of and right of are identities, so a correlator needs only the sites .
Correlations and the transfer matrix
What does the zipper do in the bulk of a long, translation-invariant MPS with the same tensor on every site? It applies the same linear map again and again. Reading the environment as a vector of length , one step is multiplication by the transfer matrix
where is the step with an operator inserted. A two-point function is a product of the matrices , as drawn in Figure 2.8.
lEZEE...EEZrr - 1 copies of EFigure 2.8. In the bulk of a uniform MPS, the correlator of Z on sites i and i+r is a chain of transfer matrices: E with Z inserted (red) at both ends and r-1 plain copies of E between them, closed by the dominant left and right eigenvectors l and r.
Theorem 2.3 (Correlations of an MPS decay exponentially).
Let be normalized so that has a unique eigenvalue of largest modulus, with left and right eigenvectors and normalized by , and let be the next largest modulus. Then in the bulk of a long chain
with constants , independent of .
Proof sketch (diagonalizable transfer matrix)
Far from the ends, the boundary vectors have been multiplied by many powers of and are proportional to and , up to corrections of order . Then and . Write the spectral decomposition . The first term gives , and the rest gives with . Bound each term by . If is not diagonalizable, Jordan blocks add polynomial factors in , which do not change .
Intuition
The transfer matrix is a “time evolution” along the chain. Its leading eigenvector is the steady state that the environment relaxes to; every other eigenvector is a perturbation that dies out like . An operator insertion kicks the environment out of the steady state, and the second insertion measures how much of the kick survives after steps. Since is a finite matrix, its gap is finite, so an MPS with finite always has a finite correlation length.
The notebooks test Theorem 2.3 on a deterministic “random-looking” tensor with , (with counted from 1). Its transfer matrix has , so , and the negative makes the correlator alternate in sign. Fitting for on an 80-site chain returns the decay rate to all printed digits (Figure 2.9).
Figure 2.9. Left: eigenvalues of the transfer matrix of the uniform D = 3 MPS in the complex plane, divided by the largest modulus; only the leading eigenvalue (blue) lies on the unit circle and the second one (red) is the next largest. Right: the absolute connected ZZ correlator at distance r, on a log scale, falls on a straight line, an exponential decay with correlation length 4.54 sites.
At a critical point, such as the TFIM at , exact correlations decay as a power law. An MPS cannot reproduce that at any finite ; instead grows with , and studying how it grows (“finite-entanglement scaling”) is a standard way to extract critical exponents (12,13).
Compression by truncated SVD sweeps
We now have everything to answer the question of Module 0 for a whole chain: given an MPS, what is the best way to reduce its bond dimension to , and how large is the error? The algorithm is a sweep:
Bring into right-canonical form (centre on site 1) and normalize it.
For : take the SVD of the centre , keep the largest singular values, set and absorb into . Record the discarded weight .
Do not renormalize; call the result .
By Theorem 2.2, the singular values in step 2 are Schmidt values of the current state, so each truncation is the best rank- cut of that bond (Eckart-Young (14)). Write for the discarded weight of the original Schmidt spectrum of on bond .
Theorem 2.4 (Error of SVD compression).
For a normalized , the sweep satisfies
Moreover every MPS with bond dimension at most has , so
Proof
Truncations are nested projections. Let be the state after step (, ). Truncating bond keeps the leading left Schmidt vectors of , so with 𝟙 and the orthogonal projector onto their span. Each lies in the range of , hence and : the projectors are nested and commute. Therefore .
The identity. Since is an orthogonal projector, , and Pythagoras gives . Telescoping,
and the -th term is the squared norm minus the kept weight of the SVD in step , which is .
The bound on each step. Group sites as rows. The matrix of is 𝟙, with the matrix of . Because 𝟙𝟙𝟙 in the operator order, every singular value obeys (Weyl monotonicity). Summing the squares for gives .
Optimality. An MPS with bond dimension has Schmidt rank at most across every bond (Theorem 2.1), so by Eckart-Young for each . The chain collects the pieces.
Intuition
Each truncation throws away a piece of the state that is orthogonal to everything kept so far, so the squared errors simply add up, like the legs of a right triangle in many dimensions. And because a projection can only shrink singular values, a truncation never makes a later bond look more entangled than it was in the original state.
The literature often quotes the weaker for the renormalized output (3), which follows from . With , , so the left side is . In the notebooks, Hands-on 2.6 checks the identity to machine precision (the three sides agree to a few times ) and Figure 2.10 shows it for : the measured error is the sweep’s at every , and it sits inside the band of , close to the upper end.
Figure 2.10. Compression of the 14-site TFIM ground state (g = 1) to bond dimension D. Blue dots are the measured squared distance between the original and the compressed state, and black crosses the summed discarded weights of the sweep; they coincide. The shaded band is the sandwich of eq. (2.9) between the lower bound, the largest single-bond tail (green dotted), and the upper bound, the sum of all bond tails (red dashed).
The same truncation rule appears in every algorithm of the following modules: after a gate in TEBD (Module 3), after a local update in two-site DMRG (Module 4), and after each two-qubit gate in a circuit (Module 6). The sum of discarded weights is the error budget each of them reports.
Worked example: the 10-site Ising chain
Every number in this section is printed by the Module 2 notebooks (Julia and Python agree to all printed digits). Take the TFIM at and . Exact diagonalization gives .
Exact MPS.mps_from_dense (Hands-on 2.1) returns bond dimensions , exactly the bound of Theorem 2.1, and reproduces the dense vector to .
Expectation values. The zipper gives , and . Summing and returns . The correlations fall from 1 to () and ().
Entanglement. With the centre moved along the chain, the entropies are for (symmetric about the middle). The four largest Schmidt values on the middle bond are . By Proposition 2.1, , far from saturated. A random state of the same size has to (it depends on the sample); the maximum is .
Compression. Compressing to gives , below the bound . Equivalently, the fidelity is . A random MPS compressed from to has (Python) or (Julia; the random tensors differ) instead.
Compare the two numbers in item 4: storing the MPS takes complex numbers instead of , at an error of . At the same would need about 3000 numbers instead of .
Warning
Truncating away from the centre. The singular values of a non-centre tensor are not Schmidt values, so truncating there is not optimal and Theorem 2.4 does not apply. Always move the centre to the bond first.
Inverting small Schmidt values. Building the Vidal form needs . The TFIM ground state has Schmidt values near , and the notebooks show that is then right-orthogonal only to instead of . Keep canonical tensors and store on the side.
Norms of raw random MPS. A random MPS is not normalized and its norm grows exponentially with (between and for , in the notebooks). Canonicalize before computing anything, or divide by .
quimb conventions.MatrixProductState.entropy returns bits, not nats; schmidt_values returns ; correlation returns the connected correlator; MPS_rand_state does not cap the edge bonds at .
Critical and volume-law states. At criticality the required grows with (slowly), and after a quench or for a random state it grows exponentially. No MPS trick fixes a volume law.
Why it matters
The MPS turns the exponentially large state of a chain into small tensors, and the canonical form turns every question we ask of it (norms, local observables, entanglement, the best truncation) into a computation on one or two of those tensors. Every algorithm in the rest of the course (TEBD, DMRG, symmetric DMRG, circuit simulation) is a loop of “move the centre, update one or two tensors, truncate with the SVD”, with as its error budget. Module 3 takes the first step: it adds two-site gates to this loop and turns the MPS into a simulator of time evolution.
Further reading
U. Schollwöck, The density-matrix renormalization group in the age of matrix product states(3): sections 4 and 5 cover everything here, including canonical forms and compression.
R. Orús, A practical introduction to tensor networks(4): a gentle introduction with many diagrams.
J. I. Cirac, D. Pérez-García, N. Schuch, F. Verstraete, Matrix product states and projected entangled pair states(5): the modern theory, including injectivity and the transfer matrix.
G. Vidal, Efficient classical simulation of slightly entangled quantum computations(11): the form and the link between entanglement and simulability.
M. B. Hastings, An area law for one-dimensional quantum systems(7), and the review (8).
S. Östlund and S. Rommer, Thermodynamic limit of density matrix renormalization(2): where DMRG met the MPS.
Fannes M, Nachtergaele B, Werner RF. Finitely correlated states on quantum spin chains. Communications in Mathematical Physics. 1992;144(3):443–90.
2.
Östlund S, Rommer S. Thermodynamic limit of density matrix renormalization. Physical Review Letters. 1995;75(19):3537–40.
3.
Schollwöck U. The density-matrix renormalization group in the age of matrix product states. Annals of Physics. 2011;326(1):96–192.
4.
Orús R. A practical introduction to tensor networks: Matrix product states and projected entangled pair states. Annals of Physics. 2014;349:117–58.
5.
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.
6.
Page DN. Average entropy of a subsystem. Physical Review Letters. 1993;71(9):1291–4.
7.
Hastings MB. An area law for one-dimensional quantum systems. Journal of Statistical Mechanics: Theory and Experiment. 2007;2007(08):P08024.
8.
Eisert J, Cramer M, Plenio MB. Colloquium: Area laws for the entanglement entropy. Reviews of Modern Physics. 2010;82(1):277–306.
9.
Calabrese P, Cardy J. Entanglement entropy and quantum field theory. Journal of Statistical Mechanics: Theory and Experiment. 2004;2004(06):P06002.
10.
Verstraete F, Murg V, Cirac JI. Matrix product states, projected entangled pair states, and variational renormalization group methods for quantum spin systems. Advances in Physics. 2008;57(2):143–224.
11.
Vidal G. Efficient classical simulation of slightly entangled quantum computations. Physical Review Letters. 2003;91(14):147902.
12.
Tagliacozzo L, de Oliveira TR, Iblisdir S, Latorre JI. Scaling of entanglement support for matrix product states. Physical Review B. 2008;78(2):024410.
13.
Pollmann F, Mukerjee S, Turner AM, Moore JE. Theory of finite-entanglement scaling at one-dimensional quantum critical points. Physical Review Letters. 2009;102(25):255701.
14.
Eckart C, Young G. The approximation of one matrix by another of lower rank. Psychometrika. 1936;1(3):211–8.