Adds a phase flip to |1⟩ without flipping the bit.
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.
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.
Histogram looks unchanged in the computational basis immediately after Z.
The relative phase flips — a later Hadamard reveals it as a bit flip (HZH = X).
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.
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.
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.
You apply Z to a qubit in |0⟩. What changes?