Open laboratory · classical statevector simulation
Quantum optimization, made inspectable.
Change the angles of an ideal four-qubit QAOA circuit. See its exact probabilities and compare the expected cut with an exhaustive classical baseline.
Most probable configuration
Dark bars identify optimal cuts. Each bit assigns a node to one of two partitions. Bar widths use a fixed 0–100% scale.
With γ = β = 0, all configurations have probability 1/16. The expected cut is 2.5 edges and the probability of an optimal cut is 12.5%.
What the experiment computes
MaxCut divides the nodes of a graph into two groups and rewards edges whose endpoints lie in different groups. Here the graph has four nodes and five equally weighted edges. Its sixteen assignments can be checked directly.
- Prepare an equal superposition: every configuration begins with amplitude 1/4.
- Apply the cost phase exp(−iγC), where C counts the cut edges for each configuration.
- Apply exp(−iβΣX): a rotation Rx(2β) on each qubit mixes the amplitudes.
- Square the complex amplitudes to obtain exact probabilities. Weight each cut score by its probability to compute the expectation.
The angle search scans a 51 × 51 grid and maximizes the expected cut. It does not certify the global continuous-angle optimum. The graph displays the most probable configuration, which is distinct from the expected score.
This public demonstration runs entirely in your browser on a classical computer. It models an ideal, noiseless circuit, without hardware execution or finite-shot sampling. QAOA is the published algorithm of Farhi, Goldstone and Gutmann; this implementation is an educational example.
Read the original QAOA paper Explore the research direction