Gates as Rotations
Every single-qubit gate corresponds to a rotation of the Bloch sphere. The three Pauli gates — , , and — are the simplest instances: each is a 180° (half-turn) rotation about one of the three coordinate axes.
The Bloch sphere as a rotation target
A qubit state (with ) can be written in spherical coordinates as
where is the polar angle from the north pole and is the azimuthal angle. This maps every (equivalence class of) state to a point on the unit sphere — the Bloch sphere.
Applying a unitary gate moves that point. The general rotation by angle about a unit axis is
where is the vector of Pauli matrices. At (180°) this simplifies: and , so
Choosing , , or in turn gives
The factor is a global phase and has no observable consequence. Up to that phase the Pauli gates are the 180° rotation operators: , , .
What each rotation does on the sphere
Because the rotation axis is fixed by the gate name, the effect on every point is easy to picture:
- X (NOT gate): 180° about the -axis. The north pole maps to the south pole , and vice versa. On the equator, points are flipped through the -plane.
- Z (phase flip): 180° about the -axis. The poles and stay put (they lie on the axis), but the equatorial state maps to because shifts by .
- Y: 180° about the -axis. Like , it swaps and , but it also introduces a sign so and .
Continuous rotations from the same formula
The same formula works for any
angle . The circuit API exposes this directly: c.rx(theta, q), c.ry(theta, q),
c.rz(theta, q). Setting theta = Math.PI recovers the corresponding Pauli gate up to global
phase.
Try it
Apply to qubit 0 and verify it matches . The grader compares the full unitary matrix, ignoring global phase. An empty circuit (the identity) will fail — you must actually rotate.
Notice that the unitary of equals . Because global phase is unobservable, the grader accepts this as equivalent to . This is the bridge between the abstract rotation picture and the concrete gate operations you use in circuits.
Sign in on the full site to ask questions and join the discussion.