Case Study: Diagnosing a VQE That Won't Converge

Executive Summary

A VQE run on a 10-qubit system plateaus at −7.42 Ha against a known exact value of −7.88 Ha. The optimizer reports convergence. The gap is 460 mHa — nearly 300× chemical accuracy.

There are at least six distinct reasons a VQE can fail, they require completely different fixes, and the symptom looks identical for all of them. This case study is the differential diagnosis: a sequence of cheap experiments that isolates the cause before any expensive remedy is attempted.

Skills applied

  • Separating ansatz expressiveness from optimizer failure (§19.12).
  • Detecting barren plateaus by gradient-variance scaling (§19.13).
  • Identifying noise-induced bias via the variational bound.
  • Diagnosing local minima and measurement noise.

The six candidate causes

# Cause Fix
1 Ansatz cannot represent the ground state More expressive ansatz
2 Barren plateau — gradients vanish Shallower ansatz, local cost, better init
3 Local minimum Multi-start, better initialization
4 Optimizer misconfigured Tune, or change optimizer
5 Shot noise swamping the gradient More shots per evaluation
6 Hardware noise biasing the energy Error mitigation, shorter circuits

Test 1: Is the ansatz capable? (separates #1 from everything else)

Run the identical VQE on a noiseless simulator with exact expectation values — no shots, no noise.

from qiskit.primitives import StatevectorEstimator
estimator = StatevectorEstimator()      # exact, no sampling
result = minimize(cost_fn, x0, method='L-BFGS-B')
Outcome Diagnosis
Converges to −7.88 Ansatz is fine → cause is 2–6
Plateaus at −7.42 Ansatz cannot represent the state → cause #1
Plateaus at −7.85 Ansatz is slightly deficient; expect a floor

Result here: converges to −7.87. The ansatz is capable. Causes #1 is eliminated, and this single test — which costs no hardware time — has removed the most expensive possible remedy from consideration.

Always run this test first. Replacing an ansatz is the costliest fix and is frequently attempted before anyone has checked whether the ansatz is the problem.

Test 2: Barren plateau? (isolates #2)

Sample the gradient at random parameter points and measure its variance as a function of qubit count.

import numpy as np
grads = [gradient(cost_fn, np.random.uniform(0, 2*np.pi, n_params))
         for _ in range(200)]
print(f"Var[grad] = {np.var(grads):.3e}")

Repeat for $n = 4, 6, 8, 10$ qubits with the same ansatz family:

$n$ Var[∂E/∂θ]
4 $2.1\times10^{-2}$
6 $5.4\times10^{-3}$
8 $1.3\times10^{-3}$
10 $3.2\times10^{-4}$

Variance falls by ~4× per two qubits — i.e. $O(2^{-n})$. That is a barren plateau signature.

But note Test 1 converged. The plateau is real yet not fatal here, because the optimizer was warm-started near a good region rather than initialized randomly. This is worth understanding precisely: barren plateaus make random initialization hopeless while leaving informed initialization viable. The distinction determines the fix.

Test 3: Local minimum? (isolates #3)

Run the noiseless optimization from 20 random starting points.

Final energy Count
−7.87 6
−7.61 5
−7.42 7
−7.20 2

The landscape has multiple minima, and −7.42 is one of them. This is a genuine contributor: the hardware run is landing in a local minimum that the noiseless run also reaches 35% of the time.

Fix: warm-start from Hartree–Fock or a classical CCSD amplitude set, which places the optimizer in the basin of the true minimum. In this system, HF initialization reaches −7.87 in 19 of 20 runs.

Test 4: Shot noise versus gradient (isolates #5)

Compare the gradient magnitude against its shot-noise uncertainty:

$$\text{SNR} = \frac{|\partial E/\partial\theta|}{\sigma_{\text{shot}}}, \qquad \sigma_{\text{shot}} \approx \frac{\sum_k|c_k|}{\sqrt{N_{\text{shots}}}}$$

With $\sum|c_k| = 14$ Ha, 1,024 shots gives $\sigma \approx 0.44$ Ha. Typical gradient magnitude near the minimum: 0.02 Ha.

$$\text{SNR} = \frac{0.02}{0.44} = 0.045$$

The optimizer is following noise, not gradient. It needs $(1/0.045)^2 \approx 500\times$ more shots for SNR ≈ 1 — around 500,000 shots per evaluation.

This is the single most common VQE misconfiguration. Default shot counts in tutorials (1,024) are appropriate for demonstrating the code path and are orders of magnitude too small for optimization on a real Hamiltonian.

Test 5: Noise bias (isolates #6)

Run on hardware at the converged parameters and compare against the noiseless simulator at the same parameters.

Evaluation Energy
Noiseless, converged params −7.87
Hardware, same params −7.51
Hardware, ZNE-mitigated −7.79

A 360 mHa hardware bias at fixed parameters, of which mitigation recovers ~78%. Note the bias is upward here; had it been downward past −7.88 it would have violated the variational bound, which is the unmistakable signature of uncorrected systematic error.

The diagnosis

Three simultaneous causes, in order of contribution:

  1. Shot noise (#5) — the dominant problem. 1,024 shots gives gradient SNR of 0.045; the optimizer was performing a random walk.
  2. Local minimum (#3) — random initialization lands in the −7.42 basin 35% of the time even noiselessly.
  3. Hardware noise (#6) — 360 mHa upward bias, mostly recoverable by mitigation.

Combined fix: warm-start from Hartree–Fock, raise to 200,000 shots per evaluation, apply ZNE. Result: −7.84 Ha, within 40 mHa of exact — still short of chemical accuracy, but a tractable remaining gap rather than a mysterious failure.

Discussion Questions

  1. Test 1 costs no hardware time and eliminates the most expensive fix. Why is it so often skipped?
  2. A barren plateau was present but not fatal because of warm-starting. Explain precisely why initialization interacts with plateaus.
  3. Gradient SNR of 0.045 means the optimizer follows noise. Why does the optimizer still report convergence?
  4. A VQE energy below the exact value proves systematic error. Why is this such a valuable check, and what is its limitation?

Your Turn: Extensions

  • Run the six-test protocol on an H₂ VQE with deliberately induced failures.
  • Measure gradient variance against qubit count for hardware-efficient and UCCSD ansätze; compare plateau severity.
  • Compute the shot count for gradient SNR ≈ 3 on a Hamiltonian you build.
  • Implement Hartree–Fock warm-starting and measure the change in local-minimum trapping rate.

Key Takeaways

  • Six distinct failure modes produce the same symptom; diagnose before fixing, cheapest test first.
  • The noiseless-simulator test isolates ansatz expressiveness at zero hardware cost and should always come first.
  • Barren plateaus are detected by gradient variance scaling as $O(2^{-n})$; warm-starting can make a plateau survivable.
  • Gradient SNR below 1 means the optimizer is following shot noise — the most common misconfiguration, and tutorial shot counts are far too low.
  • An energy below the exact ground state proves uncorrected systematic error; the variational bound is one of the few self-checks VQE provides.