What are variational quantum algorithms?
The hybrid loop that tunes a short quantum circuit with a classical optimiser, and why it was designed for noisy machines.
7 min read · reviewed December 2026
The loop
A variational algorithm splits the work between two machines. A quantum computer runs a short circuit whose gates have adjustable angles, and reports a number: the value of a cost function. A classical computer looks at that number, chooses better angles, and sends them back. This repeats until the cost stops improving.
- Prepare a state with a circuit that depends on parameters θ.
- Measure the cost, for example an energy or an expected cut value.
- Let a classical optimiser propose new parameters.
- Repeat until the cost converges.
Why this design
Circuits that are short need only a short coherence time. The heavy, repetitive search is handed to a classical optimiser, which is cheap and reliable. This is why variational methods are the standard example of algorithms for noisy, intermediate-scale machines, a term introduced in Preskill’s 2018 paper.
The two examples in this lab
- QAOA looks for a good answer to a combinatorial problem, here MaxCut.
- VQE looks for the lowest-energy state of a Hamiltonian, here two small spin chains.
What the lab does and does not show
Everything here is an exact statevector simulation of at most six qubits, with no hardware noise. It shows how the method behaves. It does not show that the method is faster than a classical computer, and the last guide explains why that question is still open.
Try it
Questions
Why is the optimiser classical?
Choosing new parameters is ordinary numerical optimisation, which classical computers do well. The quantum computer is used only for the part that is hard to simulate: evaluating the cost.
Does the loop always converge to the best answer?
No. It can stop at a local minimum or a flat region, and the circuit may be unable to represent the best answer at all.
Is this the same as machine learning?
It shares the idea of tuning parameters against a cost function, but the model is a quantum circuit and the cost comes from measurements.
Read next
Sources and further reading
- E. Farhi, J. Goldstone and S. Gutmann, “A Quantum Approximate Optimization Algorithm” (2014)
- A. Peruzzo et al., “A variational eigenvalue solver on a photonic quantum processor” (2014)
- A. Kandala et al., “Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets” (2017)
- J. McClean et al., “Barren plateaus in quantum neural network training landscapes” (2018)
- J. Preskill, “Quantum computing in the NISQ era and beyond” (2018)
- K. Mitarai et al. (2018) and M. Schuld et al. (2019) on analytic gradients of quantum circuits
Check the original sources for exact citations.