VQE: Finding Ground State Energy on a Quantum Computer
A hands-on walkthrough of the Variational Quantum Eigensolver, with a live simulation you can run right here.
The Variational Quantum Eigensolver (VQE) is one of the most important algorithms in near-term quantum computing. The goal is simple: find the lowest energy (ground state) of a quantum system. The method is clever: use a classical optimizer to tune the parameters of a quantum circuit until the measured energy stops going down.
The core idea
Given a Hamiltonian (an operator encoding the physics of your system), we want:
The quantum circuit is called the ansatz: a parameterized guess at the ground state. The classical optimizer tunes to minimize the expectation value.
Try it live
Run the full VQE simulation below. Pick a Hamiltonian, choose an ansatz, hit play, and watch the energy converge iteration by iteration.
What you’re watching
Circuit panel: The parameterized ansatz circuit. Each gate has a tunable angle . After each optimizer step the angles change.
Bloch spheres: Each qubit’s quantum state visualized on a sphere. The north pole is , south pole is , equator is superposition.
Energy plot: The expectation value at each iteration. The green dashed line is the exact ground truth (from full diagonalization).
State distribution: Probability of measuring each basis state. At convergence this should concentrate on the ground state.
Why it works
The variational principle guarantees that for any state :
So the expectation value is always an upper bound on the true ground state energy. A classical optimizer (COBYLA, Powell, Nelder-Mead) minimizes this upper bound, and if the ansatz is expressive enough, it converges to .
Limitations
VQE is heuristic: there’s no guarantee the optimizer finds the global minimum, and the quality of the result depends heavily on the choice of ansatz. For molecules like H2 the UCCSD-inspired ansatz is theoretically motivated; for general problems you’re trading expressibility against trainability.
The bigger challenge at scale is the barren plateau problem: for deep circuits with many qubits, gradients vanish exponentially and training stalls.