circuits / qaoa-maxcut-2

QAOA (MaxCut, 2 nodes)

FEATURED

QAOA circuit for the MaxCut problem on a 2-node graph. Uses alternating problem and mixer layers.

quantumcomputer.dev
openqasm2q7 gatesdepth514 views0 saves0 forks0 downloads
1OPENQASM 2.0;
2include "qelib1.inc";
3qreg q[2];
4creg c[2];
5// Initial superposition
6h q[0]; h q[1];
7// Problem layer (gamma)
8cx q[0],q[1];
9rz(0.8) q[1];
10cx q[0],q[1];
11// Mixer layer (beta)
12rx(0.6) q[0];
13rx(0.6) q[1];
14measure q -> c;

Cite this circuit

MIT
quantumcomputer.dev. "QAOA (MaxCut, 2 nodes)". quantumcomputer.dev/circuits/qaoa-maxcut-2. 2026.