🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Quantum Approximate Optimization

Quantum ComputingQuantum Approximate OptimizationđŸŸĸ Free Lesson

QAOA Formalism

The QAOA circuit for depth :

The objective is to maximize .

Two Hamiltonians carry the whole construction. For MaxCut the cost Hamiltonian is , whose eigenvalues are the cut values of the corresponding basis strings, so measuring every qubit in the computational basis and post-processing the bitstring gives a cut candidate for free. The mixer Hamiltonian is , the generator of rotations that move amplitude between basis states — without it the cost unitary only stamps phases and nothing ever redistributes probability. Alternating the two for layers trades circuit depth for the ability to steer interference paths, and the classical outer loop tunes the real parameters that control those interleaved rotations.

Reading the circuit left to right: Hadamard layer prepares the uniform superposition; then layer 1 applies the diagonal phase separator followed by the mixer ; layers 2 through repeat the pattern with new angles; and the final register measurement is in the computational basis, never in an auxiliary basis. That last detail is why QAOA is hardware-friendly: it needs only the native entangling gate plus single-qubit rotations, with no inverse Fourier transform or mid-circuit measurement.

Performance Guarantees

For MaxCut on 3-regular graphs:

  • : approximation ratio
  • : approximation ratio
  • : exact solution

For MaxCut on general graphs, gives ratio . The Goemans-Williamson algorithm achieves classically, but QAOA has potential quantum advantages for specific instances.

The convergence rate behind the line is worth stating precisely because it tempers expectations: the error above optimum falls off as for a constant that depends on the graph. Doubling therefore does not double accuracy — it subtracts a fixed fraction of the remaining error — while doubling the number of two-qubit gates the noisy device must execute. On today's hardware the two curves cross at single-digit , which is the entire content of the "QAOA is a NISQ algorithm" slogan. Structured graphs are the escape hatch: the figure applies to the full family of 3-regular graphs, and particular instances (bipartite, planar, weakly frustrated) achieve higher ratios at the same depth.

Parameter Landscape

The QAOA landscape can have:

  • Local minima: suboptimal parameter configurations
  • Saddle points: flat directions in parameter space
  • Barren plateaus: exponentially vanishing gradients

However, the landscape typically has good solutions near the classically computable initialization, and gradient-based optimizers converge quickly for small .

The structure that saves shallow QAOA from the barren-plateau curse is size locality. At low the expectation value depends on the cost function only through terms within roughly hops on the problem graph, so gradients on a 100-qubit graph at look statistically like gradients on a 4-qubit graph — the variance does not collapse exponentially the way it does for randomly initialized deep circuits. Concentration sets in at large and on random dense graphs, where the landscape becomes a narrow band around a typical value and every parameter vector performs almost equally. Empirically the practical rule is: optimize or carefully, then use those angles as the initialization for layers rather than restarting from scratch.

Circuit Depth Scaling

The circuit depth determines the tradeoff:

  • Low : fast execution, limited accuracy
  • High : better solutions, deeper circuits (more noise)
  • Optimal : depends on hardware error rates

For NISQ devices, is typically practical. The benefit of increasing diminishes as hardware noise accumulates.

A worked budget makes the limit concrete. A 3-regular graph on 50 qubits has 75 edges, so each QAOA layer costs about 75 entangling gates and 50 mixer rotations. At a two-qubit error rate of , a circuit is exposed to roughly chance of at least one error somewhere in the entangling layers — enough to distort the expectation value the classical loop is climbing. Error mitigation techniques such as zero-noise extrapolation can push the usable depth by a factor of two or so, at the cost of repeated executions, which is why "effective " in hardware papers is usually quoted after mitigation rather than before.

Classical Optimizers for QAOA

Recommended classical optimizers:

  • COBYLA: gradient-free, good for noisy landscapes
  • L-BFGS-B: gradient-based, fast convergence
  • SPSA: simultaneous perturbation, robust to noise
  • Nelder-Mead: simplex method, no gradients needed

The choice of optimizer significantly impacts QAOA performance, especially for noisy circuits. The decision rule that holds up in practice: when the objective is evaluated on noiseless simulators, quasi-Newton methods such as L-BFGS-B converge in the fewest evaluations; when each evaluation is a hardware job with shot noise of order , SPSA's two-point gradient estimate is immune to that noise in a way finite differences are not, and COBYLA's linear models degrade more gracefully than simplex methods as grows past five. Budget matters as much as algorithm: 400 objective evaluations is a typical ceiling, and parameter transfer from a solved instance usually beats spending that budget on a cold start.

Python: QAOA Statevector Check

python
import numpy as np
from scipy.optimize import minimize

def qaoa_objective(params, graph, n):
    gamma, beta = params[0], params[1]
    # Simplified QAOA expectation for MaxCut
    cost = 0
    for i, j in graph:
        cost += 0.5 * (1 - np.cos(2 * gamma) * np.cos(2 * beta))
    return -cost

graph = [(i, (i+1) % 10) for i in range(10)]
result = minimize(lambda p: qaoa_objective(p, graph, 10), [0.5, 0.5], method='COBYLA')
print(f"Optimal QAOA value: {-result.fun:.4f}")
print(f"MaxCut upper bound: {len(graph) * 0.5:.4f}")

