Hadamard on Basis States
H maps |0⟩→|+⟩ and |1⟩→|−⟩ and is its own inverse.
Goal
Learn the table of the H gate's effect on the $Z$ and $X$ bases.
Approximate duration: 5 minutes
Steps
- Choose the H gate and the input $|0\rangle$.
- Read the two output amplitudes.
- Change the input to $|1\rangle$, then $|+\rangle$, then $|-\rangle$.
- Conclude that H swaps the two bases.
Theory predicts: $|0\rangle\to|+\rangle$ with amplitudes $(0.7071,\,0.7071)$; $|1\rangle\to|-\rangle$ with amplitudes $(0.7071,\,-0.7071)$; $|+\rangle\to|0\rangle$; $|-\rangle\to|1\rangle$.
The Hadamard matrix $H=\frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}$ is both Unitary and Hermitian, so $H^2=I$. Its effect on the computational basis: $H|0\rangle=|+\rangle$ and $H|1\rangle=|-\rangle$; and on the $X$ basis: $H|+\rangle=|0\rangle$ and $H|-\rangle=|1\rangle$. In other words, it swaps the $Z$ and $X$ bases, which is why it is used to measure a qubit in the $X$ basis.
In the gates lab, choose the input and see the output and amplitudes, then try the other inputs.
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.
- Microsoft (2025). Pauli Measurements in Quantum Computing. Azure Quantum documentation learn.microsoft.com
