Every rotation gate RX(θ), RY(θ), and RZ(θ) encodes an angle, but there is one
detail that surprises many learners: the parameter θ you pass is the Bloch-sphere rotation
angle, while the matrix contains θ/2 — a factor of one-half hidden inside the formula.
Where the θ/2 comes from
The rotation gates are defined as matrix exponentials of the Pauli operators:
Expanding via the Euler formula e−iϕP=cosϕI−isinϕP (valid when P2=I, which holds for all three Paulis) gives, for example:
RY(θ)=(cos2θsin2θ−sin2θcos2θ).
The entries involve θ/2, not θ. This is a direct consequence of how spin-21
particles represent rotations: the Hilbert-space representation of a rotation by angle ϕ in
three-dimensional space is e−i(ϕ/2)n^⋅σ, where n^ is the rotation
axis and σ=(X,Y,Z) are the Pauli matrices. The factor of 21 is not
a notational quirk — it is a physical fact about spin-21 systems.
The practical rule
Because the convention is baked into the definition, you always pass the angle you want to rotate on
the Bloch sphere. The gate handles the internal 21. A few important checkpoints:
| Desired Bloch rotation | Angle to pass | What the matrix computes |
|---|---|---|
| 0° (no rotation) | θ=0 | cos0=1,sin0=0 → identity |
| 90° (π/2 rad) | θ=π/2 | cos(π/4)=21 |
| 180° (π rad, half-turn) | θ=π | cos(π/2)=0,sin(π/2)=1 → Pauli (up to phase) |
| 360° (2π rad, full turn) | θ=2π | cosπ=−1 → −I (global phase −1) |
Notice that a full 360° turn gives −I, not +I. The state picks up a global phase of −1, which
is unobservable, but the qubit needs a 720° rotation to return to exactly the original matrix. This
is a signature of the double-cover structure shared by all spin-21 systems.
Verifying with RX(π) on ∣0⟩
Substituting θ=π into the RX matrix confirms the half-angle directly:
The state is ∣1⟩ up to the global phase −i — a complete population transfer, as expected for
a 180° rotation.
Try it
Apply RX with the correct angle to map ∣0⟩ to ∣1⟩ (up to global phase). The grader
checks the full statevector, so you must pass θ=π — passing π/2 will land on the
equator and fail.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.