QuantumSimulator
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
Menu
physics
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
simulator
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
wiringStudio
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
HomeLessonsGate comparison
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 ∣0⟩ alone and multiply ∣1⟩ 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.

Phase Gate (S Gate)gatePauli-Z Gategate

Side by side

AspectPhase Gate (S Gate)Pauli-Z Gate
What |1⟩ gets multiplied byi (a 90° phase rotation).-1 (a 180° phase rotation).
Bloch sphere geometryQuarter 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 gatesS = RZ(π/2), 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 effectCompletely 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 useSetting 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 ∣1⟩ 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.

Related

  • Phase Gate (S Gate) gate — full lesson
  • Pauli-Z Gate gate — full lesson
  • Algorithm that uses this pattern: phase kickback
  • Experiment: interference
  • Experiment: phase kickback
  • Browse the full gate reference