Project: QAOA at Scale
The Quantum Approximate Optimization Algorithm (QAOA) attacks combinatorial problems by interleaving a problem-specific cost Hamiltonian with a generic mixing Hamiltonian, tuning the angles to push amplitude toward high-quality solutions. This capstone builds a full QAOA layer for MaxCut and asks you to assemble the cost gadget, mixer, and measurement correctly — the same template that "scales up" to deeper circuits and larger graphs.
MaxCut and the cost Hamiltonian
Given a graph , MaxCut partitions the vertices into two sets to maximize the number of edges crossing the partition. Encoding each vertex as a qubit, the cut value of a bitstring is
Promoting gives the cost Hamiltonian , whose largest eigenvalue is the maximum cut.
One QAOA layer
A depth- QAOA applies alternating layers to the uniform superposition :
with mixer . For there is a single pair . Each cost term compiles to the gadget
and each mixer term is .
The triangle instance
For the triangle every pair of vertices is connected. The best cut isolates one vertex, cutting of the edges — the bitstrings and their complements are all optimal. A well-tuned single layer concentrates measurement probability on exactly these six strings and away from the two uncut configurations and .
Try it
Build the QAOA circuit for the triangle with , , and measure. The grader checks the output distribution; you should see the two non-cut strings and suppressed relative to the six optimal cuts.
Sign in on the full site to ask questions and join the discussion.