The Z Gate
The Pauli-Z gate is the third of the three Pauli single-qubit gates. Unlike X, which swaps amplitudes, Z leaves untouched and multiplies the amplitude by :
Its matrix is
Phase, not amplitude
When the qubit is in a basis state or , Z has no effect you can detect by measuring: the probability of each outcome is , and multiplying by does not change the absolute value. This minus sign is called a relative phase.
The effect of Z only becomes observable when the qubit is in a superposition. Apply Z to the equal superposition :
The state has the same measurement probabilities as — both give 0 or 1
with probability — but the relative phase between the two amplitudes has flipped. That
difference matters enormously in interference-based algorithms: a Hadamard applied after Z will
rotate back to , not , demonstrating that the phase is
physically real.
On the Bloch sphere, Z is a rotation by around the -axis: it leaves the north and south poles fixed while flipping the equatorial states and .
Try it
Prepare with a Hadamard, then apply Z to produce . The grader checks the full state vector, so the sign of the amplitude matters.
After running, you should see the amplitude on is and the amplitude on is . Both probabilities are still , confirming that Z changes phase without changing measurement outcomes — unless you look in a basis that is sensitive to the phase.
Sign in on the full site to ask questions and join the discussion.