Quantum
Module 3 · Single-qubit gates · Lesson 1

The Pauli gates: X, Y, Z

Three gates you already met — now we take them seriously. The Pauli gates are the alphabet every other single-qubit gate is written in.

10 min read · Lesson 8 of 32

You’ve already clicked the X, Y, and Z buttons in the Hadamard lesson. Now we look at them properly. These three are the Pauli gates, named after Wolfgang Pauli. They are the three “natural” gates for a spin-12\frac{1}{2} system, and every other single-qubit gate you will ever see can be written as a combination of them.

If single-qubit gates are words, the Paulis are the letters.

The three gates

Here they are, with matrices and Bloch-sphere interpretations:

Pauli-X — the quantum bit flip:

X=(0110)X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}

XX swaps 0|0\rangle and 1|1\rangle. Geometrically, it’s a rotation of π\pi around the xx-axis of the Bloch sphere. It’s the quantum version of the classical NOT gate.

Pauli-Y — the “both at once” flip:

Y=(0ii0)Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}

YY also swaps 0|0\rangle and 1|1\rangle, but it also multiplies the amplitudes by ±i\pm i. Geometrically, it’s a rotation of π\pi around the yy-axis. Notice that Y=iXZY = iXZ — it’s “X and Z combined,” with a global phase.

Pauli-Z — the phase flip:

Z=(1001)Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}

ZZ leaves 0|0\rangle alone and multiplies 1|1\rangle by 1-1. Looking at the computational-basis probabilities, nothing happens — Z0=0Z|0\rangle = |0\rangle and Z1=1Z|1\rangle = -|1\rangle (which is still 1|1\rangle up to global phase). But on a superposition, ZZ introduces a minus sign between the two components — and that relative phase is very visible. Geometrically, it’s a rotation of π\pi around the zz-axis.

See them in action

Click through the three gates below. Start from 0|0\rangle. Try applying each Pauli on its own. Then try combinations.

Some things to notice as you play:

  1. Apply XX. The qubit flips from 0|0\rangle to 1|1\rangle. Apply XX again — back to 0|0\rangle. So X2=IX^2 = I. Same for Y2=IY^2 = I and Z2=IZ^2 = I.
  2. Start from 0|0\rangle and apply ZZ. Nothing seems to change — the Bloch sphere still points at the north pole. That’s because Z0=0Z|0\rangle = |0\rangle: the 0|0\rangle state is an eigenstate of ZZ with eigenvalue +1+1.
  3. Apply HH first (making +|+\rangle), then ZZ. Now look at the Bloch sphere — the arrow has moved from +|+\rangle to |-\rangle. The ZZ gate, invisible on 0|0\rangle alone, is very visible on superpositions.
  4. Try HXHHXH. You should get ZZ. Try HZHHZH. You should get XX. This is a crucial identity: the Hadamard swaps XX and ZZ.

A useful identity: anticommutation

The Pauli gates don’t commute with each other. They do something stronger — they anticommute:

XY=YXYZ=ZYZX=XZXY = -YX \qquad YZ = -ZY \qquad ZX = -XZ

Each pair of Paulis, when you swap the order, picks up a minus sign. This is another way of saying that the three Bloch-sphere axes are mutually perpendicular — a rotation around xx followed by a rotation around yy is different from the other way around.

You can also write the three Pauli relations in a compact form: for any two different Paulis P,Q{X,Y,Z}P, Q \in \{X, Y, Z\},

PQ=iRPQ = iR

where RR is the third Pauli, following the cyclic order XYZXX \to Y \to Z \to X. For example, XY=iZXY = iZ, YZ=iXYZ = iX, ZX=iYZX = iY.

Quick check
What does Pauli-X do to |0⟩?
Quick check
Does Pauli-Z change the measurement probabilities of |0⟩ in the computational basis?
Quick check
Compute: HZH in matrix form. What gate is this equal to?

Why ‘Pauli’?

In 1925, Wolfgang Pauli wrote down three matrices to describe the spin of an electron — a genuinely quantum property with no classical analog. Those matrices are exactly XX, YY, ZZ. The same three operators that describe a spin-12\frac{1}{2} particle’s behavior describe a qubit, because a qubit is — from a mathematical standpoint — a spin-12\frac{1}{2} system. The words “qubit” and “spin” are almost interchangeable if you squint.

What’s next

The Paulis are three “big steps” — each a rotation of exactly π\pi. In Lesson 3.3 we meet the phase gates SS and TT: smaller, more subtle rotations around the zz-axis. Then in Lesson 3.4 we make those rotations continuous — you’ll get a slider and be able to rotate by any angle you like.