The closed-form objective above is exact for on any graph whose edges share no triangles, which is why it is a fast sanity check — but it cannot validate a circuit you actually built. The second script does the honest thing and simulates the full statevector of the circuit on the triangle, applying the real phase-separator and mixer unitaries:

python
import numpy as np

def maxcut_cost_diagonal(n, edges):
    diag = np.zeros(2 ** n)
    for x in range(2 ** n):
        bits = [(x >> (n - 1 - q)) & 1 for q in range(n)]
        diag[x] = sum(1 for i, j in edges if bits[i] != bits[j])
    return diag

def rx(theta):
    c, s = np.cos(theta / 2), np.sin(theta / 2)
    return np.array([[c, -1j * s], [-1j * s, c]])

def kron_all(mats):
    out = np.array([[1.0 + 0j]])
    for m in mats:
        out = np.kron(out, m)
    return out

def qaoa_p1_expectation(n, edges, gamma, beta):
    diag = maxcut_cost_diagonal(n, edges)
    state = np.ones(2 ** n, dtype=complex) / np.sqrt(2 ** n)
    state = np.exp(-1j * gamma * diag) * state          # cost unitary
    state = kron_all([rx(2 * beta)] * n) @ state        # mixer unitary
    return float((np.abs(state) ** 2) @ diag)

edges = [(0, 1), (1, 2), (0, 2)]
grid = np.linspace(0, np.pi / 2, 25)
best = max(
    ((g, b, qaoa_p1_expectation(3, edges, g, b)) for g in grid for b in grid),
    key=lambda t: t[2],
)
print(f"Best angles: gamma={best[0]:.3f}, beta={best[1]:.3f}")
print(f"Expected cut: {best[2]:.4f} of optimum 2 (ratio {best[2] / 2:.4f})")

The scan returns an expected cut of 1.5 at angles near , , matching the analytic result for the triangle: ratio , above the family average for 3-regular graphs because the triangle has fewer frustration loops than a generic cubic graph. Replacing the grid scan with scipy.optimize.minimize reproduces the outer loop of a real QAOA experiment in miniature.

QAOA+ (Enhanced QAOA)

QAOA+ improves upon standard QAOA by:

  1. Initialization: use classical approximation for initial parameters
  2. Layer addition: add layers incrementally
  3. Parameter transfer: use parameters from previous layers
  4. Post-selection: select best solutions from multiple runs

The enhanced approach can achieve higher approximation ratios with the same circuit depth. Incremental layer addition deserves emphasis because it changes the optimizer's job: appending a layer and setting the new angles near zero makes the extended circuit start exactly at the old circuit's expectation value, so every improvement the optimizer then finds is strictly additive. Post-selection is the cheapest trick on the list — sampling 10,000 bitstrings and returning the best cut costs nothing on the coherence budget and reliably beats the mean cut by several percent on graphs with skewed cut distributions.

QAOA Parameter Landscape Properties

The QAOA energy landscape for MaxCut on 3-regular graphs has the following properties:

  1. Periodicity: on 3-regular graphs the landscape is -periodic in both and , so the search domain can be clipped to a single period without losing the optimum
  2. Symmetry: the landscape is invariant under jointly negating both parameters, reflecting the time-reversal symmetry of the cost and mixer Hamiltonians
  3. Multiple local maxima: generic graphs show several local maxima, but on regular families the global maximum tends to sit near the analytically known point
  4. Concentration: at large qubit counts and deep , gradient variance can fall exponentially in , flattening the landscape into a barren plateau

Despite these challenges, QAOA performs well in practice because the global minimum is typically easy to find with gradient-based optimizers at the shallow depths that noisy hardware actually supports.

Common Mistakes

Treating the noiseless QAOA approximation ratio as the number a hardware run will deliver.

Fix: Every entangling gate in each layer compounds error, so measure the expectation value at several depths on the target device and quote the best mitigated value together with the shot count, not the textbook ratio.

Restarting the classical optimizer from random angles at every depth.

Fix: Initialize layer p+1 with the optimal angles from layer p and the new angles near zero. Warm starts cut objective evaluations dramatically and avoid the bad local minima that random starts hit on regular graphs.

Judging QAOA only by its worst-case ratio against Goemans-Williamson.

Fix: The 0.878 classical guarantee holds for all graphs, but QAOA's weak worst case hides strong performance on structured families and easy instances. Compare per-instance against greedy and local-search baselines sampled from the same graph distribution.

Key Takeaways

  • QAOA interleaves a diagonal cost unitary with an X-mixer for P layers; measurements in the computational basis double as cut candidates because cost eigenvalues are read off bitstrings.
  • Approximation ratio improves with depth as 1 minus an exponentially small term in P, so each layer buys a shrinking margin while noise exposure grows linearly — hardware typically peaks below P=10.
  • Low-depth QAOA avoids barren plateaus through problem locality, and warm-started, incrementally deepened runs are the standard way to keep the classical outer loop affordable.
  • The P=1 statevector simulation on the triangle lands at expected cut 1.5 of optimum 2, ratio 0.75 — the smallest instance where the algorithm's interference advantage is visible end to end.
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-16

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Quantum Computing Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement