The Bloch sphere is more than a picture — it is a map of every possible single-qubit state, and
the rotation gates RX, RY, RZ are the tools you use to move freely across its surface.
The rotation matrices
Each rotation gate is parameterized by an angle θ and rotates the Bloch vector by that angle
around the named axis. Their matrices are exponentials of the Pauli operators:
All three have the same pattern: rotating by θ=2π returns the original state up to a
global phase of −1 (unobservable), and rotating by θ=π implements a Pauli gate up to
global phase (e.g. RX(π)=−iX).
This is precisely the same state as H∣0⟩ — no surprise, because H is itself a rotation
by π around the diagonal X+Z axis.
How RX and RZ behave
RX(θ) rotates around the x-axis. Starting from ∣0⟩ (north pole) it sweeps
toward ∣1⟩ through a path that picks up imaginary components: at θ=π you get
−i∣1⟩, and at θ=π/2 the qubit lands on the equator at the −y pole of the
Bloch sphere — the state is 21(∣0⟩−i∣1⟩), which has a factor of −i on the ∣1⟩ amplitude.
RZ(θ) rotates around the z-axis. Because ∣0⟩ sits on the north pole of the
z-axis, RZ(θ)∣0⟩=e−iθ/2∣0⟩ — a global phase only. The state
∣+⟩=21(∣0⟩+∣1⟩), however, is on the equator, so RZ
moves it visibly: RZ(θ)∣+⟩=21(e−iθ/2∣0⟩+eiθ/2∣1⟩).
Together RX, RY, and RZ (or any two of them plus a phase gate) are sufficient to
express every single-qubit unitary — they form a universal single-qubit gate set.
Try it
Apply RY(π/2) to qubit 0. After running, inspect the statevector: the two amplitudes should
both be ≈0.707=21 (no imaginary parts).
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.