Reading the Phase Register
After the two earlier stages of Quantum Phase Estimation — superposing the counting register and kicking back the phase through controlled- powers — the counting register holds a superposition of the form
This is exactly the Quantum Fourier Transform of the computational-basis state (when is exactly representable in bits). To decode the phase we must undo the QFT — i.e. apply the inverse QFT — and then measure.
Decoding with the inverse QFT
Applying the inverse QFT (IQFT) to the counting register maps the QFT-encoded superposition back to a single computational-basis state:
Measuring then yields the -bit binary string for with probability 1. The decimal value of that string divided by is .
For counting qubits, the IQFT is a small four-gate circuit on qubits (MSB) and (LSB):
- SWAP and — undoes the bit-reversal implicit in the QFT.
- on — Hadamard on the (now-leading) qubit.
- controlled on , targeting — conjugate of the half-turn phase.
- on — final Hadamard.
A worked example: ,
The Pauli gate acts on its eigenstate as
so the eigenphase is . In binary this is , meaning and the expected measurement result on two counting qubits is (q0 = 1, q1 = 0).
With two counting qubits the controlled-unitary stage applies:
- controlled on (LSB), since accumulates the least-significant phase bit.
- controlled on (MSB) — the identity, so it can be omitted.
After these controlled operations the counting register is in the state
, which is exactly . The IQFT
maps it back to , and measurement reads out 10 — confirming .
Try it
The starter code builds the QPE circuit up through the controlled- kickback step. Add the 2-qubit IQFT on and so the distribution peaks at (counting register plus eigenstate ), confirming .
After running, the Probabilities panel should show 100% on the single state 101. The first
two bits 10 give , matching 's eigenphase.
Sign in on the full site to ask questions and join the discussion.