circuits / simons-algorithm-2bit

Simon's Algorithm (2-bit)

FEATURED

Simon's algorithm for a 2-bit input. Finds hidden period s of f(x) = f(x ⊕ s) exponentially faster than classical.

quantumcomputer.dev
openqasm4q8 gatesdepth 40 views0 saves0 forks0 downloads

Source Code

OPENQASM 2.0;
include "qelib1.inc";
qreg q[4];
creg c[2];
h q[0]; h q[1];
// Oracle for s=11
cx q[0],q[2]; cx q[1],q[2];
cx q[0],q[3]; cx q[1],q[3];
h q[0]; h q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];

Cite this circuit

MIT
quantumcomputer.dev. "Simon's Algorithm (2-bit)". quantumcomputer.dev/circuits/simons-algorithm-2bit. 2026.