After the first Hadamard gate and the controlled unitary gate, the state is
The final Hadamard gate gives
Hence the Hadamard test returns one with probability
If , then and the outcome is zero with certainty. If , then modulo and the outcome is one with certainty. The single measurement therefore distinguishes the two promised cases exactly.

Articles by others on the same topic (0)

There are currently no matching articles.