The Pauli-Z gate
Pauli-Z is the phase flip. It leaves alone and puts a minus sign on . It never changes the odds of measuring 0 or 1, yet it changes the state: it turns into .
On the Bloch sphere, Z turns the whole sphere 180° about z.
The matrix
Z keeps the amplitude of and flips the sign of the amplitude of :
The sizes stay the same, so the probabilities do too. Only the relative phase changes, by 180°.
As a rotation
The factor in front is a global phase: it changes the matrix but not what any measurement sees, so Z and turn the sphere the same way. See rotation gates.
What it does to the six key states
| Before | After Z | On the sphere |
|---|---|---|
| stays put | ||
| stays put | ||
| +x → −x | ||
| −x → +x | ||
| +y → −y | ||
| −y → +y |
A factor in front of a result, such as a minus sign or , is a global phase: the arrow lands on the named state all the same.
Nothing moves at the poles
and lie on the z axis, so Z leaves them in place. is the same point as : the minus sign is a global phase. Apply Z to in the app and nothing moves; the Gate panel points out that the qubit is on the rotation axis.
A change you can't measure directly
Because Z keeps the height of the arrow, measuring right after Z gives the same odds as before. To see what Z did, turn the sphere so the phase becomes a height: a Hadamard gate does that. Sandwiched between two Hadamards, Z becomes a bit flip:
That's the idea behind many quantum algorithms: work on phases, where gates can make amplitudes add up or cancel, then turn the phases into something a measurement can see.