Interference: HZH = X
H Z H on |0⟩ yields |1⟩ with certainty—destructive and constructive interference of amplitudes.
Goal
See quantum interference in the simplest circuit.
Approximate duration: 5 minutes
Steps
- Load the H–Z–H circuit.
- Follow the amplitudes after each gate.
- Remove Z and run again.
- Compare the two results.
Theory predicts, with Z: $P(1)=1$ (every shot gives 1), and without Z: $P(0)=1$ because $HH=I$.
After the first H the state is $|+\rangle$; Z flips the sign of the amplitude of $|1\rangle$, giving $|-\rangle$; then the second H: $$H|-\rangle=\tfrac12\big[(|0\rangle+|1\rangle)-(|0\rangle-|1\rangle)\big]=|1\rangle.$$ The two contributions to $|0\rangle$ cancel (destructive interference) and the two contributions to $|1\rangle$ add up (constructive interference). This is the basis on which quantum algorithms rely: arranging phases so that amplitude accumulates on the correct answers. At the matrix level: $HZH=X$.
Test your understanding
The quiz needs JavaScript.
Related topics
References
- Michael A. Nielsen; Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press doi:10.1017/CBO9780511976667The standard reference for quantum computing; the Crossref record gives 2012 for the Cambridge Core online edition.
- John Watrous / IBM Quantum (2025). Basics of Quantum Information (course). IBM Quantum Learning quantum.cloud.ibm.com
