Classical Optimization of Angles
QAOA circuits contain free parameters — the angle vectors and — that control how well the quantum state concentrates on high-quality solutions. Picking good parameters is not a quantum task; it is a classical optimization problem that sits in a feedback loop around the quantum circuit.
The expectation-value landscape
After running the QAOA circuit and measuring, you can estimate
the average cost over many shots. This number is a smooth function of the real parameters, and the classical optimizer's job is to find the angles that maximize it.
For Max-Cut on a single edge the expectation value has a closed form. Starting from and applying the cost unitary followed by the mixer gives a state whose overlap with the cut subspace can be computed analytically. The result is
You can verify this by expanding the state in the Bell basis or by direct matrix multiplication; the derivation follows Appendix B of Farhi et al. (2014).
Finding the optimal angles
The formula shows that is maximised when both sine factors equal :
Substituting back:
The approximation ratio is , confirming that QAOA beats the trivial random-guess bound of for this instance.
Classical optimizers in practice
In production QAOA implementations the loop looks like this:
- Propose a candidate — either analytically (as above for ) or via a gradient-free method.
- Execute the parameterized circuit on a quantum backend (or simulator).
- Estimate by averaging the shot outcomes.
- Update the parameters using the optimizer's rule.
- Repeat until convergence.
The quantum computer is treated as a black-box function evaluator; the intelligence about which angles to try lives entirely in the classical optimizer.
For real devices, noise and shot sampling add stochastic error to each estimate, so the optimizer must be robust to noisy gradients. Gradient-based methods can use the parameter-shift rule:
This exact identity holds because each QAOA cost layer applies (generator eigenvalues , shift , coefficient ). It requires two extra circuit evaluations per parameter but avoids finite-difference noise amplification.
Try it
Use the closed-form formula to compute the maximum achievable for single-edge Max-Cut, and return it. No circuit needed — this is a purely classical calculation.
Sign in on the full site to ask questions and join the discussion.