Variational Algorithms: VQE and QAOA
Variational algorithms pair a small quantum circuit that has adjustable knobs with an optimizer on a normal computer. The quantum processor makes trial states. Measurement samples give an estimate of a cost. Then the normal computer adjusts the circuit's turn angles to push that cost down. These are the algorithms run most often on today's hardware. As of 2026, none has shown a start-to-finish advantage over the best normal methods.
Why do today's algorithms need a classical partner?
The algorithms earlier in this course — Grover, phase estimation and Shor — assume a clean machine. They need long circuits run without mistakes. Real devices are noisy. Every gate (one step on the qubits, like a logic gate in a normal chip) has some chance of error. So after a few dozen steps, the computation turns into static. Variational algorithms are the practical answer. Keep the quantum circuit short. Put knobs you can turn in it. Hand the hard thinking to a normal computer.
The loop has four steps. It repeats until the answer stops improving.
- A normal-computer optimizer picks values for the knobs. The knobs are the angles of turn gates.
- The quantum processor runs the short circuit at those angles. That makes a trial state.
- The circuit runs many times (each run is a shot) and gets measured. The bitstring counts are turned into one number, the cost. It is designed so that better answers score lower.
- The optimizer looks at the cost and picks new angles.
Think of tuning an old radio. You turn the dial a little, listen to how much static there is, and turn again. The radio makes the sound. You do the steering. Where that picture breaks: you hear the radio clearly at once, but the quantum circuit only gives a noisy estimate, built from many shots.
The two famous members of this family are VQE and QAOA. VQE is the Variational Quantum Eigensolver. Its cost is the estimated energy of a molecule or material. QAOA is the Quantum Approximate Optimization Algorithm. Its cost is how good a guess is for a puzzle-like problem, such as splitting a network into two groups. Under the hood they are the same animal: the quantum side makes a trial state, and the normal side steers.
- What is an ansatz?
- Run the ansatz at θ = π/3INTERACTIVE
- Turn the knob to θ = π/2INTERACTIVE
- How does a cost function come out of samples?
- What is a barren plateau?
- Is there evidence variational algorithms beat classical ones?
- What does this look like on real hardware today?
You’ve read the opening of chapter 10. Pro unlocks the other 7 sections — plus every chapter of every course, with circuits you can run right on the page. That’s $11.99 a month, about the price of a coffee, or $99.99 a year (save 30%). The first chapter of every course, and the whole math course, stay free.