Pauli Gates as Rotations: X, Y and Z on the Bloch Sphere
Watch the X, Y and Z gates run on a live Bloch sphere. All three are half-turns around an axis, which explains why X flips a qubit, why Z appears to do nothing, and why applying any of them twice gets you back where you started.
In Part 1 the arrow sat still and we learned to read it. Now we move it.
Here is the claim this part defends, and it is the single most useful sentence in single-qubit quantum computing:
Every single-qubit gate is a rotation of the sphere. Not a metaphor for one. An actual rigid rotation, with an axis and an angle.
The three Pauli gates are the simplest case: each is a 180° turn around one of the three coloured axes. That is all they are. Once you see it, X, Y and Z stop being matrices you memorise and become three ways of grabbing the sphere and flipping it over.
X: a half-turn around the red axis
Reset the simulator so the qubit is at |0⟩ and press X. Catch it mid-flight:
The arrow does not teleport from pole to pole. It swings, and it swings around the red X axis, which is pinned in place. Let it finish:
So X takes |0⟩ to |1⟩. That is the “quantum NOT gate” you have read about, and now you can see why it deserves the name and also why the name undersells it: X does not flip a bit, it rotates a sphere, and the bit flip is just what that rotation happens to do to the two poles.
Press X a second time and the arrow completes the circle back to |0⟩:
Every Pauli gate is its own inverse, and on the sphere the reason is trivial arithmetic: two half-turns make a whole turn.
Y: the same trip down a different meridian
Reset and press Y.
Y also ends at the south pole. It takes a different route to get there: X swings the arrow through |−i⟩, Y swings it through |+⟩. But both start at |0⟩ and both finish at |1⟩.
If X and Y do the same thing to |0⟩, are they the same gate? No, and this is a good place to meet a subtlety that the sphere handles gracefully. In the algebra:
X|0⟩ = |1⟩
Y|0⟩ = i|1⟩
Y produces an extra factor of i. That factor is a global phase, and global phase is physically unobservable: no measurement, no interference experiment, nothing can distinguish |1⟩ from i|1⟩. So the two states really are the same state, and the sphere is right to put them in the same place.
The sphere throws away global phase by construction. That is a feature. It means every point you can see corresponds to exactly one physically distinct state, with no redundant copies. The cost is that a picture of the Bloch sphere alone can never show you a global phase, which is fine, because nothing else can either.
X and Y are genuinely different gates, of course. They just happen to agree on the poles. Send them a state on the equator and they diverge immediately.
Z: the gate that does nothing, until it does everything
Reset to |0⟩ and press Z.
Nothing. The arrow does not move a pixel, and the readout is identical.
That is not a bug, and it is the most instructive moment in this whole series. Z is a 180° rotation about the Z axis, and |0⟩ is sitting exactly on the Z axis. Spin a globe about its own polar axis and the north pole does not go anywhere.
This generalises into a rule worth more than any matrix identity:
A gate does nothing to the states that lie on its own rotation axis. Those states are the gate’s eigenstates.
Z leaves |0⟩ and |1⟩ alone. X leaves |+⟩ and |−⟩ alone. Y leaves |i⟩ and |−i⟩ alone. If you have ever had to memorise which states are eigenstates of which Pauli, you can now stop: they are the two states at the ends of that gate’s axis, and you can read them straight off the picture.
To make Z do something, give it a state that is not on its axis. Jump to |+⟩ and press Z:
Now Z is doing plenty. It has taken |+⟩ to |−⟩, a completely different state, by adding 180° to φ.
And note what did not change: the latitude, and therefore the measurement probabilities. Before the Z gate, |+⟩ measures 50/50. After it, |−⟩ measures 50/50. Z is a pure phase gate. It rearranges phase and leaves the odds untouched, which is precisely why Z-type gates are the workhorses of interference-based algorithms. A phase kickback is a Z rotation someone else paid for.
The whole family in one line
The pattern is now readable off the sphere:
| Gate | Rotation | Fixes (eigenstates) | Effect on the poles |
|---|---|---|---|
| X | 180° about the X axis | |+⟩, |−⟩ | swaps them |
| Y | 180° about the Y axis | |i⟩, |−i⟩ | swaps them (with a phase) |
| Z | 180° about the Z axis | |0⟩, |1⟩ | leaves them alone |
Verifying all of it in Qiskit
The sphere is a picture. Here are the same claims as arithmetic.
import numpy as np
from qiskit.quantum_info import Statevector, Operator
X = Operator.from_label("X")
Y = Operator.from_label("Y")
Z = Operator.from_label("Z")
zero = Statevector([1, 0])
plus = Statevector(np.array([1, 1]) / np.sqrt(2))
print("X|0> =", zero.evolve(X).data) # -> |1>
print("Y|0> =", zero.evolve(Y).data) # -> i|1>, same point on the sphere
print("Z|0> =", zero.evolve(Z).data) # -> |0>, untouched
print("Z|+> =", np.round(plus.evolve(Z).data, 3)) # -> |->
X|0> = [0.+0.j 1.+0.j]
Y|0> = [0.+0.j 0.+1.j]
Z|0> = [1.+0.j 0.+0.j]
Z|+> = [ 0.707+0.j -0.707+0.j]
Y|0> is [0, i], the extra factor of i that the sphere ignores. Qiskit agrees that ignoring it is legitimate. Its equiv check compares states up to global phase, and it says these two are the same physical state:
one = Statevector([0, 1])
print("i|1> is the same physical state as |1> ?", Statevector([0, 1j]).equiv(one))
i|1> is the same physical state as |1> ? True
And the two structural facts, that each Pauli squares to the identity and fixes its own axis:
for name, gate in [("X", X), ("Y", Y), ("Z", Z)]:
squares_to_identity = np.allclose(gate.compose(gate).data, np.eye(2))
print(f"{name}{name} = I ? {squares_to_identity}")
# Eigenstates sit at the ends of the gate's own axis.
minus = Statevector(np.array([1, -1]) / np.sqrt(2))
print("X fixes |+> ?", plus.evolve(X).equiv(plus))
print("X fixes |-> ?", minus.evolve(X).equiv(minus))
print("Z fixes |0> ?", zero.evolve(Z).equiv(zero))
print("Z moves |+> ?", not plus.evolve(Z).equiv(plus))
XX = I ? True
YY = I ? True
ZZ = I ? True
X fixes |+> ? True
X fixes |-> ? True
Z fixes |0> ? True
Z moves |+> ? True
Where this is going
Three gates, three axes, one angle: 180°. That is the entire Pauli family, and the sphere makes every one of their properties obvious rather than memorable.
Two questions should be nagging now. First, what if the rotation axis is not one of the three coloured ones? Second, what if the angle is not 180°? Those are exactly the Hadamard, S and T gates, and they are next.
Try it yourself: Interactive Bloch Sphere
Open full screen ↗Apply X, Y, Z, H, S, T, and rotation gates and watch the qubit state rotate in 3D in real time. It runs entirely in your browser, no signup or install.
Was this tutorial helpful?