|q⟩ Bad Qubits

intermediate · Programming · Variational Quantum Eigensolver (VQE)

Convergence and Initialization

Running a VQE loop is easy. Making it converge reliably to the ground state is harder. This lesson maps out the most common failure modes and the diagnostics used to detect them.

What convergence means in VQE

Each VQE iteration produces one number: the energy expectation value E(θ)=ψ(θ)Hψ(θ)E(\boldsymbol{\theta}) = \langle\psi(\boldsymbol{\theta})|H|\psi(\boldsymbol{\theta})\rangle. The classical optimizer updates θ\boldsymbol{\theta} to reduce EE. Convergence means the sequence E(θ(0)),E(θ(1)),E(\boldsymbol{\theta}^{(0)}), E(\boldsymbol{\theta}^{(1)}), \ldots reaches a plateau near the true ground energy E0E_0.

A run is considered converged when:

  1. The energy change between consecutive iterations falls below a threshold E(t+1)E(t)<ε|E^{(t+1)} - E^{(t)}| < \varepsilon, and
  2. That plateau is consistent across independent restarts (verifying it is a global minimum, not a local one).

The variational principle guarantees E(θ)E0E(\boldsymbol{\theta}) \geq E_0 at every step, so you always know which direction is "better" — but not whether you have reached the bottom.

Local minima

The energy landscape E(θ)E(\boldsymbol{\theta}) is a function of potentially many continuous parameters. For a pp-layer ansatz on nn qubits with standard RYRZR_Y R_Z building blocks, the parameter space has dimension O(np)O(np). This landscape is generally non-convex: gradient descent can stall in a local minimum where θE=0\nabla_{\boldsymbol{\theta}} E = 0 but E>E0E > E_0.

Barren plateaus and their effect on convergence

Recall from the previous lesson on barren plateaus: when the gradient variance satisfies

Var ⁣[Eθj]cbn\mathrm{Var}\!\left[\frac{\partial E}{\partial \theta_j}\right] \leq \frac{c}{b^n}

for constants cc and b>1b > 1, the gradient is exponentially small in the number of qubits nn. In that regime gradient-based optimizers stall immediately — the loss surface looks flat even far from the minimum. This is the most common cause of apparent premature convergence: the energy stops changing not because you found the ground state, but because the optimizer cannot read the landscape.

Diagnostics:

Initialization strategies

The starting point θ(0)\boldsymbol{\theta}^{(0)} has an outsized effect on both the quality of convergence and the risk of barren plateaus.

Random initialization

Drawing each parameter uniformly from [0,2π)[0, 2\pi) is the default and works well for shallow circuits. For deep circuits it tends to land in a barren plateau because random unitaries concentrate near the center of the unitary group.

Identity initialization (gradient-free warm start)

Set all parameters to zero, so the ansatz begins as the identity (or close to it). Near the identity the first-order landscape is often well-conditioned, and the optimizer can take meaningful steps. This is sometimes called a "near-zero initialization."

For the standard RY(θ)R_Y(\theta) building block, RY(0)=IR_Y(0) = I, so the entire circuit starts as the identity and the initial energy equals 00H00\langle 0\cdots 0|H|0\cdots 0\rangle — the expectation of HH in the all-zeros state. Starting from the identity avoids the worst barren plateau traps for shallow ansätze.

Layer-by-layer training

Optimize layer 0 of the ansatz first (fixing deeper layers to the identity), then fix layer 0 and optimize layer 1, and so on. Each sub-problem is lower-dimensional and better conditioned. This sequential strategy is sometimes called "greedy layer training."

Reading convergence plots

A convergence plot shows E(t)E^{(t)} versus iteration tt. Common patterns and their diagnoses:

| Pattern | Likely cause | |---|---| | Energy drops sharply then flattens near E0E_0 | Healthy convergence | | Energy barely moves from the start | Barren plateau or wrong ansatz | | Energy oscillates without settling | Learning rate too high; switch to a lower rate or an adaptive optimizer | | Energy converges to a value clearly above E0E_0 | Trapped in a local minimum; restart with a different θ(0)\boldsymbol{\theta}^{(0)} | | Energy decreases but very slowly | Gradient is small; try a gradient-free method or increase ansatz expressibility |

Shot noise and finite-sample effects

On a real device (and in noisy simulation), E(θ)E(\boldsymbol{\theta}) is estimated from a finite number of measurement shots. The statistical uncertainty in each energy estimate is

σEΔHNshots,\sigma_E \approx \frac{\Delta H}{\sqrt{N_{\mathrm{shots}}}},

where ΔH=H2H2\Delta H = \sqrt{\langle H^2\rangle - \langle H\rangle^2} is the standard deviation of HH in the current state. For the optimizer to detect a real gradient, you need E/θjσE|\partial E / \partial \theta_j| \gg \sigma_E, which requires

Nshots(ΔHE/θj)2.N_{\mathrm{shots}} \gg \left(\frac{\Delta H}{|\partial E / \partial \theta_j|}\right)^2.

When gradients are small (near a barren plateau) the required shot count grows quadratically, making gradient-based VQE impractical.

Putting it together: a convergence checklist

Before declaring a VQE run converged, work through the following:

  1. Check the final energy against a known bound. For small molecules or spin models, classical exact diagonalization provides the true E0E_0. The gap EVQEE0E_{\mathrm{VQE}} - E_0 is the variational error.
  2. Run multiple restarts. If the lowest energy across restarts is stable to within chemical accuracy (1.6×103\approx 1.6 \times 10^{-3} hartree), the result is trustworthy.
  3. Inspect the gradient norm. A gradient norm near zero at the final θ\boldsymbol{\theta} confirms a stationary point (local or global).
  4. Verify ansatz expressibility. If even the best restart yields EVQEE0E_{\mathrm{VQE}} \gg E_0, the ansatz may be unable to represent the ground state. Add more layers or choose a more problem-adapted circuit.
  5. Account for shot noise. Report EVQE±σEE_{\mathrm{VQE}} \pm \sigma_E where σE\sigma_E is estimated from the final shot statistics.

Convergence in VQE is never automatic — it requires understanding the optimizer, the ansatz, and the hardware noise model together. The tools in this checklist give you a principled way to move from "it stopped changing" to "it found the ground state."

Sign in on the full site to ask questions and join the discussion.