Side-by-side comparison
Phase Gate vs Z Gate: How 90° and 180° Phase Flips Differ
The Phase (sometimes called S) gate and the Z gate are both diagonal: they leave alone and multiply by a phase. The only difference is how much phase. That difference compounds into two very different roles in quantum circuit design — S is Clifford but order-4, Z is Clifford and its own inverse.
Side by side
| Aspect | Phase Gate (S Gate) | Pauli-Z Gate |
|---|---|---|
| What |1⟩ gets multiplied by | i (a 90° phase rotation). | -1 (a 180° phase rotation). |
| Bloch sphere geometry | Quarter turn around the vertical Z axis. Equatorial states move by 90°. | Half turn around the vertical Z axis. Equatorial states flip to the opposite side. |
| Order (apply N times to get identity) | Order 4 — S · S · S · S = I. Two S gates make a Z. | Order 2 — Z · Z = I. Z is its own inverse. |
| Relation to the other standard gates | S = RZ, and T² = S. S sits between the Clifford Z and the non-Clifford T in the phase ladder. | Z = RZ S². Z is the phase-flip Pauli and is part of the Clifford group. |
| Visible vs hidden effect | Completely invisible until a later basis change (typically H). Measurement probabilities don't change. | Completely invisible until a later basis change. Measurement probabilities don't change. |
| Typical use | Setting up interference patterns that need a 90° phase — for example, phase-kickback mid-circuit, and clock-state preparation. | The phase-flip half of error detection, the Pauli-Z observable in variational algorithms, the diagonal element of the stabilizer group. |
When to reach for which
- Reach for Z when you need a full phase flip — for example, in phase-kickback oracles or as a Pauli measurement basis change.
- Reach for S (Phase) when you need a 90° phase — most often to convert between X-basis and Y-basis measurements or to set up specific interference patterns.
- Two S gates in a row equals a Z; use S · S only when you care about intermediate states. Otherwise Z is simpler.
- For arbitrary phase , use RZ or the parameterized Phase gate rather than stacking S and Z.
- In Clifford-only circuits (e.g. stabilizer simulation), both gates are free operations — neither one drives you into non-Clifford territory.
Common trap
It is tempting to think a phase gate 'does nothing' because measurement in the computational basis gives the same outcome probabilities before and after. What actually happens is the amplitude of rotates in the complex plane. The change is invisible until the next gate brings amplitudes back together — then the phase controls whether they interfere constructively or destructively.