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
Home/Quantum Physics/Lessons/Pauli-Z Gate
Z

Pauli-Z Gate

PhaseSingle-qubitphase flip

Flips the sign of the ∣1⟩ amplitude without changing ∣0⟩.

Intuition

The Z gate multiplies the ∣1⟩ amplitude by −1 and leaves the ∣0⟩ amplitude alone. If the state is α∣0⟩+β∣1⟩, it becomes α∣0⟩ − β∣1⟩. This sign change is called a phase flip. It does not change measurement probabilities in the computational basis at all, because probabilities depend on the magnitude of the amplitudes, not their signs. The effect only shows up when a later gate (like H) converts the sign difference into a measurable probability change through interference.

Matrix representation
(10​0−1​)
Action on states
∣0⟩→∣0⟩,∣1⟩→−∣1⟩
Bloch sphere
|+⟩
→
|−⟩
Circuit
Open in simulator →
q0HZH
▶ Try it in the simulator
State comparison
Before Z Gate
|+⟩
|0\u27E9
50%
|1\u27E9
50%
Bloch: (1.00, 0.00, 0.00)
→
After Z Gate
|−⟩
|0\u27E9
50%
|1\u27E9
50%
Bloch: (-1.00, 0.00, 0.00)
Full technical statement

Pauli-Z is diagonal in the computational basis (meaning it acts on each basis state independently, without mixing them). Its eigenvalues are +1 for ∣0⟩ and −1 for ∣1⟩. An eigenvalue is the factor a state gets multiplied by when the operator acts on it, and an eigenstate is a state that only gets scaled (not changed in direction) by the operator. Z leaves ∣0⟩ unchanged and multiplies ∣1⟩ by −1. On the Bloch sphere, this is a 180° rotation around the Z axis. Z is Hermitian (equal to its own conjugate transpose) and involutory (Z² = I). Because ∣0⟩ and ∣1⟩ are eigenstates of Z, measuring in the computational basis after Z shows no change. The effect becomes visible only after a basis change, such as applying H.

What changes in measurements

No change to the measurement histogram when measuring in the computational basis immediately after Z.

What stays hidden until later

The relative phase (the sign relationship between the ∣0⟩ and ∣1⟩ amplitudes) flips. A later Hadamard reveals this as a bit flip, because HZH = X.

Bloch sphere

Rotates the Bloch vector 180° around the Z axis. The poles (∣0⟩ and ∣1⟩ stay fixed because they lie on the rotation axis. Equatorial states move to the opposite side of the equator.

Step-by-step example

Hidden phase revealed by interference

  1. 1Start with ∣0⟩. Apply H to get ∣+⟩=(∣0⟩+∣1⟩)/2​.
  2. 2Apply Z. The ∣1⟩ amplitude flips sign. The state becomes (∣0⟩ − ∣1⟩/2​= |−⟩.
  3. 3Measure now. You still see 50/50 outcomes. The phase change is invisible in this basis.
  4. 4Apply H to |−⟩. Hadamard maps |−⟩ to ∣1⟩. Now measurement gives 1 with certainty.
  5. 5The hidden phase flip became a visible bit flip through interference. This is the identity HZH = X in action.
Where this gate appears
  • Phase kickback in oracle-based algorithms like Deutsch’s and Grover’s
  • Building the controlled-Z (CZ) gate for entanglement
  • Interference circuits where a hidden phase steers the final measurement outcome
  • Error correction, where Z errors represent phase-flip errors
Connected gates
  • Z² = I — two phase flips cancel, returning the state to its original form
  • HZH = X — a phase flip becomes a bit flip when you switch to the diagonal basis using Hadamard
  • Z = RZ(π) up to a global phase factor that does not affect measurements
  • CZ is the controlled version of Z and is symmetric between the two qubits
Tempting but wrong

It is tempting to think Z does nothing because the measurement histogram looks unchanged. That sounds reasonable because probabilities depend on amplitude magnitudes, not signs. What actually happens is that Z changes the relative phase, and relative phase is the resource that drives interference in every quantum algorithm.

Why this gate matters for what comes next

Z teaches the central lesson of quantum computing: phase is information. You cannot see it directly in a single measurement, but every quantum algorithm depends on manipulating phase and then using interference to convert phase differences into measurable probability differences.

Test your understanding

You apply Z to a qubit in |0⟩. What changes?

▶ Try it in the simulatorQuick reference →↗ Nielsen and Chuang, Quantum Computation and Quantum Information↗ MIT OCW 8.04: lecture notes
←
Previous
X Gate
Next
Hadamard
→
← Back to all lessons