“Know how to solve every problem that has been solved.” “What I cannot create, I do not understand.” — Richard Feynman

DMRG and Matrix Product States

Tensor Networks

What you need to know first 24 concepts, 6 layers

The requisite-knowledge inventory for this page, bottom-up: the primitives at the base, combined upward until you reach what this page assumes. Skim the layers you already own; start wherever the ground gets unfamiliar.

  1. base
  2. L1
  3. L2
  4. L3
  5. L4
  6. L5
  7. you are here

10 of these are concepts without a dedicated page yet — the grey chips. Following the linked ones first makes the rest land.

Full configuration interaction stores every amplitude of an -particle wavefunction and runs straight into a wall: numbers, doubling with every site. DMRG is how you climb the wall instead of hitting it — by noticing that the ground states you actually care about are barely entangled, and compressing the wavefunction into a chain of small matrices. The same Lanczos you already use sits at its heart. Five ways in; read the one that lands.

read it as

A quantum state on sites with states each lives in a space of dimension . Full configuration interaction (FCI) stores all amplitudes and diagonalizes in that space — exact, and exponentially doomed. At , fifty spins is amplitudes: a petabyte for one vector.

But you rarely need all of it. The ground state of a local Hamiltonian is one very particular vector in that enormous space, and it has far less structure than its length suggests. DMRG is the bet that you can throw away almost every amplitude and keep the answer — if you compress along the right seams.

Watch the wall fall, on real numbers

This is the payoff, computed by exact diagonalization of a 12-site transverse-field Ising chain (so we have the true answer to compare to) and then asking: how well does the best bond- matrix product state reproduce the ground-state energy? Switch phases and drag . The error falls off a cliff — and the entanglement profile on the right tells you, in advance, how steep that cliff will be.

entanglement across each cut (bits)
The critical arch — entanglement peaks mid-chain and grows with length. The hard case.

At χ = 4, the chain keeps the top 4 of 64 Schmidt states per bond. Ground-state energy error 2.7e-5 · discarded weight at the middle cut 1.6e-6.

Read the gap between the curves. The disordered chain is gapped, its entanglement flat and tiny, and already buys six digits. The critical chain wears the arch, and the same leaves you three digits short — the area law's failure mode, made visible. This is why DMRG is a 1D method first: it is exactly as good as the area law is true.

The whole thing, in code you can run

Build the Hamiltonian and get the exact ground state with the Lanczos solver you already know. is fine at ; the point is to have ground truth to truncate against.

import numpy as np, scipy.sparse as sp
from scipy.sparse.linalg import eigsh

# Transverse-field Ising chain (open):  H = -J Σ Z_i Z_{i+1} - h Σ X_i
X = sp.csr_matrix([[0., 1.], [1., 0.]]); Z = sp.csr_matrix([[1., 0.], [0., -1.]])
def op_at(o, i, N):                      # o acting on site i, identity elsewhere
    m = sp.identity(1)
    for k in range(N): m = sp.kron(m, o if k == i else sp.identity(2))
    return m

def tfim(N, h, J=1.0):
    H = sp.csr_matrix((2**N, 2**N))
    for i in range(N-1): H -= J * op_at(Z, i, N) @ op_at(Z, i+1, N)
    for i in range(N):   H -= h * op_at(X, i, N)
    return H

N = 12
E0, psi = eigsh(tfim(N, h=1.0), k=1, which='SA')   # Lanczos — the same solver
E0, psi = float(E0[0]), psi[:, 0]                  # DMRG calls on each sweep

Now measure the entanglement across every cut, and build the best bond- MPS by the sweep-of-SVDs from framing 3 — then contract it back and re-measure the energy. No DMRG sweep yet; this is the target DMRG climbs toward variationally.

def entanglement(psi, N):                # von Neumann entropy across each cut
    out = []
    for c in range(1, N):
        s = np.linalg.svd(psi.reshape(2**c, 2**(N-c)), compute_uv=False)
        p = s**2; p = p[p > 1e-16]
        out.append(float(-(p*np.log2(p)).sum()))
    return out

def best_mps_energy(psi, N, chi, H):     # truncate to bond dimension chi, re-measure
    state, chiL, A = psi.reshape(1, -1), 1, []
    for i in range(N):                                   # sweep left to right
        U, s, Vh = np.linalg.svd(state.reshape(chiL*2, -1), full_matrices=False)
        k = min(chi, len(s))                             # keep the top chi
        A.append(U[:, :k].reshape(chiL, 2, k)); state = s[:k, None]*Vh[:k]; chiL = k
    v = A[0]                                             # contract the train back
    for t in A[1:]: v = np.tensordot(v, t, ([-1], [0]))
    v = v.reshape(-1) * state.reshape(-1)[0]
    return (v @ (H @ v)) / (v @ v)

Run it across the three phases and the area law turns into a table. Every number is reproduced by the demo above; the validation row is the part that earns your trust in the rest.

# Energy error |E(chi) - E_exact|, transverse-field Ising chain, N = 12
phase        E_exact     S_mid     chi=1     chi=4     chi=8     chi=16
disordered  -25.39350   0.13 bit  1.4e+00   1.1e-06   3.3e-13   ~0   (gapped: trivial)
critical    -14.92597   0.57 bit  2.9e+00   2.9e-03   8.2e-09   5e-15 (the hard one)
ordered     -11.89205   1.00 bit  5.9e+00   5.4e-05   2.0e-10   6e-14 (cat state)
# validated:  h=0 -> -(N-1),  h->inf -> -hN,  eigsh == dense eigh to 1e-10

Where this goes

What is here is the statics — why an MPS exists and how truncation works. The natural continuation is a series, each step a real algorithm: the Hamiltonian as a matrix product operator; the left/right environment tensors that make the local eigenproblem cheap; the actual two-site DMRG sweep with Lanczos and adaptive bond growth; then TEBD and time evolution, and the leap to 2D with PEPS where the area law — and this whole story — starts to fight back. It also closes a loop on this site: DMRG is the variational answer to the same correlation problem that FCI solves by brute force and that the nuclear shell model meets from the second-quantized side.