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 gatesdepth417 views0 saves0 forks0 downloads
1OPENQASM 2.0;
2include "qelib1.inc";
3qreg q[4];
4creg c[2];
5h q[0]; h q[1];
6// Oracle for s=11
7cx q[0],q[2]; cx q[1],q[2];
8cx q[0],q[3]; cx q[1],q[3];
9h q[0]; h q[1];
10measure q[0] -> c[0];
11measure q[1] -> c[1];

Cite this circuit

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