beginner · Programming · Single-Qubit Gates I: X, Y, Z
X, Y, Z on Superpositions
The Pauli gates X, Y, and Z do familiar things to the computational basis states ∣0⟩
and ∣1⟩ — but their effect on the superposition states∣+⟩ and ∣−⟩ is
just as important, and it reveals a beautiful symmetry.
Recall the two states:
∣+⟩=21(∣0⟩+∣1⟩),∣−⟩=21(∣0⟩−∣1⟩).
What X does to |+⟩ and |−⟩
The matrix X=(0110) swaps the two amplitudes. Applying it
to ∣+⟩:
X∣+⟩=21(0110)(11)=21(11)=∣+⟩.
And for ∣−⟩ with column vector 21(1,−1)T:
X∣−⟩=21(0110)(1−1)=21(−11)=−∣−⟩.
So ∣+⟩ and ∣−⟩ are eigenstates of X with eigenvalues +1 and −1 respectively.
On the Bloch sphere, X is a rotation by π about the x-axis — which fixes the ±x poles.
What Z does to |+⟩ and |−⟩
The matrix Z=(100−1) flips the sign of the ∣1⟩
amplitude. This swaps∣+⟩ and ∣−⟩:
Z∣+⟩=21(∣0⟩−∣1⟩)=∣−⟩,Z∣−⟩=21(∣0⟩+∣1⟩)=∣+⟩.
In other words, Z acts like a bit-flip in the X basis — it exchanges the two X-basis states,
just as X exchanges ∣0⟩ and ∣1⟩ in the Z basis.
What Y does to |+⟩ and |−⟩
The matrix Y=(0i−i0) introduces imaginary factors. Direct
multiplication gives:
So Y also swaps ∣+⟩ and ∣−⟩, but with an imaginary phase factor of ∓i.
Try it
Verify the prediction Z∣+⟩=∣−⟩ by building the circuit. Start in ∣0⟩, apply
H to reach ∣+⟩, then apply Z. The simulator will confirm the resulting state is ∣−⟩.
Run your code to see the quantum state.
After running, you should see amplitudes ≈+0.707 for ∣0⟩ and ≈−0.707 for
∣1⟩ — the characteristic signature of ∣−⟩. The Bloch vector points along −x.
Sign in on the full site to ask questions and join the discussion.