Quantum Lab
Quantum Lab

An interactive quantum mechanics learning platform and cryostat wiring co-design tool. From plain-language intuition to formal mathematics.

contact@quantumcircuitsimulator.com

Product

  • Circuit Lab
  • Learn
  • Hardware Studio
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Quantum Lab. All rights reserved.

This site, including its original quantum simulations, cryostat reference systems, 3D models, and interface design, contains protected proprietary material.

Home/Quantum Physics/Lessons/Pauli-Z Gate
Z

Pauli-Z Gate

PhaseSingle-qubitphase flip

Adds a phase flip to |1⟩ without flipping the bit.

Intuition

The Z gate is the subtlest of the basic gates because it does not change measurement probabilities in the computational basis at all. It flips the sign of the |1⟩ amplitude: if your state is α|0⟩ + β|1⟩, it becomes α|0⟩ − β|1⟩. That minus sign is invisible if you measure right away, but it is crucial for interference. The Z gate is the gateway to understanding why phase matters in quantum computing.

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)
Precise explanation

Pauli-Z is diagonal in the computational basis with eigenvalues +1 (for |0⟩) and −1 (for |1⟩). It leaves |0⟩ unchanged and multiplies |1⟩ by −1. This is a 180° rotation around the Z axis of the Bloch sphere. The operator is Hermitian and involutory (Z² = I). Its eigenstates are the computational basis states themselves, which is why a Z measurement in the computational basis shows no change. The effect becomes visible only after a basis change.

Observable effect

Histogram looks unchanged in the computational basis immediately after Z.

Hidden effect

The relative phase flips — a later Hadamard reveals it as a bit flip (HZH = X).

Bloch sphere

Rotates 180° around the Z axis. The poles (|0⟩ and |1⟩) stay fixed. Equatorial states pick up a sign flip, moving to the opposite side of the equator.

Worked example

Hidden phase revealed by interference

  1. 1Start with |0⟩. Apply H to get |+⟩ = (|0⟩ + |1⟩)/√2.
  2. 2Apply Z: the state becomes (|0⟩ − |1⟩)/√2 = |−⟩.
  3. 3If you measure now, you still see 50/50 — the phase change is invisible.
  4. 4Apply H again: |−⟩ maps to |1⟩. Now measurement gives 1 with certainty.
  5. 5The hidden phase became a visible bit flip through interference. This is HZH = X in action.
Common use cases
  • Phase kickback in oracle-based algorithms
  • Building controlled-Z (CZ) for entanglement
  • Interference circuits where hidden phase steers the final outcome
  • Error correction: Z errors are phase-flip errors
Relation to other gates
  • Z² = I — two phase flips cancel
  • HZH = X — a phase flip becomes a bit flip in the Hadamard basis
  • Z = RZ(π) up to global phase
  • CZ is the controlled version and is symmetric between qubits
Common misconception

Because Z does not change computational-basis probabilities, beginners often think it did nothing. The change is in relative phase, and phase is the resource that drives quantum algorithms.

Why this gate matters

Z teaches the most important lesson in quantum computing: phase is information, even when you cannot see it directly. Every quantum algorithm relies on phase manipulation followed by interference to extract results.

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