A variational quantum algorithm (VQA) is a hybrid quantum-classical method in which a parameterized quantum circuit prepares a trial state, a quantum processor estimates a cost function from repeated measurements, and a classical optimizer updates the circuit parameters until the cost reaches a minimum. Among quantum algorithms in quantum computing, VQAs are the leading family designed for noisy intermediate-scale quantum (NISQ) devices, because they keep circuits shallow and push most of the computational loop onto conventional computers.
The variational quantum eigensolver and QAOA are the best-known members of the family, but the same template also covers quantum machine learning models, variational simulation of time evolution and linear-system solvers. What unites them is the variational principle: the answer is encoded as the optimum of a function that the quantum device can evaluate but cannot easily optimize on its own.
How the hybrid optimization loop works
A variational quantum algorithm runs as an iterative feedback loop between two machines. The quantum processor executes a circuit U(θ) that depends on a vector of real parameters θ, usually rotation angles of single-qubit gates, and measures observables many times. The classical computer turns those measurement statistics into a cost value and proposes new parameters.
The cost is typically the expectation value of a Hamiltonian or another observable, written as a weighted sum of Pauli strings. Each string requires its own measurement setting, so a single cost evaluation can involve thousands to millions of shots. Gradients can be estimated on hardware with the parameter-shift rule, which evaluates the circuit at two shifted parameter values per gate angle.
The table below lists the components that every VQA contains and the role each one plays in the loop.
| Component | Runs on | Role in the loop |
|---|---|---|
| Ansatz circuit | Quantum processor | Prepares a parameterized trial state |
| Cost function | Both | Maps measurement results to a scalar to minimize |
| Measurement strategy | Quantum processor | Groups Pauli terms and allocates shots |
| Classical optimizer | Classical computer | Proposes new parameters from cost values |
| Initialization scheme | Classical computer | Chooses starting parameters to avoid flat regions |
Ansatz design and parameter choices
The ansatz is the circuit template that defines which quantum states the algorithm can reach, and its choice largely determines success. A good ansatz is expressive enough to contain the solution, shallow enough to survive hardware noise and structured enough to remain trainable. These goals pull in opposite directions, which is the central design trade-off of the field.
Ansatz families fall into two broad groups. Problem-inspired ansätze encode physics or problem structure, while hardware-efficient ansätze follow the native gate set and connectivity of a specific device. The comparison below summarizes common choices.
| Ansatz family | Typical use | Strength | Weakness |
|---|---|---|---|
| Unitary coupled cluster | Quantum chemistry | Physically motivated, preserves symmetries | Deep circuits on real hardware |
| Hardware-efficient | General NISQ experiments | Short depth, native gates | Prone to barren plateaus |
| QAOA layers | Combinatorial optimization | Few parameters, clear structure | May need many layers for quality |
| Adaptive (ADAPT-style) | Chemistry and materials | Grows only the needed operators | Many extra measurement rounds |
| Hamiltonian variational | Lattice and spin models | Mirrors the target Hamiltonian | Limited to suitable models |
Parameter counts range from a handful in shallow QAOA to several hundred in chemistry ansätze. More parameters increase expressibility but also enlarge the optimization landscape and the number of circuit evaluations per iteration.
Main variants of the variational approach
Variational quantum algorithms differ mainly in what the cost function encodes. The same loop can search for ground states, approximate optimization solutions, fit data or approximate dynamics, depending on the observable and the training objective.
| Algorithm | Cost function | Target problem |
|---|---|---|
| Variational quantum eigensolver | Energy expectation of a Hamiltonian | Molecular and material ground states |
| QAOA | Expected value of a classical objective | Max-Cut and other combinatorial tasks |
| Variational quantum classifier | Classification loss on labeled data | Supervised machine learning |
| Variational quantum deflation | Energy plus overlap penalty | Excited states |
| Variational linear solver | Residual of a linear system | Approximate solutions to Ax = b |
| Variational time evolution | Distance from exact dynamics | Short-time quantum simulation |
Comparison with fault-tolerant quantum algorithms
Variational methods trade provable guarantees for hardware feasibility. Algorithms such as quantum phase estimation, Shor’s algorithm or the HHL algorithm offer rigorous speedups but need deep, error-corrected circuits. VQAs instead accept heuristic performance in exchange for circuits that fit within present coherence times.
The following table contrasts the two paradigms on the properties that matter when choosing an approach.
| Property | Variational algorithms | Fault-tolerant algorithms |
|---|---|---|
| Circuit depth | Shallow, repeated many times | Deep, run once or few times |
| Error handling | Noise tolerance and error mitigation | Full quantum error correction |
| Performance guarantee | Heuristic, problem dependent | Provable asymptotic speedup |
| Classical overhead | High, from optimization and shots | Lower per useful result |
| Hardware era | NISQ processors | Future logical-qubit machines |
In practice the boundary is softening. Researchers study early fault-tolerant variants that combine variational state preparation with phase estimation, using the variational stage to supply a good initial state with high overlap.
Limitations and common pitfalls
The most serious obstacle is the barren plateau phenomenon, in which gradients vanish exponentially with the number of qubits for broad classes of random or highly expressive circuits. Noise itself can induce plateaus, so deeper circuits on imperfect hardware become harder to train even when the ansatz is well chosen.
- Measurement cost grows quickly because each Pauli term needs sampling, and shot noise limits the precision of every gradient.
- Local minima and narrow gorges in the landscape can trap gradient-based optimizers far from the true optimum.
- Classical simulability is a real concern, since circuits that avoid barren plateaus are sometimes efficiently simulable on classical computers.
- No demonstrated advantage exists yet for an industrially relevant problem, so claims of speedup require careful classical benchmarking.
- Hardware drift between iterations can change the cost landscape during a long optimization run.
Mitigation strategies include problem-informed initialization, layer-by-layer training, local rather than global cost functions and error mitigation techniques such as zero-noise extrapolation. None removes the limits entirely, which is why VQA results should always be reported with classical baselines and resource counts.
In plain words
A variational quantum algorithm works like tuning an old radio with many knobs. The quantum computer listens to the signal and reports how clear it sounds. An ordinary computer then decides which knobs to turn and by how much. The two repeat this exchange until the reception is as clear as possible.
The knobs are settings inside a short quantum program, and the clarity score is a number that describes how good the current answer is. The key idea is teamwork between a small quantum machine and a classical computer: the quantum part does what only it can do, and the classical part does the patient searching.
A real-world example
A computational chemistry group wants the ground-state energy of lithium hydride to compare bond lengths. They map the molecule onto 12 qubits, reduce it to 6 active qubits with symmetry tapering and choose a compact chemistry-inspired ansatz with about 20 parameters. Each energy estimate groups roughly a hundred Pauli terms into a few dozen measurement settings, with several thousand shots per setting.
A gradient-free optimizer runs for about 150 iterations on a cloud superconducting processor, with zero-noise extrapolation applied to every energy. The final curve reproduces the equilibrium bond length to within a few percent, and the error at the minimum stays close to chemical accuracy only after mitigation. The team reports the result alongside an exact classical calculation, which confirms the method works but also shows that, at this size, the classical computer remains faster.