circuits / grovers-search-2q

Grover's Search (2 qubit)

FEATURED

Grover's algorithm on 2 qubits searching for |11⟩. Achieves quadratic speedup over classical search.

quantumcomputer.dev
openqasm2q10 gatesdepth 50 views0 saves0 forks0 downloads

Source Code

OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
// Init
h q[0]; h q[1];
// Oracle for |11>
cz q[0],q[1];
// Diffuser
h q[0]; h q[1];
z q[0]; z q[1];
cz q[0],q[1];
h q[0]; h q[1];
measure q -> c;

Cite this circuit

MIT
quantumcomputer.dev. "Grover's Search (2 qubit)". quantumcomputer.dev/circuits/grovers-search-2q. 2026.