Checkpoint: Simon’s Algorithm
This is your Simon's algorithm checkpoint. You will assemble the complete quantum circuit from scratch — superposition, oracle, and the Hadamard interference layer — and verify that the output satisfies the orthogonality constraint that characterises Simon's algorithm.
The algorithm in one picture
Simon's circuit for input qubits and output qubits looks like this (time flows left to right):
The three steps are the complete quantum part of the algorithm. After repetitions, the measurement outcomes are fed into classical Gaussian elimination to recover the hidden string .
The instance you will implement
The circuit uses input qubits (register A, qubits 0 and 1, qubit 0 is the most significant bit) and one output qubit (register B, qubit 2). The oracle computes
where is the MSB. Because ignores , it satisfies for : flipping only leaves the output unchanged. This is the Simon promise with hidden string .
What the oracle does
The oracle acts on the 3-qubit register as
Copying a single bit with XOR is the definition of a CNOT: flips qubit 2 when qubit 0 is and leaves it alone when qubit 0 is .
Why interference selects orthogonal outcomes
After the oracle, the state is a superposition in which each value of appears paired with two input strings and . The second layer applies the Walsh-Hadamard transform over ; the amplitudes of every outcome that does not satisfy cancel by destructive interference.
For the orthogonality condition is
so only outcomes with survive. In the 3-qubit circuit the input register contributes bits and the output register contributes , so the allowed measurement strings are exactly , each with probability .
You can verify this by algebra. After the 3-qubit state is
Each of the four basis states appears with amplitude , giving probability . The minus sign on is a global relative phase between terms and does not shift any probability — all four outcomes are equally likely, and the outcomes , , , (those with ) have zero probability.
Try it
Implement the full Simon circuit for this oracle. The grader checks the probability distribution over all three qubits; the correct circuit puts equal weight ( each) on , , , and , with zero probability on all remaining basis states.
Sign in on the full site to ask questions and join the discussion.