Quantum Approximate Optimization Algorithm
The Quantum Approximate Optimization Algorithm is the archetype of a family of near-term quantum heuristics: a shallow, structured circuit whose few parameters are tuned by a classical computer to attack a hard combinatorial problem. The setting is over bit strings — MaxCut, Max-SAT, portfolio selection, any objective a classical processor would grind through by search. QAOA promotes the objective to a diagonal cost Hamiltonian on qubits, then builds a state whose measurement in the computational basis returns high-cost strings with elevated probability. It is the optimization cousin of the Variational Quantum Eigensolver, sharing its hybrid loop: the quantum device prepares trial states and estimates , while a classical optimizer nudges the angles. Two ideas make QAOA more than "another ansatz". First, its structure is not arbitrary — the alternating product is a Trotterized adiabatic path with the schedule set free, so as it solves the problem exactly and at finite it inherits adiabatic intuition. Second, at fixed the energy is local: each clause sees only its subgraph within distance , which is why the MaxCut energy is hand-computable and why Farhi, Goldstone, and Gutmann proved a worst-case ratio of on 3-regular graphs. That locality is also a ceiling — a depth- circuit is blind beyond distance , so on expanders shallow QAOA cannot see the global structure it needs to win. The tension between provable guarantees, trainability, and hardware noise is the modern story of the algorithm.
- QAOA approximately solves combinatorial optimization by encoding the objective in a diagonal cost Hamiltonian and alternating its evolution with a non-commuting mixer .
- A depth- circuit acts on ; a classical optimizer tunes the angles to raise .
- Introduced by Farhi, Goldstone, and Gutmann (2014); for MaxCut on triangle-free 3-regular graphs the ansatz provably cuts a fraction of edges, at and .
- As QAOA reproduces any adiabatic schedule and reaches the exact optimum, since the ansatz is a first-order Trotterization of an adiabatic ramp.
- QAOA is a flagship NISQ algorithm, but its usefulness is bounded from three sides: locality obstructions, barren plateaus and rugged landscapes in the outer loop, and hardware noise.
- Key idea: encode the objective in a diagonal cost Hamiltonian and interleave its evolution with a transverse-field mixer; the alternating-operator ansatz is a discretized, parameter-optimized adiabatic path whose interference concentrates measurement probability on near-optimal bit strings.
Encode the objective in a diagonal cost Hamiltonian and interleave its evolution with a non-commuting mixer; the alternating-operator ansatz is a discretized, parameter-optimized adiabatic path whose interference concentrates measurement probability on near-optimal bit strings.
Where this lives today
QAOA is the most-run algorithm on today's noisy processors because it is shallow and structured. Google's Sycamore team ran it on up to 23 superconducting qubits (Harrigan et al., Nature Physics 2021), finding hardware-native graphs tracked theory while non-native, long-range graphs degraded sharply once SWAP overhead inflated the depth — connectivity, not qubit count, is the near-term constraint. Trapped-ion and IBM groups have pushed to larger instances, and warm-started and recursive variants (RQAOA) now routinely beat vanilla QAOA at fixed depth by injecting classical relaxation. On the theory side the frontier is sobering: Farhi–Gamarnik–Jordan's typical-instance analyses on the Sherrington–Kirkpatrick model and large-girth graphs give sharp finite- performance, while Barak–Marwaha and related classical algorithms have matched or beaten shallow QAOA on exactly those families. The open problem is unchanged from 2014: is there a depth, a mixer, and an angle-finding strategy at which QAOA beats the best classical algorithm on an economically relevant problem, on real hardware?
The physical picture
QAOA does two things over and over. The cost unitary stamps every basis string with a phase proportional to its cost — invisible to a computational-basis measurement on its own. The mixer , with , is a tunable diffusion between strings differing by one bit flip, converting those phase differences into amplitude differences. Alternating the two engineers constructive interference toward high-cost strings — a programmable, Grover-like steering of amplitude — while a classical optimizer reads and retunes the angles. The first figure lays out that hybrid loop.
QAOA is best understood as a Trotterized adiabatic evolution with the schedule set free: the adiabatic algorithm slowly turns off the mixer and turns on the cost Hamiltonian along , and chopping that ramp into steps gives exactly the alternating product. Because the optimizer may pick any angles, not just a smooth ramp, QAOA can beat a naive discretized schedule at the same depth. A second structural fact governs everything analytic: at depth , decomposes clause by clause, each clause seeing only its subgraph within distance . That is why the MaxCut energy is a hand-computable function of two angles — the curve plotted below, whose peak is the Farhi–Goldstone–Gutmann guarantee.
The core equations
QAOA prepares a single state, fixed by the two Hamiltonians and the angles. Reading right to left, it starts from the uniform superposition — the mixer's top eigenstate — and applies cost-then-mixer rounds.
where: — diagonal cost Hamiltonian, ; — mixer; — layer- angles; — depth; — uniform superposition, top eigenstate of . Because , the alternation generates interference. The scalar the optimizer sees is the energy expectation — the mean cost of the output distribution; maximizing it drives probability toward good strings.
where: — expected cost of the depth- ansatz; — probability of sampling . Since the max dominates the mean, sampling yields cost- strings with constant probability, so raising pushes good samples. For MaxCut, the cost operator is a sum of two-local edge terms; each contributes when its endpoints lie on opposite sides of the cut and otherwise, so the maximum of is the MaxCut value.
where: — edge set; — Pauli- on qubit ; — an edge. For a assignment iff , so counts cut edges; any QUBO generalizes to . The two evolutions factor into hardware-native gates: the cost unitary is a product of commuting two-qubit -phase rotations, the mixer of independent single-qubit -rotations.
where: — hardware-native two-qubit -phase gate; — single-qubit -rotation. All terms in commute, so it is exact (not Trotterized) at each layer. The angles live on a compact domain. For integer-eigenvalue (as MaxCut) the cost phase is -periodic; the mixer is -periodic because is a global phase that leaves all observables unchanged.
where: — cost angle, period for integer ; — mixer angle, period . Graph symmetries shrink the search region further, so good angles are cheap to locate. Training uses exact analytic gradients, not finite differences. Every angle's generator has eigenvalues after rescaling, so is a single-frequency sinusoid and two shifted evaluations recover the derivative exactly.
where: — any single angle or (with the appropriate generator scaling). The two evaluations are themselves QAOA circuits, so gradients cost the same as energies. (The adiabatic schedule whose Trotterization is the ansatz is developed in the third derivation below.)
The goal is to derive the closed form of one edge's contribution to — the trigonometric building block of every analytic QAOA guarantee — and then optimize it to the approximation ratio. We take a single edge with in the state , and compute by conjugating through the two unitaries in the Heisenberg picture.
Step 1. Push the observable through the circuit: . Conjugation by the mixer touches only ; by the cost unitary, only edges incident to or . Why: the transformed operator lives on the distance-one subgraph, so depends only on the two degrees and the triangle count — the locality that makes tractable.
Step 2. Apply the mixer conjugation (rotating about ), and likewise for . Why: the mixer rotates the diagonal operators out of the computational basis, producing the envelope the cost phases then act on.
Step 3. Apply the cost conjugation. Each incident on a shared-qubit or either leaves it () or rotates it into a new Pauli (), so the non-partner neighbours contribute ; triangles give the correction. Why: commuting phases turn the neighbourhood into simple cosine powers, one per neighbour.
Step 4. Average the surviving strings in , the eigenstate of every . Only -diagonal terms survive, collapsing the polynomial to the boxed form with the non-partner neighbour counts and the triangle count:
Why: the all-plus average is a projector onto -diagonal terms, which is what turns a messy operator sum into three clean trigonometric pieces.
Step 5. For a triangle-free 3-regular graph , , killing the third term and leaving . Maximizing (, , rad) gives . Why: the bound holds edge by edge and every edge is identical on a regular graph, so summing gives the whole-graph ratio — no instance-specific computation. *Verified numerically: optimum at ; gives (no mixing) as required; matches Farhi–Goldstone–Gutmann (2014). Note the convention (neighbours excluding the partner), not the full degree 3 — using 3 would give and the wrong ratio .*
Go deeper · Derivation B · 1 minWhy the cost unitary alone does nothing
The goal is to prove that the cost unitary can never, by itself, change what a computational-basis measurement returns — so the non-commuting mixer is a structural necessity, not an optional refinement. We take an arbitrary , apply only (diagonal in the computational basis), and compute its output distribution.
Step 1. Because is diagonal, — each basis state picks up a pure phase. Why: a diagonal exponential acts entrywise, so is a phase gate that commutes with every -basis projector.
Step 2. Then — the phase cancels in the square. Why: probabilities are moduli-squared, and a phase has modulus one, so it is invisible to measurement.
Step 3. Only interleaving the mixer , which rotates amplitudes out of the computational basis, can convert 's phases into probability differences. Why: exactly Grover's principle — a phase oracle does nothing until diffusion reflects it into amplitude. *Verified: a direct consequence of for all ; phase oracles require a separate mixing step.*
Go deeper · Derivation C · 1 minQAOA as a Trotterized adiabatic path
The goal is to make precise how QAOA contains the adiabatic algorithm — reaching the exact optimum as — and why finite- QAOA can beat a naive discretized ramp. We start from the adiabatic interpolation, split its evolution by first-order Trotter, and identify the factors with QAOA layers.
Step 1. The adiabatic theorem: evolving under from the ground state of (which is ), slowly relative to the inverse minimum gap, ends in the ground state of — the optimum. Why: this fixes both the initial state and the target, and is why QAOA begins in .
Step 2. Discretize into slices of width and Trotter each: , . The product is exactly the QAOA circuit with , . Why: it exhibits the alternating product as the discretization of a physical evolution, so QAOA inherits adiabatic intuition.
Step 3. Now free the angles. Any adiabatic schedule maps to some angle sequence, so the best depth- QAOA is at least as good as the best -step ramp — and generally better, since the optimizer is not confined to a smooth monotone schedule. As a slow enough embedded schedule exists, so . Why: the large-depth exactness guarantee, and why good QAOA angles often look like a smooth ramp plus corrections. *Verified: reproduces the adiabatic limit of Farhi et al. (2000); the convergence rate is set by the minimum gap of .*
Limiting cases
QAOA interpolates between well-understood regimes as depth, graph class, and mixer vary:
| Case | Result | Meaning |
|---|---|---|
| Depth , triangle-free 3-regular MaxCut | Farhi–Goldstone–Gutmann's worst-case ratio, from the local edge formula at . | |
| Depth , large-girth ring | On each vertex has one non-partner neighbour (), giving — beats random's but exposes 's ceiling on tree-like graphs. | |
| Adiabatic limit | The ansatz reproduces any adiabatic schedule, reaching the exact optimum; rate set by the minimum gap. | |
| (no mixing) | The cost unitary alone leaves the uniform distribution untouched — inert without the mixer. | |
| Bounded depth vs. classical hardness | insufficient on some families | Locality obstructions (Bravyi–Kliesch–Koenig–Tang) show fixed shallow QAOA cannot beat the best classical algorithms on some symmetric/expander instances; depth must grow with . |
Worked examples
1 · The 0.6924 bound on a 3-regular graph (fully worked)
Take MaxCut on any triangle-free 3-regular graph with edges. Find the optimal angles, the per-edge energy, the expected cut, and the guaranteed approximation ratio.
Step 1. Every edge is locally identical: both endpoints have degree 3, so non-partner neighbours and . The third term vanishes, leaving .
Step 2. Mixer: is maximal at , so . Cost angle: in gives , so rad .
Step 3. Evaluate: , so .
Step 4. Sum over all identical edges: . Since , the ratio is , independent of graph size — proved without solving an instance. β⋆ = π/8, γ⋆ = 0.6155 rad, per-edge 0.6925, ratio ≥ 0.6924.
2 · The ring of disagrees (why p = 1 is weak on tree-like graphs)
Run QAOA on the cycle graph for large . What fraction of edges does it cut, and how does that compare with the exact MaxCut?
Step 1. On a cycle every vertex has degree 2, so each edge's endpoints have one non-partner neighbour each: , . The formula gives .
Step 2. Maximize both: and give , so QAOA cuts on average of the edges.
Step 3. An even cycle is bipartite, so the exact MaxCut is all edges and the ratio is . This beats random () but leaves a quarter of the cut on the table, and no angle tuning at improves it — the circuit cannot see beyond immediate neighbours. p = 1 cuts 3/4 of the ring's edges; the ceiling is locality, not bad optimization.
3 · Resource count for a NISQ-scale run (why it is "near-term")
Estimate the cost of QAOA on a 3-regular MaxCut instance with vertices.
Step 1. A 3-regular graph on vertices has edges. Each layer needs one -gate per edge plus one -rotation per qubit ( gates), so gives parameterized gates and angles.
Step 2. Estimating to error needs shots; with per-edge variance , , so cut edge costs shots per point — times hundreds of optimizer steps. The circuit is shallow; the nonconvex outer loop and its shot budget dominate. ≈ 750 gates, 6 angles, ~40 shots per point; the outer loop, not the depth, is the bottleneck.
Physics of the portrait
QAOA sits at the confluence of adiabatic quantum computation, variational methods, and combinatorial approximation — and one group tied them together.
Origins · 1 minEdward Farhi and how this was discovered
Edward Farhi is an American theoretical physicist who spent most of his career at MIT's Center for Theoretical Physics before leading Google's quantum-algorithms effort. His early work was in particle physics and cosmology, but from the late 1990s he became an architect of a distinctively physical approach to computing. With Goldstone, Gutmann, and Sipser he introduced quantum computation by adiabatic evolution in 2000 — encoding a problem in a Hamiltonian's ground state and reaching it by slow interpolation from an easy Hamiltonian. Fourteen years later, with Goldstone and Gutmann, he distilled that idea into a circuit near-term hardware could run: the QAOA. Two features of the 2014 paper set the agenda: a provable worst-case guarantee — the MaxCut ratio on 3-regular graphs, computed by hand from circuit locality, showing a quantum heuristic could carry a theorem — and the framing of depth as a knob between a cheap local heuristic and the exact adiabatic algorithm. Farhi and Harrow soon argued even QAOA produces classically hard-to-sample distributions, tying it to quantum-advantage debates. QAOA became the reference point for the whole near-term variational program: custom mixers, warm starts, recursive variants, and barren-plateau analyses are all framed as modifications of the original alternating operators.
Going further
Texts and papers. Farhi, Goldstone, Gutmann, "A Quantum Approximate Optimization Algorithm", arXiv:1411.4028 (2014) · Farhi, Goldstone, Gutmann, arXiv:1412.6062 (2014, bounded-occurrence constraint problem) · Hadfield et al., "From the QAOA to a Quantum Alternating Operator Ansatz", Algorithms 12, 34 (2019) · Preskill, "Quantum Computing in the NISQ Era and Beyond", Quantum 2, 79 (2018) · Cerezo et al., "Variational Quantum Algorithms", Nature Reviews Physics 3, 625 (2021) · Harrigan et al., Nature Physics 17, 332 (2021) · Nielsen & Chuang, Quantum Computation and Quantum Information, 10th Anniversary Ed.
Provenance. The QAOA state, MaxCut encoding, and angle periodicity are textbook (Nielsen & Chuang; Hadfield et al. 2019). The single-edge formula and bound follow Farhi–Goldstone–Gutmann (arXiv:1411.4028); a verifier should reproduce the boxed expectation by Pauli conjugation and confirm the optimum at — note the convention (degree minus one), which this article uses and the migrated source stated as . The ring follows with ; the parameter-shift identity follows Mitarai et al. (2018) and Schuld et al. (2019); barren-plateau scaling cites McClean et al. (2018). All numbers were re-verified numerically.
Builds on: Variational Quantum Eigensolver · Parameterized Quantum Circuits · Cost-Function and Measurement Estimation. Leads to: QAOA Performance Bounds and Concentration · Classical Optimizers for VQAs · Barren Plateaus.
Ask the tutor: Ask me to walk through the MaxCut edge derivation term by term, or to work out the optimal angles and cut fraction for a small graph you have in mind.
Is QAOA guaranteed to beat classical algorithms?
No — this is the central open question, not a settled advantage. QAOA has a provable worst-case guarantee ( for MaxCut on 3-regular graphs), but classical algorithms often match or beat shallow QAOA on exactly the families where its performance is known: Goemans–Williamson cuts of the optimum in polynomial time, well above QAOA, and local classical algorithms (Barak–Marwaha) keep pace on large-girth and Sherrington–Kirkpatrick instances. A genuine advantage, if it exists, likely needs larger , tailored mixers, or classically resistant structure — and must survive noise. QAOA is a leading candidate, not a proven winner.
What is the difference between QAOA and VQE?
They share the hybrid loop but differ in target and ansatz. VQE estimates ground-state energies of physical or chemical Hamiltonians (whose terms generally do not commute) with a hardware-efficient or chemistry-inspired ansatz, and its answer is the energy itself. QAOA targets a classical objective in a diagonal cost Hamiltonian, uses the specific alternating cost–mixer ansatz from adiabatic evolution, and delivers a sampled bit string, not the energy — a structured special case where ansatz and initial state are dictated by the problem.
Why start in the uniform superposition |+⟩^⊗n?
Because it is the top eigenstate of the mixer — the analogue of starting the adiabatic algorithm in the ground state of the easy Hamiltonian, which the adiabatic theorem requires. It is also maximally unbiased: every bit string has equal amplitude, so the algorithm sculpts probability from a flat prior rather than committing to any assignment. Warm-start QAOA deliberately breaks this symmetry, seeding a biased state from a classical relaxation — which can help, but requires a matching modified mixer to preserve the adiabatic connection.
How do you find good angles without paying the full optimization cost?
Two properties rescue the outer loop. First, parameter concentration: optimal angles for one instance of a class tend to be nearly optimal for others of the same class and size, so they can be precomputed on small instances and transferred. Second, good angles often resemble a smooth adiabatic schedule, so a linear-ramp initial guess lands near the optimum's basin. With exact parameter-shift gradients, the nonconvex landscape is far more navigable than its worst case suggests. When these fail — deep circuits, barren plateaus — angle finding becomes the dominant cost.
What is the Quantum Alternating Operator Ansatz, and how does it differ?
Hadfield and coworkers (2019) generalized QAOA by keeping the alternating structure but replacing the transverse-field mixer with one tailored to the problem's constraints — hence the reinterpreted acronym, "Alternating Operator Ansatz". Hard constraints (say, "exactly items selected") are enforced by a mixer whose evolution never leaves the feasible subspace, rather than by penalty terms in that waste amplitude on infeasible strings. This trades a universal mixer for a problem-specific one, often improving constrained problems like graph colouring, routing, and scheduling. Original transverse-field QAOA is the special case where the feasible space is the whole Hilbert space.
Does hardware noise destroy QAOA's advantage?
Noise is a serious threat but not an automatic death sentence at shallow depth. Short circuits accumulate less error than deep ones — a large part of QAOA's near-term appeal — but every two-qubit gate and measurement carries error, and without native long-range connectivity SWAP networks inflate depth and noise (as Sycamore showed for non-planar graphs). Noise also flattens the landscape, worsening barren plateaus, and biases the distribution. Mitigation partially recovers the signal, but whether the residual advantage survives at sizes that matter is what current experiments probe.