Variational Quantum Eigensolver
The Variational Quantum Eigensolver is the algorithm that made quantum chemistry a near-term ambition rather than a fault-tolerant one. Its target is the oldest hard problem in quantum simulation: find the lowest eigenvalue of a Hermitian operator — the electronic Hamiltonian of a molecule, or the Hamiltonian of a lattice magnet. Exact diagonalization is hopeless because the Hilbert-space dimension is in the qubit number , and the textbook quantum answer, quantum phase estimation, needs deep coherent circuits that implement controlled time evolution — far past the reach of today's noisy, intermediate-scale (NISQ) hardware. VQE sidesteps both walls by turning eigenvalue estimation into optimization. It leans on a theorem older than quantum computing itself, the Rayleigh–Ritz variational principle: for any normalized trial state , the expectation can never dip below . So one parameterizes a family of states — the ansatz — and slides the parameters downhill until the energy bottoms out. The quantum device does only what shallow circuits do well: prepare an entangled state and measure local observables; every decision about where to step next is offloaded to a classical optimizer. To make the energy measurable, is expanded as a weighted sum of Pauli strings , each read out by rotating into its eigenbasis and sampling. VQE thus lives at the crossing of quantum algorithms, classical optimization, and quantum chemistry, and it is the prototype of the whole family of variational quantum algorithms, QAOA included.
- VQE estimates the ground-state energy of a Hamiltonian by minimizing over a parameterized circuit , using the variational bound .
- It is a hybrid quantum–classical loop: a quantum processor prepares and measures Pauli expectation values; a classical optimizer proposes the next .
- The Hamiltonian is written as a weighted sum of Pauli strings , and the energy reassembles by linearity as ; the measurement cost scales as .
- Fermionic (electronic-structure) problems are mapped to qubits by the Jordan–Wigner or Bravyi–Kitaev encoding; common ansätze are UCCSD (chemistry-tailored) and hardware-efficient (shallow but landscape-prone).
- Gradients come exactly and cheaply from the parameter-shift rule, but expressive ansätze suffer barren plateaus where the gradient variance decays as .
- Key idea: the quantum computer evaluates the energy term-by-term over Pauli strings while a classical optimizer descends the surface; because always, the minimum is a rigorous upper bound on the ground-state energy.
Replace deep coherent eigenvalue extraction with a hybrid loop: the quantum computer evaluates term-by-term over Pauli strings, and a classical optimizer descends this surface. The variational principle guarantees always, so the minimum is a rigorous upper bound on the ground-state energy.
Where this lives today
VQE is the workhorse of the NISQ era, and its story since 2014 is a candid mix of milestones and hard lessons. The first demonstration solved on a two-photon chip; Google and IBM soon traced full dissociation curves of , , and on superconducting qubits, and in 2020 Google's Sycamore ran a 12-qubit Hartree–Fock VQE on hydrogen chains and diazene isomerization — the largest chemistry simulation on a quantum computer at the time. VQE is also the canonical proving ground for error mitigation: zero-noise extrapolation, probabilistic error cancellation, and symmetry verification were all sharpened on variational chemistry, because the variational bound gives a clean target to restore. Beyond molecules, VQE attacks Hubbard and Heisenberg lattice models relevant to high-temperature superconductivity, and excited-state variants reach spectral gaps and reaction barriers. The open question is whether any of this beats a classical computer. Barren plateaus (2018) showed that expressive ansätze train exponentially poorly, and a growing body of "de-quantization" results shows many barren-plateau-free circuits are also classically simulable, sharpening the question of where a real advantage could hide; the measurement wall of equation (8) compounds it. The live frontiers — problem-tailored and symmetry-preserving ansätze, adaptive circuit growth (ADAPT-VQE), classical-shadow measurement, and rigorously-guaranteed error mitigation — all aim to keep VQE's shallow-circuit promise while escaping its two exponential traps. Whether it delivers practical quantum advantage or serves as the instructive prototype that taught the field what a variational algorithm must avoid, VQE remains the entry point to the whole variational program, QAOA included.
The physical picture
The whole algorithm is a division of labour along the line each machine is good at. A quantum processor can cheaply hold and manipulate an entangled state on amplitudes but cannot think — only prepare and measure. A classical computer can optimize but cannot store the state. VQE couples them: the quantum side is a black-box energy oracle that, handed a parameter vector , prepares , measures every Pauli term of , and reports a number ; the classical side takes that number (and its gradient, via the parameter-shift rule) and decides where to step next. The first figure is this loop.
Two features deserve a second look. First, the quantum computer never holds coherence for long — it prepares a shallow state, measures, and resets, so decoherence has little time to accumulate; that is precisely why VQE is a NISQ algorithm and phase estimation is not. Second, the energy is not read off in one shot but as a weighted sum of Pauli expectations, each estimated by many repetitions. The variational principle is what makes the scheme worth the trouble: whatever state the circuit prepares, its energy is an upper bound that can only improve as the optimizer works. The second figure shows that floor for the simplest case — a single qubit, where the whole landscape is one sinusoid and the bound is a horizontal line the curve just kisses.
Two warnings before the equations. The landscape is only this friendly for one qubit; in general is a rugged, high-dimensional, non-convex surface whose most dangerous pathology is the barren plateau — for expressive random circuits the gradient shrinks like , so the surface goes exponentially flat and the optimizer is blind. And measuring is really measuring a budget of Pauli strings; because commuting Paulis can be read out together, grouping them into compatible sets is the algorithm's version of caching and can cut the runtime by an order of magnitude.
The core equations
Everything begins with the variational cost function — the Rayleigh quotient of in the trial state. The inequality on the right is the entire justification for the method: the measured energy is a rigorous upper bound on , so lower is always better and never wrong.
where: — variational energy, the objective minimized over the parameters; — trial (ansatz) state produced by the circuit; — Hermitian Hamiltonian whose ground energy is sought; — true ground-state energy, the smallest eigenvalue of ; — vector of variational parameters (gate angles). Any state you can build sits at or above the true floor, with equality only at a ground eigenstate. A quantum computer cannot measure a generic directly — its detectors read qubits in the computational () basis. So is expanded in the one operator basis the hardware can handle: tensor products of single-qubit Paulis.
where: — real coefficient (Hermiticity forces real for Hermitian ); — an -qubit Pauli string, a tensor product of single-qubit Paulis; — number of qubits. There are at most such strings, but physical Hamiltonians are sparse in this basis — molecular Hamiltonians carry only terms. Linearity of the expectation value then collapses the whole energy into a weighted sum of Pauli expectations, each a number between and that the hardware estimates by rotating into the string's eigenbasis and sampling.
where: — expectation of the Pauli string , with eigenvalues , estimated by sampling in its eigenbasis. The energy is reassembled classically from these pieces — no single circuit ever measures as a whole. The trial state is produced by a layered parameterized circuit acting on a fixed reference; the choice of layers — the ansatz — is where all the art (and all the danger) lives.
where: — parameterized layer (single-qubit rotations interleaved with fixed entanglers); — circuit depth; — reference state, in chemistry the Hartree–Fock determinant. A hardware-efficient ansatz picks for shallow depth; a chemistry ansatz picks it to respect physics. The flagship chemistry ansatz is unitary coupled cluster with single and double excitations (UCCSD): it dresses the Hartree–Fock reference with a unitary built from fermionic excitation operators.
where: — cluster operator carrying single () and double () excitation amplitudes; — fermionic creation/annihilation operators; — the variational amplitudes (components of ); — Hartree–Fock reference. The anti-Hermitian generator makes unitary and hence circuit-implementable. Fermionic operators do not act on qubits until transformed. The Jordan–Wigner map is the standard bridge: it turns each fermionic mode into a qubit and carries fermionic antisymmetry into a Pauli- parity string on the preceding qubits.
where: — fermionic creation operator on mode ; — parity string of the preceding modes, enforcing the anticommutation relations; — Pauli operators on qubit . The Bravyi–Kitaev encoding trades this -length string for , at the price of a less transparent mapping. To train the circuit one needs gradients, and here VQE has a small miracle: for gates generated by an involution, the derivative is exact from two energy evaluations at shifted angles — no finite-difference step size to tune, no discretization bias.
where: — exact gradient component with respect to parameter ; — the same circuit run with that one angle shifted by a quarter turn. It looks like a finite difference but it is not: for a Pauli-generated gate the energy is an exact sinusoid in , so this combination returns the true derivative. Finally, precision costs measurements. Because each Pauli expectation is a sample mean of outcomes, resolving the energy to a standard error demands a shot budget that grows as the square of the coefficient one-norm — the origin of VQE's notorious measurement overhead.
where: — shots allocated to Pauli term ; — its per-shot standard deviation; — target standard error on the total energy; — total measurement budget. The scaling is the shot-noise (standard quantum limit) tax that phase estimation, at , avoids.
The single fact that makes VQE trustworthy is that its cost function is bounded below by the very quantity it estimates. The goal here is to prove that inequality cleanly — that for every trial state the Rayleigh quotient is at least , with equality only when is a ground eigenstate. The proof is nothing but the spectral theorem plus the definition of the smallest eigenvalue, and it assumes nothing about the ansatz, optimizer, or hardware.
Step 1. Because is Hermitian, the spectral theorem gives an orthonormal eigenbasis with real eigenvalues , ordered so that . Expand the trial state in this basis, with . Why: the eigenbasis is the one frame in which acts by simple multiplication, converting operator algebra into ordinary sums.
Step 2. Compute the numerator. Using orthonormality , every cross term drops and . The denominator is . Why: orthonormality is what makes the double sum collapse to a single weighted sum of eigenvalues — the interference between distinct eigenstates cannot contribute to the energy.
Step 3. Bound each eigenvalue from below by the smallest one: since for all , replacing every by can only decrease the sum, giving . Why: this is the one inequality in the whole argument, and it is exactly where "there is a lowest eigenvalue" enters — the weights are non-negative probabilities, so a term-by-term lower bound survives summation.
Step 4. Divide by to reach . Equality holds iff all the weight sits on the ground level, i.e. whenever , which means . Why: normalizing turns the weighted average of eigenvalues into a convex combination, and a convex combination of numbers all equals only when it puts no weight above the floor. *Verified: E(θ) ≥ E₀ for every θ; for the single-qubit H = Z + ½X the minimum of cos θ + ½ sin θ equals −√1.25 = −1.11803, exactly the smaller eigenvalue of H, confirming the bound is tight when the ansatz reaches the ground state.*
Go deeper · Derivation B · 2 minThe parameter-shift rule gives exact gradients from two circuit runs
Gradient-based optimizers need , but a quantum computer cannot differentiate a circuit symbolically — only run it and measure. The goal here is to show that when enters through a gate whose generator is an involution (, true for any Pauli generator), the energy is an exact sinusoid in , so its derivative is captured without approximation by one difference of two shifted evaluations — no step size, no truncation error, no bias-versus-noise tradeoff.
Step 1. Expand the gate. Because , the Taylor series of the exponential splits into even and odd parts that resum to . Why: an involution behaves under exponentiation exactly like under , so the gate is a rotation in the two-dimensional algebra spanned by and — the source of every sinusoid that follows.
Step 2. Sandwich (dressed by all the other, fixed gates) between and and expand. The four resulting terms carry factors , , and , which combine through the double-angle identities into a single harmonic: . Why: only the first harmonic can appear because has exactly two distinct eigenvalues (), so the parameter dependence lives entirely at frequency one — no higher harmonics are possible.
Step 3. Differentiate the exact form: . Now evaluate the energy at the two shifted points a quarter turn apart. Using and gives and . Why: the shift is chosen precisely so the cosine and sine trade places, isolating the derivative's ingredients.
Step 4. Subtract and halve: . The constant cancels and the result is the exact derivative. Why: because the energy truly is a pure first harmonic, two samples a quarter period apart determine its slope everywhere — a fact finite differences can only approximate. *Verified: for H = Z + ½X and E(θ) = cos θ + ½ sin θ evaluated at θ = 1.0, the parameter-shift estimate ½[E(1+π/2) − E(1−π/2)] = −0.57132 matches the analytic derivative −sin 1 + ½ cos 1 = −0.57132 to all quoted digits.*
Limiting cases
VQE is best understood at its boundary regimes, where the general machinery reduces to a single clean statement.
| Case | Result | Meaning |
|---|---|---|
| Exact ansatz, global optimizer | If the ansatz family contains the true ground state and the optimizer finds the global minimum, VQE recovers exactly in the infinite-shot limit. | |
| Infinite measurement shots | The estimator becomes deterministic and the rigorous variational bound holds; finite shots make it a random variable around this value. | |
| Barren plateau (expressive random ansatz) | For 2-design-like circuits the gradient variance vanishes exponentially in qubit number, so gradient-based training needs shots per step. | |
| Shot-noise-limited precision | Sampling gives the standard-quantum-limit scaling, worse than phase estimation's Heisenberg-limited . | |
| Single trivial () layer | With no parameters the circuit returns the reference (Hartree–Fock) energy — the classical starting point VQE aims to beat. |
Worked examples
1 · A single-qubit VQE, worked end to end
Let act on one qubit. Use the one-parameter ansatz . Find the variational energy, its minimum, the optimal angle, and check the parameter-shift gradient.
Step 1. Build the cost function from Pauli expectations. For the ansatz, direct calculation gives and . By linearity (equation 3), . This is the exact single-harmonic form the parameter-shift derivation predicted.
Step 2. Minimize analytically. Write with amplitude . The minimum is , so , reached when . Setting gives ; the minimizing root in is .
Step 3. Confirm against exact diagonalization. As a matrix has eigenvalues . The variational minimum equals the smaller eigenvalue exactly — the ansatz is expressive enough to reach the ground state, so the bound is tight. VQE returns , the true ground energy.
Step 4. Test the parameter-shift rule at . The shifted energies are and ; their half-difference is . The analytic slope is . The two agree to every quoted digit — the shift rule is exact, not a finite-difference estimate.
2 · The measurement budget for chemical accuracy
A VQE energy is only useful in chemistry if it reaches "chemical accuracy," , the error at which reaction rates come out right. Estimate the shot budget for the problem above, and use it to explain why measurement, not gate depth, is VQE's bottleneck.
Step 1. Read off the coefficient one-norm. Here the Pauli coefficients are and , so . Taking the worst-case (no knowledge of the expectation values yet) turns the shot-budget bound of equation (8) into . That budget is the closed form of a Lagrange-multiplier optimization: to reach total error with the fewest shots, allocate to each term.
Step 2. Evaluate. shots per energy evaluation. For a toy one-qubit problem that is already nearly a million measurements just to place one point on the landscape to chemical accuracy.
Step 3. Scale it up. A real molecule such as has hundreds of Pauli terms and a one-norm of tens of Hartree, so balloons by four to six orders of magnitude; times the hundreds of energy evaluations an optimizer needs, one dissociation-curve point can demand – shots. This measurement wall — not circuit depth — is why practical VQE research obsesses over commuting-term grouping, classical shadows, and low-variance estimators.
Physics of the portrait
VQE is a very modern algorithm resting on a very old idea. The engine under its hood is the variational principle — the observation, more than a century old, that you can bound a system's ground energy from above with any trial wavefunction and then improve the bound by tuning it. Everything VQE does is a quantum-hardware realization of that single move.
Origins · 1 minvariational principle and how this was discovered
The variational principle is one of the most productive ideas in physics, and it long predates the machines that now run it. Lord Rayleigh, in the 1870s, showed that a vibrating system's natural frequency could be bounded by an energy ratio evaluated on any admissible trial shape — the Rayleigh quotient — and that refining the shape tightened the bound. Walther Ritz, in 1909, made it systematic: expand the trial function in basis functions with free coefficients and minimize the quotient over them, converting an eigenvalue problem into ordinary calculus. The Rayleigh–Ritz method became the backbone of quantum chemistry — Egil Hylleraas used it in 1929 to compute the ground-state energy of helium to spectroscopic accuracy with a handful of cleverly chosen parameters, an early triumph that showed the new quantum mechanics was quantitatively exact. For most of a century the trial function was a formula and the minimization ran on paper or on classical computers whose cost exploded with the number of correlated electrons. The Variational Quantum Eigensolver, introduced by Peruzzo, McClean, and collaborators in 2014, is the same principle with a quantum twist: the trial function is now a quantum state prepared by a circuit that a classical computer could not even write down, and the Rayleigh quotient is measured rather than integrated. The free coefficients are gate angles; the minimization is a hybrid loop. Ritz's calculus of variations, running on a chip.
Going further
Texts and reviews. Nielsen & Chuang, Quantum Computation and Quantum Information, §2.2 (spectral theorem, expectation values) and §5 (phase estimation, the deep-circuit alternative) · Preskill, Quantum Computing in the NISQ era and beyond, Quantum 2, 79 (2018) · Cerezo et al., Variational Quantum Algorithms, Nat. Rev. Phys. 3, 625 (2021) · McClean, Romero, Babbush, Aspuru-Guzik, The theory of variational hybrid quantum-classical algorithms, New J. Phys. 18, 023023 (2016).
Primary sources. Peruzzo et al., A variational eigenvalue solver on a photonic quantum processor, Nat. Commun. 5, 4213 (2014) · O'Malley et al., Scalable quantum simulation of molecular energies, Phys. Rev. X 6, 031007 (2016) · McClean et al., Barren plateaus in quantum neural network training landscapes, Nat. Commun. 9, 4812 (2018) · Kandala et al., Hardware-efficient variational quantum eigensolver for small molecules, Nature 549, 242 (2017).
Provenance. The variational bound is Rayleigh–Ritz, recalled from Hermitian operators and the spectral theorem (Nielsen & Chuang §2.2). The Pauli decomposition, energy linearity, parameter-shift rule, and shot-allocation scaling follow McClean et al. NJP 18 (2016) and Cerezo et al. Nat. Rev. Phys. 3 (2021); the barren-plateau variance is McClean et al. Nat. Commun. 9, 4812 (2018); the Jordan–Wigner mapping is standard (Bravyi–Kitaev the low-weight alternative). A verifier should recompute: the Rayleigh-quotient lower bound; the single-harmonic energy underlying the parameter-shift rule and the numeric check ; the single-qubit ground energy ; the shot budget ; and the chemical-accuracy figure .
Builds on: Hermitian operators and the spectral theorem · Pauli operators and the Pauli group · Expectation values and projective measurement · Parameterized quantum circuits · Second quantization and fermionic operators. Leads to: Quantum Approximate Optimization Algorithm (QAOA) · Magic State Distillation · Quantum Phase Estimation.
Ask the tutor: ask me to walk you through the single-qubit VQE by hand — building from and , minimizing it, and checking the parameter-shift gradient — or to explain why barren plateaus and the measurement wall are the two exponentials VQE has to outrun.
Is VQE guaranteed to find the true ground-state energy?
No — this is the caveat to internalize. VQE returns only an upper bound , and two things can hold it above the true floor. First, expressibility: if the ansatz simply cannot produce the ground state — too few layers, the wrong symmetry sector, missing excitations — no amount of optimization reaches . Second, optimization: even an expressive ansatz can trap the optimizer in a local minimum or a barren plateau. VQE tells you the best energy achievable within your ansatz family as explored by your optimizer — a genuine bound, not a certificate of exactness. Comparing against a richer ansatz or a classical benchmark is how practitioners gain confidence.
Why not just use quantum phase estimation, which is exact?
Quantum phase estimation (QPE) extracts eigenvalues to Heisenberg-limited precision, but pays with circuit depth: it implements controlled time evolution over many ancilla-controlled steps, building coherent circuits far deeper than today's qubits survive. VQE deliberately trades depth for shallowness — decoherence has little time to act, and the cost migrates to classical optimization and measurement repetition. The price is precision: VQE's shot-noise-limited is quadratically worse than QPE's . Rule of thumb: QPE is the fault-tolerant answer for when error-corrected qubits exist; VQE is the near-term answer for the noisy hardware we actually have.
What exactly is the ansatz, and how do I choose one?
The ansatz is the parameterized circuit that turns a fixed reference into the trial state you optimize, and it is where VQE's central tension lives. Chemistry-inspired ansätze like UCCSD are built from the molecule's excitation operators, so they respect physics and their parameters carry meaning — but they compile to deep circuits. Hardware-efficient ansätze are shallow stacks of native rotations and entanglers fitted to a chip — but they ignore problem structure and are the most prone to barren plateaus. The frontier is in between: symmetry-preserving ansätze that conserve particle number and spin, and adaptive methods (ADAPT-VQE) that grow the circuit operator by operator. Choosing an ansatz is choosing a tradeoff between expressibility, trainability, and depth.
Where does the barren plateau come from, physically?
From too much expressiveness. If the ansatz is deep and unstructured enough that its outputs scatter like Haar-random states (a "2-design"), averaging the gradient over the circuit's randomness gives zero mean and a variance that shrinks as . Intuitively, a random state has essentially the same near-maximal-entropy energy as any nearby random state, so the landscape is exponentially flat almost everywhere with no local signal pointing downhill. Resolving a gradient against shot noise then costs measurements per step, defeating scaling. Mitigations reduce expressiveness or localize the cost: shallow problem-tailored ansätze, local rather than global cost functions, layerwise training, and initializations near the identity.
Why does measurement dominate the runtime instead of gate operations?
Because the energy is not a single measurable quantity — it is a weighted sum of many Pauli expectations, each estimated by sampling outcomes with shot noise falling only as . Equation (8) shows the total scales as . For chemical accuracy mHartree the alone is ; multiply by a molecular one-norm of tens of Hartree squared and by the hundreds of energy evaluations an optimizer needs, and one result can require – shots. Each shot is a full state preparation plus readout, so measurement — not the shallow gate sequence — sets the wall-clock time. Hence the intense interest in commuting-term grouping, classical shadows, and variance-reduced estimators.
How does a fermionic molecule become a qubit problem at all?
Through a fermion-to-qubit encoding. The molecular Hamiltonian is first written in second quantization from creation and annihilation operators , which obey fermionic anticommutation relations qubits do not natively share. The Jordan–Wigner transform (equation 6) fixes this by mapping each mode to one qubit and attaching a string of Pauli- operators on all preceding qubits; that parity string reproduces the minus signs of fermionic exchange. The Bravyi–Kitaev encoding does the same with only -length strings, lowering the weight of the resulting terms. After the mapping, is ready for the VQE loop and the reference is the Hartree–Fock determinant as a computational-basis string.