These problems practise building MPOs by hand, counting the cost of DMRG, and reading convergence diagnostics; the last two go with the hands-on gaps in the notebooks.
Problem 4.1 (Warm-up: small MPOs).
Multiply out for the TFIM MPO of Module 4, eq. (4.2), at , and check that you get .
Give an MPO with for the identity and for , and one with for .
What is the largest MPO bond dimension you need for if has bond dimension ? Why might the true minimal bond dimension of be smaller?
Solution
and . The row times the column is .
The identity is the product of single-site identities, so with bonds. Likewise for . For use the two-state machine (finished, ready): , with and .
Multiplying the operator-valued matrices entry by entry, (operator product on the physical leg), gives bond dimension , so for the TFIM. This is not minimal. The product machine has pairs of states with the same future: (finished, ready) and (ready, finished) both mean “one copy of is done, the other has not started”, and from either one the machine can emit exactly the same operators. The same holds for (finished, open) and (open, finished). Merging such states, or compressing the MPO by SVDs of its tensors, lowers the bond dimension. For the TFIM the minimum is . Across a cut in the bulk write , with , the two spins next to the cut (operator Schmidt rank 3). Squaring and using gives
five terms whose left factors are linearly independent, and likewise on the right. So the operator Schmidt rank of is , and no MPO for can have a smaller bond there.
Problem 4.2 (Exponentially decaying interactions).
Consider with , a model with couplings between all pairs.
Show that it still has an MPO with , and write the bulk tensor .
Prove your answer by the same induction as in Proposition 4.1 of the notes.
How would you handle ? What does this suggest for a power-law coupling ?
Solution
Keep the states (finished, open, ready). The only change is that the open state may persist, picking up a factor for every site it crosses:
Let the row after sites be . Then 𝟙 as before, and
𝟙
by induction (the new term opens at site with weight , and every older open term gains one factor ). The finished entry is 𝟙. The middle term adds , which are exactly all couplings that end at site , with weight for . So .
3. Each exponential needs its own open state with its own factor on the diagonal: for two exponentials, with and opening the two states, diagonal entries 𝟙, 𝟙, and closing entries , (this places the weight ). A power law is not a finite sum of exponentials, but it can be approximated by one to high accuracy over the distances with a modest number of terms. That gives an MPO with . This is how long-range models are put into DMRG in practice.
Problem 4.3 (Contraction order and cost).
Write out the one-site matvec of eq. (4.5) as a sequence of three pairwise contractions and show that it costs .
Show that contracting with first (they share no index) creates an object with entries. How much memory is that for , , in double precision?
Repeat part 1 for the two-site matvec and compare with the SVD of . Which dominates for , ?
Solution
(a) summed over : indices , cost , result . (b) with summed over : indices , cost , result . (c) with summed over : indices , cost . The total is .
The outer product has entries. For , that is numbers, or TB. The good order never stores more than numbers (, or MB).
With : costs ; adding costs (indices ); adding costs the same; adding costs . So the matvec is . The SVD of the matrix costs . For , the leading terms are per matvec (the and the contraction) versus for the SVD, but there are tens of matvecs per Lanczos solve and only one SVD, so the eigensolver dominates.
Problem 4.4 (What the variance tells you).
For the critical TFIM () at the notes report, for two-site DMRG, and at , and and at .
In the free-fermion solution, the lowest excitation energy is the smallest singular value of the matrix . Show that for and large , . (Numerically, at .)
Use Lemma 4.1 of the notes to bound the infidelity at and .
Suppose instead that . Compute and in terms of and the gap . Show that the energy error is quadratic in the distance , while is linear in it.
Solution
The are the eigenvalues of , which is tridiagonal with off the diagonal and on the diagonal, except the first entry, which is (for ). Try a standing wave . In the bulk it gives the eigenvalue . The two ends fix and , and the result is , , so . (At this formula matches the numerical singular values to ; the Module 4 figure script prints the check.) The smallest is : at , against .
With we have . At : . At : . The bound for is weak: up to 5% of the weight could sit outside the ground state.
, so . The variance is . The distance is for small . So is quadratic in the state error, while is linear in it. Here the bound of part 2 is tight: . A state error of thus gives an energy error of order . This is why energies converge long before wave functions, and why a good energy alone says little about other observables.
Problem 4.5 (One-site DMRG from a product state).
Show that one-site DMRG started from an MPS with all bond dimensions 1 stays at bond dimension 1, and so returns at best the optimal product state.
For the TFIM with a uniform product state , , show that . Minimize it and evaluate at , . Compare with .
Two-site DMRG from the same start reached bond dimension 2, 4, 8, 16 in its first four half-sweeps (Figure 4.9 in the notes). Explain why the largest bond can at most double per half-sweep.
Solution
The update at site replaces by an eigenvector of , which acts on the space of shape , so the shape does not change. The QR step with of shape also keeps (for , is a column). So all bonds stay 1 and the state stays a product state. The sweep then optimizes each single-site state in the mean field of its neighbours.
and . A product state factorizes every expectation value, giving . Write : , minimized at when this is at most 1. Then . At , : and , or per site. That is above . Letting each site choose its own angle helps a little: the end spins have only one neighbour and tilt further towards (), and the optimum is . No product state comes close to the entangled ground state.
At bond the new bond dimension is the rank of , viewed as a matrix, so at most . In a left-to-right half-sweep, is already the new value but is still the old one. So every new bond is at most times the old bond to its right, and with the largest bond at most doubles. (At the edges the bound also applies.)
Problem 4.6 (Hands-on 4.1 to 4.8: MPOs, environments and the sweeps).
Do the hands-on gaps of the Module 4 notebook in either language (Julia or Python): Hands-on 4.1 (xxz_fsm, the XXZ MPO), 4.2 (grow_left / grow_right), 4.3 (apply_Heff), 4.4 (the one-site sweep dmrg), 4.5 (two_site_update, the core of dmrg2), 4.6 (grow_left2, for ), 4.7 (expval_ops) and 4.8 (nnn_fsm, the next-nearest-neighbour MPO of Example 4.1 in the notes). Then:
Verify that the TFIM MPO of the notebook (tfim_fsm with mpo_from_fsm) for , contracted to a dense matrix, has lowest eigenvalue at , and that your XXZ MPO from Hands-on 4.1 matches dense_xxz in the same way.
Run dmrg2 at with and reproduce the table in the worked example (energy error, discarded weight, variance) to two significant digits.
Run one-site dmrg from a random MPS with and from a product state. Report both energies and explain the difference using the previous problem.
Solution
Contract the MPO tensors over their bonds, fuse the outputs and the inputs into indices, and diagonalize. Agreement to about with dense ED (and with the free-fermion value) checks the signs and the leg order. A common bug is swapping the bra and ket legs; for the TFIM this is harmless because and are symmetric, but it shows up as soon as (XXZ) enters.
Expected: , , for , and below (round-off) for , with from the free-fermion formula. The discarded weights and the shifted variances should match the table to the first digit; the naive is useless at (it can even be negative). Small differences in the last digit at can come from a different random start or local minimum; the numbers are fixed by the variational optimum.
From a random MPS, our numpy one-site DMRG reaches (two seeds, 12 sweeps each), slightly below the two-site value of : at a fixed bond dimension there is no truncation. From a product state it stays at bond dimension 1. The best it could reach is the optimal product state, (previous problem), but it typically stalls above that, in a configuration with domain walls. From two random product states our code was at and after 40 sweeps. Both failures have the same cause: one-site updates rotate within fixed bond spaces, so they cannot create entanglement or remove a domain wall that costs a coordinated change of many spins.