Overview
Curated: · Written: · Reviewed:
Variational Algorithms & NISQ Computing
In one line
A hybrid loop in which a shallow parameterized circuit prepares a trial state, the quantum device estimates a cost from finite shots, and a classical optimizer proposes new parameters. Reach for it when the problem is a ground-state energy or a combinatorial cost, and the device is too noisy and shallow for a deep algorithm with error correction.
Key definitions
- Ansatz: the parameterized circuit. It sets which states the loop can reach, so it bounds the answer.
- Pauli decomposition: H = Σᵢ cᵢPᵢ. The coefficient sum sets the measurement cost.
- Qubit-wise commuting group: Pauli terms that can be read from one shared measurement basis setting.
- Shot noise: the standard error on each estimate. Report it with every energy.
- Barren plateau: gradient variance that falls exponentially with qubit count for deep, unstructured ansätze.
- Error mitigation: removes bias from gate and readout error, and inflates variance in exchange.
Formulas and complexity
Shots for one energy evaluation at standard error ε, with allocation proportional to |cᵢ|. Grouping reduces the effective sum to
Parameter shift needs two circuit evaluations per parameter, so a 200-parameter ansatz costs 400 energy estimates per gradient step.
Reference figures: Σ|cᵢ| = 20 Ha at ε = 1.6 mHa (chemical accuracy) gives about 1.6 × 10⁸ shots per evaluation. A 10× tighter target costs 100× more shots.
How it works
Parameters θ go to the device. The device prepares the ansatz state and measures each commuting group. The estimates are combined into ⟨H⟩ with a standard error. The optimizer uses that noisy value to pick the next θ, and the loop repeats until the stopping rule fires.
The optimizer sees a noisy, finite-shot function, not an exact landscape. Convergence of the optimizer is not evidence of a global or physical optimum.
When to use and when not to
| Situation | Use the variational loop? |
|---|---|
| Small instance, classical simulation fits | No: simulate it exactly, and use it for debugging |
| Deep circuit needed to reach the answer | No: coherence limits the depth (T₂ near 100 µs, two-qubit gates near 100 ns) |
| Gradient variance collapses with qubit count | No, at that size: the run is unbudgetable |
| Shot budget closes at the target error | Yes, if the budget and wall time are reported |
| A classical method solves it faster and exactly | No |
| Ground-state energy with a need for an upper bound | Yes: the variational principle gives one |
Traps interviewers probe
- Point estimate with no error bar. Fix: report the standard error and the shot count with every energy.
- Sign or qubit-ordering mismatch between Hamiltonian and ansatz. Fix: check that the reference state and Hamiltonian use the same encoding, for example Jordan–Wigner, and compare small cases to exact diagonalization.
- Dropping terms from the cost. Measuring only the diagonal terms and calling the result ⟨H⟩ gives a wrong energy. Fix: measure every term that contributes, including the X and Y terms. The identity offset is free to add back, not to drop.
- Blaming the optimizer for a flat landscape. Fix: sample gradient variance at random parameters for several qubit counts before choosing an optimizer or a deeper circuit.
- Claiming advantage against a weak baseline. Fix: compare against a tuned classical method on the same instances and the same wall-clock budget, not against Hartree–Fock or random assignment.
Interview tips
Opening: the loop exists because deep circuits decohere before they finish. Shallow circuits are parameterized, and a classical search does the rest.
Expected follow-ups:
- Why not simulate it? For small sizes, you should. The loop only pays off where statevector simulation becomes exponential.
- Which cost dominates runtime? Usually shot budget and queue latency, not gate count.
- How would you cut the shot budget? Measurement grouping, coefficient-weighted allocation, a shallower ansatz. Each has a stated cost.
- Why does the variational bound hold, and when is it loose? Expectation is at least the ground energy for any state. It is loose when the ansatz cannot reach the ground state.
30-second outline: Name the split: quantum device estimates a cost from shots, classical optimizer updates θ. Give the shot arithmetic for the target error. State the trap you are guarding against, such as a sign mismatch or an unmeasured baseline. Close with what you would report: energy, standard error, shots, wall time, and the classical comparison.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.