---
title: "DMRG Ground State Sweeps Interactive Lab | Sandbox Physics"
description: "How does DMRG find a ground state, and how do you know it has?"
canonical_url: "https://sandboxphysics.com/labs/dmrg-ground-state-sweeps/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/dmrg-ground-state-sweeps/"
last_modified: "2026-10-30"
---

FR30-C · Sweep a window, lower the energy

# DMRG Ground State Sweeps

**How does DMRG find a ground state, and how do you know it has?** DMRG sweeps a small window along the chain and replaces two sites at a time with the lowest-energy choice the rest of the chain allows, so the energy falls sweep by sweep. Convergence is checked with the energy variance, the discarded weight and, where one exists, an exact energy. A tiny variance can still belong to a symmetry-broken state.

Watch a two-site window sweep along a spin chain and lower the energy at every step. Compare the energy with an exact value, and see why a small energy variance alone does not prove you found the ground state.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model assumptions

Two-site DMRG optimizes a real matrix product state against a matrix product operator, with a few Lanczos steps per local update and a bond-dimension ramp over the first sweeps. Ising energies are compared with the exact free-fermion ground energy. Heisenberg energies for eight to sixteen sites are compared with stored SciPy exact-diagonalization values. The variance is computed with the squared Hamiltonian as a matrix product operator. The dashed entropy curve is the conformal chord law with the central charge fixed and only its constant fitted.

Energy error and variance per sweep

Energy at every local update

Entanglement along the chain

Numerical diagnostics and record

$\text{sweep }0$

Energies, variances and parity are computed from the final matrix product state of each sweep. The record saves every local update and every sweep.

[Continue the course: tensor networks for quantum many-body physics](https://sandboxphysics.com/stories/tensor-networks/)

Physics tutorial

## DMRG Ground State Sweeps

**Background** Ground states of gapped one-dimensional chains obey an area law: the entanglement across a cut stays bounded as the chain grows. Matrix product states with a modest bond dimension can therefore represent them well.

**Why it matters** DMRG searches among matrix product states for the lowest energy. Instead of optimizing every tensor at once, it improves two neighbouring sites at a time and sweeps back and forth.

Start with the essentials

- **Focus question**: How does DMRG find a ground state, and how do you know it has?
- **One-sentence intuition**: Every local update can only lower the variational energy. Whether the result is the ground state needs separate evidence: the energy variance, the discarded weight, symmetry checks and, where possible, an exact energy.

### Core mathematical model

#### The local eigenvalue problem

$$
H_{\rm eff}^{[j,j+1]}\,\Theta=E\,\Theta,\qquad \Theta\approx U\,\mathrm{diag}(s)\,V^{\dagger}
$$

With the rest of the chain fixed, the energy of the two-site block is a small eigenvalue problem. A few Lanczos steps solve it, and a truncated singular value decomposition splits the block back into two tensors.

#### Variance as a convergence test

$$
\sigma_E^2=\langle H^2\rangle-\langle H\rangle^2\ge0
$$

An exact eigenstate has zero variance. A small variance means the state is close to some eigenstate, or to a mixture of nearly degenerate ones; it does not say which.

#### Entanglement of a critical chain

$$
S(\ell)=\frac{c}{6}\ln\!\Big[\frac{L}{\pi}\sin\frac{\pi\ell}{L}\Big]+s_0
$$

For an open critical chain, conformal field theory predicts this profile, with central charge one half for the Ising chain and one for the Heisenberg chain. Only the constant is fitted; small chains also show oscillations.

### Common difficulties

#### Low variance is not proof

**Typical misconception** When the variance is tiny, DMRG has found the ground state.

**Better mental model** Nearly degenerate states, such as the two ordered states of a ferromagnet, mix with tiny variance. Check symmetries, compare different starting states and use an exact energy whenever one exists.

### Run the experiment

1. 01

   #### Follow a sweep

   Let Critical Ising chain run. Follow the gold two-site window and the entanglement bars it leaves behind.

   **What to observe:** The energy error drops by orders of magnitude over the first sweeps, while the bars settle into an arch that is highest at the centre.

2. 02

   #### Shrink the bond dimension

   Choose Bond dimension too small, or drag the gold ceiling down.

   **What to observe:** The energy stalls well above the exact value, and both the variance and the discarded weight stay large. All three signals agree.

3. 03

   #### A converged but wrong answer

   Choose Ordered phase: low variance, wrong state and compare the variance with the energy error.

   **What to observe:** The variance is tiny, yet the energy sits above the exact ground energy. DMRG has settled into a symmetry-broken state; the parity check in the diagnostics shows it.

Physical conclusion

Trust a DMRG energy only when several independent convergence checks agree.

## Related experiments and articles

Tensor networks · Reading path

### Tensor networks and DMRG, from entanglement to quantum quenches

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Why a chain of spins outgrows any computer, and why its ground state does not**](https://sandboxphysics.com/stories/tensor-networks/many-spins-many-amplitudes/)
2. [Lab **Matrix Product State Compression** Cut the bonds of a spin chain and watch the error](https://sandboxphysics.com/labs/entanglement-compression/)
3. [Article **Measure entanglement with one matrix decomposition**](https://sandboxphysics.com/stories/tensor-networks/schmidt-decomposition/)
4. [Article **Find a ground state by sweeping, and decide whether to believe it**](https://sandboxphysics.com/stories/tensor-networks/dmrg-variational-sweeps/)

Quantum & fields · Starter path

## Start from a single measurement

Predict an outcome, then count what the measurements actually give. The path starts with one qubit and moves on to wave packets, bound states and two-photon interference.

[Start here → **Quantum State & Born Measurement** Predict a probability, turn the analyzer, then compare your prediction with the measured frequency over many shots. Observe · 15 min](https://sandboxphysics.com/labs/qubit-state/)

1. [1 Quantum State & Born Measurement](https://sandboxphysics.com/labs/qubit-state/)
2. [2 Stern–Gerlach Sequence](https://sandboxphysics.com/labs/stern-gerlach-sequence/)
3. [3 Wave Packet & Uncertainty](https://sandboxphysics.com/labs/wave-packet-uncertainty/)
4. [4 Quantum Harmonic Oscillator](https://sandboxphysics.com/labs/quantum-harmonic-oscillator/)
5. [5 Which Path & Quantum Eraser](https://sandboxphysics.com/labs/quantum-eraser/)
6. [6 Hong–Ou–Mandel Two-Photon Interference](https://sandboxphysics.com/labs/hong-ou-mandel/)

[View the full path →](https://sandboxphysics.com/topics/quantum/#starter-path)
