Pauli Gates (X, Y, Z)

The Pauli gates are the three elementary operations you can perform on a single qubit — and, deliberately, they are the same three matrices XX, YY, ZZ that already served as the qubit's canonical observables. The move from observable to gate is the subject of this article. As a gate, a Pauli is read for what it does to a state rather than what it measures: XX swaps ∣0⟩|0\rangle and ∣1⟩|1\rangle, the exact quantum copy of the classical NOT; ZZ leaves the computational basis alone but stamps a minus sign on ∣1⟩|1\rangle, a phase-flip with no classical analogue; and Y=iXZY=iXZ does both at once. Each is a 180∘180^\circ turn of the Bloch sphere about its named axis, which is why the Paulis are the coarsest, most-used single-qubit gates in every quantum circuit. Three consequences organize what follows. First, because each Pauli squares to the identity, every one is its own inverse — a property no other non-trivial rotation shares. Second, exponentiating a Pauli gives a continuous rotation Rn^(θ)=e−iθ n^⋅σ⃗/2R_{\hat n}(\theta)=e^{-i\theta\,\hat n\cdot\vec\sigma/2}, so the discrete XX, YY, ZZ are the θ=π\theta=\pi endpoints of the tunable rotation gates a real machine fires. Third — the payload that makes fault-tolerant computing conceivable — any single-qubit error expands over {I,X,Y,Z}\{I,X,Y,Z\}, so a code that corrects a bit-flip, a phase-flip, and their product corrects everything. The Paulis also seed the two-qubit entanglers: CNOT is a controlled-XX, CZ a controlled-ZZ, and a pair of Hadamards turns one into the other. This article treats the Paulis strictly as gates; their life as an operator basis and the uncertainty relations they encode is developed in the companion article on Pauli operators.

Key takeaways
  • The Pauli gates XX, YY, ZZ are the three non-trivial single-qubit unitaries: XX is the bit-flip (quantum NOT), ZZ the phase-flip, and Y=iXZY=iXZ both together.
  • On the Bloch sphere each is a 180∘180^\circ (π\pi) rotation about its axis, so X=iRx(π)X=iR_x(\pi), Y=iRy(π)Y=iR_y(\pi), Z=iRz(π)Z=iR_z(\pi) up to a physically irrelevant global phase.
  • Every Pauli gate is its own inverse, X2=Y2=Z2=IX^2=Y^2=Z^2=I — applying it twice restores the state.
  • Conjugation reshuffles them: the Hadamard swaps X↔ZX\leftrightarrow Z (HXH=ZHXH=Z), the phase gate sends X→YX\to Y (SXS†=YSXS^\dagger=Y), and an XX pulse reverses a ZZ rotation (XZX=−ZXZX=-Z).
  • Any single-qubit error is a combination E=c0I+cxX+cyY+czZE=c_0I+c_xX+c_yY+c_zZ, so correcting the three Pauli errors corrects all continuous noise — the discretization theorem behind quantum error correction.
  • The controlled-Paulis are the workhorse entanglers: CNOT is a controlled-XX, CZ a controlled-ZZ, and (I⊗H) CNOT (I⊗H)=CZ(I\otimes H)\,\text{CNOT}\,(I\otimes H)=\text{CZ}.
  • Key idea: the Pauli gates are the three π\pi-rotations of the Bloch sphere — bit-flip XX, phase-flip ZZ, and both-at-once YY — self-inverse endpoints of the continuous rotation gates, interconverted by Clifford conjugation, and the discrete alphabet into which every continuous single-qubit error is compiled.
The core insight

The Pauli gates XX, YY, ZZ are the three π\pi-rotations of the Bloch sphere — the bit-flip, the phase-flip, and their product — each its own inverse, each the θ=π\theta=\pi endpoint of a continuous rotation gate, all interconverted by Clifford conjugation, and together the discrete basis into which any continuous single-qubit error is compiled for correction.

Where this lives today

The Pauli gates are the working vocabulary of every quantum processor now being built. On superconducting and trapped-ion hardware the bit-flip XX and its partner YY are delivered as calibrated resonant microwave π\pi-pulses, while the phase-flip ZZ and its rotations run "virtually" — a zero-duration relabelling of the rotating frame, because Rz(θ)R_z(\theta) only shifts the phase of later pulses. Sequences of Pauli π\pi-pulses fight decoherence: the spin echo generalizes to the CPMG and XY-4 dynamical-decoupling trains, strings of XX and YY gates timed to average away dephasing and stretch coherence by orders of magnitude. Calibration speaks Pauli too — randomized benchmarking interleaves random Clifford gates to measure average gate error, and Pauli twirling converts coherent errors into a benign stochastic Pauli channel. And fault tolerance is Pauli all the way down: the surface codes Google and IBM are racing to scale are stabilizer codes whose parity checks are tensor products of XX's and ZZ's, whose syndromes discretize continuous noise into the four Pauli errors of Shor's theorem, and whose entangling layers are CNOT or CZ gates. The open frontier — pushing physical error rates below threshold and decoding syndromes in real time — is stated and solved entirely in the gate algebra Pauli wrote down in 1927.

The physical picture

Treat the qubit's state as a unit arrow on the Bloch sphere. A Pauli gate does not read the arrow — it moves it, by exactly half a turn about a fixed axis. XX is a 180∘180^\circ rotation about x^\hat x: it carries the north pole ∣0⟩|0\rangle to the south pole ∣1⟩|1\rangle and back — the bit-flip — and sends a general Bloch vector (x,y,z)(x,y,z) to (x,−y,−z)(x,-y,-z). ZZ is the same half-turn about z^\hat z: the poles are fixed as states, but every equatorial point is spun halfway round, sending ∣+⟩|+\rangle to ∣−⟩|-\rangle — a phase-flip that only shows up under superposition. YY is the half-turn about y^\hat y, and because Y=iXZY=iXZ it flips the bit while imprinting the phase. The first figure draws all three as rotations of one sphere.

Figure
The three Pauli gates as π-rotations of the Bloch sphere: X is a 180° turn about x̂ that swaps the poles 0 and 1 (the bit-flip), Z is a 180° turn about ẑ that fixes the poles but exchanges the equatorial states + and − (the phase-flip), and Y = iXZ turns about ŷ to do both — each is its own inverse because a second half-turn completes the full 360°
Pauli gates = half-turns of the Bloch sphere: X swaps poles, Z flips the equator, Y both |0⟩ |1⟩ x̂ |+⟩ ŷ |+i⟩ Z: π about ẑ X = bit-flip: X|0⟩ = |1⟩, X|1⟩ = |0⟩ Z = phase-flip: Z|+⟩ = |−⟩ Y = iXZ: Y|0⟩ = i|1⟩ Each is a half-turn, so a second application completes 360°: X² = Y² = Z² = I Continuous version: X = i R_x(π), θ = π endpoint of R_x(θ) = e^(−iθX/2)

Because each gate is exactly half of a full turn, doing it twice completes the 360∘360^\circ and returns the arrow home: X2=Y2=Z2=IX^2=Y^2=Z^2=I. This involution property is special — a 73∘73^\circ rotation has no such luck — making a Pauli gate its own undo button, its own decoder, and its own error. The discrete Paulis are also the tips of a continuous family: a real device does not fire a perfect XX but a resonant pulse implementing Rx(θ)=e−iθX/2R_x(\theta)=e^{-i\theta X/2} for a calibrated duration, with the bit-flip the θ=π\theta=\pi setting. So a slightly mis-timed pulse produces a slightly-off Pauli — a coherent error that the error-correction machinery still handles by discretizing it. The second figure shows this in the setting a hardware engineer meets first: the spin echo, where an XX pulse dropped into the middle of a dephasing evolution reverses the accumulated phase and erases it — a direct, numerical use of the identity XZX=−ZXZX=-Z.

Figure
The spin echo, a Pauli gate erasing an unknown phase: a qubit accumulates a Z-rotation phase φ that grows to +0.70 rad over the first half of the sequence, then a single X π-pulse flips the sign to −0.70 rad, and the same evolution winds it back to 0.00 at the echo — the refocusing works for any φ because X R_z(φ) X = R_z(−φ)
Spin echo: an X π-pulse reverses the accumulated phase — net phase = 0.00 for any φ +0.70 0.00 −0.70 phase φ (rad) X π-pulse flips sign start φ = 0 φ = +0.70 → −0.70 echo: φ = 0.00 free evolution R_z(φ) free evolution R_z(φ)

The core equations

Everything starts from the explicit matrices in the computational basis, with the ordering ∣0⟩=(1,0)T|0\rangle=(1,0)^T, ∣1⟩=(0,1)T|1\rangle=(0,1)^T fixing rows and columns.

X=(0110),Y=(0−ii0),Z=(100−1),I=(1001)(1)X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\quad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\quad I=\begin{pmatrix}1&0\\0&1\end{pmatrix} \qquad (1)

where: X,Y,ZX,Y,Z — the three Pauli gates, also written σx,σy,σz\sigma_x,\sigma_y,\sigma_z; II — the identity (the "do-nothing" gate); ii — imaginary unit, i2=−1i^2=-1. Reading: each is unitary (σ†σ=I\sigma^\dagger\sigma=I), so a legal gate, and also Hermitian, so it doubles as an observable — a coincidence unique to the Paulis. Applying the matrices to the basis kets defines each gate's name and shows why XX is a NOT, ZZ a phase-flip, and YY both.

X∣0⟩=∣1⟩, X∣1⟩=∣0⟩;Z∣0⟩=∣0⟩, Z∣1⟩=−∣1⟩;Y∣0⟩=i∣1⟩, Y∣1⟩=−i∣0⟩(2)X|0\rangle=|1\rangle,\ X|1\rangle=|0\rangle;\quad Z|0\rangle=|0\rangle,\ Z|1\rangle=-|1\rangle;\quad Y|0\rangle=i|1\rangle,\ Y|1\rangle=-i|0\rangle \qquad (2)

where: XX — bit-flip, permutes the basis like classical NOT; ZZ — phase-flip, fixes ∣0⟩|0\rangle and sends ∣1⟩→−∣1⟩|1\rangle\to-|1\rangle; YY — combined flip, Y=iXZY=iXZ. Reading: ZZ is diagonal because the poles stay put (only a phase changes), while XX and YY are off-diagonal because they move amplitude between the poles. Exponentiating a Pauli generates a continuous rotation of the Bloch sphere, whose half-turn endpoints are the discrete gates — the bridge to the tunable gates a machine runs.

Rn^(θ)=e−iθ n^⋅σ⃗/2=cos⁡θ2 I−isin⁡θ2 (n^⋅σ⃗),X=iRx(π), Y=iRy(π), Z=iRz(π)(3)R_{\hat n}(\theta)=e^{-i\theta\,\hat n\cdot\vec\sigma/2}=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,(\hat n\cdot\vec\sigma),\qquad X=iR_x(\pi),\ Y=iR_y(\pi),\ Z=iR_z(\pi) \qquad (3)

where: n^\hat n — unit vector naming the rotation axis; σ⃗=(X,Y,Z)\vec\sigma=(X,Y,Z) — the vector of Paulis; θ\theta — rotation angle; the leading ii — a global phase relating the gate to the pure rotation. Reading: the cosine/sine form exists because (n^⋅σ⃗)2=I(\hat n\cdot\vec\sigma)^2=I; at θ=π\theta=\pi the cosine vanishes and Rn^(π)=−i(n^⋅σ⃗)R_{\hat n}(\pi)=-i(\hat n\cdot\vec\sigma), the Pauli up to phase. The single product identity below packs the entire gate algebra — squares, cyclic products, anticommutation — into one line that powers every simplification of a Pauli circuit.

σjσk=δjk I+i∑lϵjkl σl⇒X2=Y2=Z2=I,  XY=iZ,  {σj,σk}=2δjkI(4)\sigma_j\sigma_k=\delta_{jk}\,I+i\sum_l\epsilon_{jkl}\,\sigma_l\quad\Rightarrow\quad X^2=Y^2=Z^2=I,\ \ XY=iZ,\ \ \{\sigma_j,\sigma_k\}=2\delta_{jk}I \qquad (4)

where: δjk\delta_{jk} — Kronecker delta; ϵjkl\epsilon_{jkl} — Levi-Civita symbol (+1+1 cyclic in x,y,zx,y,z); { , }\{\,,\,\} — anticommutator AB+BAAB+BA. Reading: equal indices give II (each gate is self-inverse); distinct indices give the cyclic products XY=iZXY=iZ, YZ=iXYZ=iX, ZX=iYZX=iY and the fact that distinct Paulis anticommute. Conjugating a Pauli by a Clifford gate maps it to another Pauli — the grammar of circuit rewriting: moving a gate past a Hadamard, reversing a phase with a bit-flip, converting one entangler into another.

HXH=Z,HZH=X,HYH=−Y,SXS†=Y,XZX=−Z(5)HXH=Z,\quad HZH=X,\quad HYH=-Y,\quad SXS^\dagger=Y,\quad XZX=-Z \qquad (5)

where: HH — Hadamard gate, 12(111−1)\tfrac1{\sqrt2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right); S=diag(1,i)=ZS=\mathrm{diag}(1,i)=\sqrt{Z} — the phase gate; †\dagger — Hermitian conjugate. Reading: HH swaps the bit-flip and phase-flip axes, SS sends XX to YY, and sandwiching a ZZ between two XX's reverses its sign — the heart of the spin echo. Because {I,X,Y,Z}\{I,X,Y,Z\} spans every 2×22\times2 matrix, an arbitrary single-qubit error is a Pauli combination, and the controlled-Paulis are the standard entanglers — carrying the gates into error correction and multi-qubit circuits.

E=c0I+cxX+cyY+czZ,CNOT=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X(6)E=c_0I+c_xX+c_yY+c_zZ,\qquad \text{CNOT}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X \qquad (6)

where: EE — any single-qubit operator (an error, a Hamiltonian, a channel element); cμc_\mu — complex coefficients; CNOT — controlled-XX, flipping the target iff the control is ∣1⟩|1\rangle; replacing XX by ZZ gives the controlled-ZZ (CZ). Reading: a syndrome projects the continuous error EE onto one discrete Pauli, and (I⊗H) CNOT (I⊗H)=CZ(I\otimes H)\,\text{CNOT}\,(I\otimes H)=\text{CZ} by identity (5).

Derivation AThe bit-flip as a π rotation about the x axis

The goal is to establish, from the matrix alone, that the Pauli XX is at once the exact quantum copy of the classical NOT gate and a 180∘180^\circ rotation of the Bloch sphere about x^\hat x, differing from the pure rotation Rx(π)R_x(\pi) only by a global phase ii that no measurement can ever detect. We read the bit-flip off the basis action, exponentiate the generator to get the rotation, then confront the leftover phase and show why it is physically inert — why a compiler may drop such phases on a single qubit.

Step 1. Act on the basis kets. With ∣0⟩=(1,0)T|0\rangle=(1,0)^T and ∣1⟩=(0,1)T|1\rangle=(0,1)^T, multiplication by X=(0110)X=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right) swaps the entries, giving X∣0⟩=∣1⟩X|0\rangle=|1\rangle and X∣1⟩=∣0⟩X|1\rangle=|0\rangle; on α∣0⟩+β∣1⟩\alpha|0\rangle+\beta|1\rangle it exchanges the amplitudes. Why: this is precisely the truth table of the classical NOT, extended by linearity to superpositions — the sense in which XX is "the quantum NOT."

Step 2. Exponentiate the generator. Using equation (3) with n^=x^\hat n=\hat x and θ=π\theta=\pi, and cos⁡π2=0\cos\tfrac\pi2=0, sin⁡π2=1\sin\tfrac\pi2=1, we get Rx(π)=e−iπX/2=cos⁡π2 I−isin⁡π2 X=−iXR_x(\pi)=e^{-i\pi X/2}=\cos\tfrac\pi2\,I-i\sin\tfrac\pi2\,X=-iX. Inverting, X=iRx(π)X=iR_x(\pi). Why: this identifies the discrete gate as the θ=π\theta=\pi endpoint of the continuous rotation family the hardware fires, so a bit-flip is literally a half-turn pulse about the x^\hat x-axis of the rotating frame.

Step 3. Dispose of the global phase. The gate XX and the rotation Rx(π)R_x(\pi) differ by the scalar i=eiπ/2i=e^{i\pi/2}, which multiplies the entire state and cancels in every probability ∣⟨ϕ∣ψ⟩∣2|\langle\phi|\psi\rangle|^2 and expectation ⟨ψ∣A∣ψ⟩\langle\psi|A|\psi\rangle — so it is unobservable on an isolated qubit. Why: a designer may treat XX and Rx(π)R_x(\pi) as the same gate; the distinction only resurfaces when the phase becomes relative, as on the controlled branch of a two-qubit gate. *Verified: X∣0⟩=∣1⟩X|0\rangle=|1\rangle, X2=IX^2=I, and iRx(π)=i(−iX)=XiR_x(\pi)=i(-iX)=X confirmed by direct matrix computation; matches Nielsen and Chuang Eqs. (4.4)–(4.6).*

Go deeper · Derivation B · 1 minAny single-qubit error is a combination of Pauli gates
Derivation BAny single-qubit error is a combination of Pauli gates

The aim is to prove the discretization theorem that underwrites all of quantum error correction: although qubit noise is a continuum — small over-rotations, partial decoherence, amplitude damping — every error operator lies in the four-dimensional span of {I,X,Y,Z}\{I,X,Y,Z\}, so a code that reverses a bit-flip XX, a phase-flip ZZ, and their product YY automatically reverses all of it. We show the span is complete, expand a generic error, and invoke the syndrome measurement that collapses the continuum onto a single discrete Pauli.

Step 1. Establish completeness. The four matrices {I,X,Y,Z}\{I,X,Y,Z\} are linearly independent, matching the complex dimension of the space of 2×22\times2 matrices, and orthogonal under the trace inner product, Tr⁡(σjσk)=2δjk\operatorname{Tr}(\sigma_j\sigma_k)=2\delta_{jk}. Hence any single-qubit operator is E=c0I+cxX+cyY+czZE=c_0I+c_xX+c_yY+c_zZ with cμ=12Tr⁡(σμE)c_\mu=\tfrac12\operatorname{Tr}(\sigma_\mu E). Why: this turns "protect against every possible error," an uncountable task, into "handle four basis errors," a finite one.

Step 2. Apply the error to an encoded state. A code stores a logical qubit as ∣ψˉ⟩|\bar\psi\rangle in a subspace stabilized by Pauli checks. The corrupted state E∣ψˉ⟩=c0∣ψˉ⟩+cxX∣ψˉ⟩+cyY∣ψˉ⟩+czZ∣ψˉ⟩E|\bar\psi\rangle=c_0|\bar\psi\rangle+c_x X|\bar\psi\rangle+c_y Y|\bar\psi\rangle+c_z Z|\bar\psi\rangle is a superposition of the clean state and its three Pauli-shifted copies. Why: each Pauli commutes or anticommutes cleanly with every stabilizer, moving the code state into orthogonal syndrome sectors a measurement can tell apart.

Step 3. Measure the syndrome. Reading the stabilizer checks projects the superposition onto one branch — "no error," "XX," "YY," or "ZZ" — collapsing the continuous coefficients cμc_\mu into a single discrete outcome, which the named Pauli then undoes. Why: the measurement discretizes the noise; you never need the cμc_\mu, only which of the four sectors the state landed in, and correcting those four corrects their whole span. *Verified: {I,X,Y,Z}\{I,X,Y,Z\} orthogonal under Tr⁡(σjσk)=2δjk\operatorname{Tr}(\sigma_j\sigma_k)=2\delta_{jk} and complete on 2×22\times2 matrices; the expansion E=12∑μTr⁡(σμE)σμE=\tfrac12\sum_\mu\operatorname{Tr}(\sigma_\mu E)\sigma_\mu reproduces any test matrix, checked on E=(122−1)=2X+ZE=\left(\begin{smallmatrix}1&2\\2&-1\end{smallmatrix}\right)=2X+Z. Consistent with Nielsen and Chuang Ch. 10.*

Go deeper · Derivation C · 1 minTurning a controlled-NOT into a controlled-Z with Hadamards
Derivation CTurning a controlled-NOT into a controlled-Z with Hadamards

The purpose is to derive one of the most-used circuit identities — that conjugating the target of a controlled-NOT by Hadamard gates converts it into a controlled-ZZ — and to trace the conversion to the single Clifford fact HXH=ZHXH=Z. Because CZ is symmetric between its qubits while CNOT is not, this is also how a compiler picks which native two-qubit gate to run while still realizing the operation it wanted. We write both controlled gates in projector form, conjugate term by term, and read off the result.

Step 1. Write CNOT with the control on the first qubit as a sum over the control's projectors: CNOT=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X\text{CNOT}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X — do nothing to the target when the control is ∣0⟩|0\rangle, apply XX when it is ∣1⟩|1\rangle. The controlled-ZZ is the same with ZZ in place of XX: CZ=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z\text{CZ}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z. Why: the projector form isolates the target operation (II or XX) so that conjugating only the target qubit acts on it alone.

Step 2. Conjugate the target by Hadamard — sandwich the whole gate between I⊗HI\otimes H on both sides. Since HH acts only on the second factor, it passes through the control projectors untouched and hits the target operators: (I⊗H)CNOT(I⊗H)=∣0⟩⟨0∣⊗HIH+∣1⟩⟨1∣⊗HXH(I\otimes H)\text{CNOT}(I\otimes H)=|0\rangle\langle0|\otimes HIH+|1\rangle\langle1|\otimes HXH. Why: the control register is a spectator, so the identity reduces to what HH does to the target's II and XX.

Step 3. Evaluate the conjugations: HIH=H2=IHIH=H^2=I and, from identity (5), HXH=ZHXH=Z. Substituting gives ∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z=CZ|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z=\text{CZ}. Why: the whole conversion rests on the Hadamard swapping the bit-flip axis for the phase-flip axis — the same HXH=ZHXH=Z that lets you measure XX by applying HH and measuring ZZ. *Verified: (I⊗H) CNOT (I⊗H)=diag(1,1,1,−1)=CZ(I\otimes H)\,\text{CNOT}\,(I\otimes H)=\text{diag}(1,1,1,-1)=\text{CZ} by direct 4×44\times4 matrix multiplication; HXH=ZHXH=Z, HIH=IHIH=I checked exactly.*

Limiting cases

The gates differ only in which Bloch axis they turn about; the table collects the actions worth memorizing.

CaseResultMeaning
Bit-flip XXX∣0⟩=∣1⟩, X∣1⟩=∣0⟩X|0\rangle=|1\rangle,\ X|1\rangle=|0\ranglepermutes the computational basis like classical NOT; a π\pi-rotation about x^\hat x
Phase-flip ZZZ∣0⟩=∣0⟩, Z∣1⟩=−∣1⟩Z|0\rangle=|0\rangle,\ Z|1\rangle=-|1\ranglefixes the poles as states, stamps −1-1 on ∣1⟩|1\rangle; a π\pi-rotation about z^\hat z
Both, YYY∣0⟩=i∣1⟩, Y∣1⟩=−i∣0⟩Y|0\rangle=i|1\rangle,\ Y|1\rangle=-i|0\rangleY=iXZY=iXZ; a π\pi-rotation about y^\hat y, bit-flip with a phase
XX in the Hadamard basisX∣+⟩=∣+⟩, X∣−⟩=−∣−⟩X|+\rangle=|+\rangle,\ X|-\rangle=-|-\rangleXX is diagonal on ∣±⟩|\pm\rangle — it is the "phase-flip" there, mirroring ZZ on the standard basis
Applied twiceσ2=I\sigma^2=Ievery Pauli gate is its own inverse; a second application undoes the first exactly

Worked examples

1 · The spin echo — a Pauli gate that erases an unknown phase (fully worked)

A qubit on the equator undergoes free evolution applying an unknown ZZ-rotation Rz(φ)R_z(\varphi) (dephasing). Show that inserting a single XX gate and repeating the evolution refocuses the phase to zero, and check it for φ=0.70\varphi=0.70 rad.

Step 1. Write the sequence in time order — evolve, flip, evolve — as U=Rz(φ) X Rz(φ)U=R_z(\varphi)\,X\,R_z(\varphi) (last-applied gate leftmost); we show UU is independent of φ\varphi. The tool is identity (5), XZX=−ZXZX=-Z.

Step 2. Promote XZX=−ZXZX=-Z to the exponential. Sandwiching the generator flips its sign, so X Rz(φ) X=X e−iφZ/2 X=e−iφ(XZX)/2=e+iφZ/2=Rz(−φ)X\,R_z(\varphi)\,X=X\,e^{-i\varphi Z/2}\,X=e^{-i\varphi (XZX)/2}=e^{+i\varphi Z/2}=R_z(-\varphi). Equivalently Rz(φ) X=X Rz(−φ)R_z(\varphi)\,X=X\,R_z(-\varphi). An XX pulse reverses the sense of a ZZ-rotation.

Step 3. Collapse the sequence: U=Rz(φ) X Rz(φ)=X Rz(−φ) Rz(φ)=X Rz(0)=XU=R_z(\varphi)\,X\,R_z(\varphi)=X\,R_z(-\varphi)\,R_z(\varphi)=X\,R_z(0)=X. The dephasing has completely cancelled, leaving only the intended bit-flip, for every value of φ\varphi.

Step 4. Check at φ=0.70\varphi=0.70 rad, so φ/2=0.35\varphi/2=0.35. Then Rz(0.70)=diag(e−i0.35,e+i0.35)R_z(0.70)=\mathrm{diag}(e^{-i0.35},e^{+i0.35}) with e∓i0.35=0.9394∓0.3429ie^{\mp i0.35}=0.9394\mp0.3429i. Multiplying out, the off-diagonal entries of UU pick up the product e−i0.35 e+i0.35=1e^{-i0.35}\,e^{+i0.35}=1 exactly, giving U=(0110)=XU=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)=X. The phases ±0.35\pm0.35 rad annihilate; the echo is perfect regardless of φ\varphi — the principle behind Hahn's spin echo.

2 · Converting a CNOT into a controlled-Z (fully worked)

Your hardware natively runs a controlled-ZZ, but your algorithm calls for a CNOT. Build the CNOT from a CZ plus single-qubit gates, and verify on ∣1⟩∣1⟩|1\rangle|1\rangle.

Step 1. Invert the identity of Derivation C. From (I⊗H) CNOT (I⊗H)=CZ(I\otimes H)\,\text{CNOT}\,(I\otimes H)=\text{CZ} and H2=IH^2=I, sandwich both sides again to solve for CNOT: CNOT=(I⊗H) CZ (I⊗H)\text{CNOT}=(I\otimes H)\,\text{CZ}\,(I\otimes H). A CNOT is a CZ wrapped in two Hadamards on the target.

Step 2. Track ∣1⟩∣1⟩|1\rangle|1\rangle through the circuit. First I⊗HI\otimes H sends the target ∣1⟩→∣−⟩|1\rangle\to|-\rangle. Then CZ, with control ∣1⟩|1\rangle, applies ZZ to the target: Z∣−⟩=∣+⟩Z|-\rangle=|+\rangle, giving ∣1⟩⊗∣+⟩|1\rangle\otimes|+\rangle.

Step 3. Apply the final I⊗HI\otimes H: H∣+⟩=∣0⟩H|+\rangle=|0\rangle, so the output is ∣1⟩∣0⟩|1\rangle|0\rangle — exactly CNOT∣1⟩∣1⟩\text{CNOT}|1\rangle|1\rangle, the target flipped because the control was ∣1⟩|1\rangle. The construction reproduces the CNOT truth table, and because CZ is symmetric between its qubits it is often the cleaner native gate to calibrate; the Hadamards decide which qubit reads as "control."

Physics of the portrait

The Pauli gates are a rare case of a mathematical object outliving its original purpose by half a century and then being crowned king of a field its inventor never saw — written to tame the electron's spin, they reappeared unchanged as the elementary gates of the quantum computer.

Origins · 1 minPauli gates and how this was discovered
PG
Pauli gates
the elementary single-qubit gates X, Y, Z, each a π-rotation of the Bloch sphere · the quantum circuit model and error correction

The three matrices now called the Pauli gates were written down by Wolfgang Pauli in 1927 for a purpose that had nothing to do with computing: to give a rigorous, non-relativistic account of the electron's newly discovered two-valued spin. For fifty years they were simply "the spin matrices," a tool of atomic and nuclear physics. Their second life began when the qubit was recognized as an abstract spin-12\tfrac12 and computation was recast as a network of reversible gates — David Deutsch's quantum circuit model of the mid-1980s. In that language the same three matrices are the coarsest non-trivial operations: XX the quantum NOT, ZZ a phase-flip with no classical counterpart, and YY their product. The decisive elevation came from error correction. In 1995 Peter Shor showed that because any single-qubit error decomposes over {I,X,Y,Z}\{I,X,Y,Z\}, a finite code can defeat a continuum of noise — the discretization theorem — and Daniel Gottesman's stabilizer formalism soon built the whole theory of fault tolerance on tensor products of Paulis. The gates had quietly been in laboratory use for decades: Erwin Hahn's 1950 spin echo is an XX π\pi-pulse refocusing dephasing, the same XZX=−ZXZX=-Z that today extends the coherence of every superconducting qubit. Pauli, who won the 1945 Nobel Prize for the exclusion principle and whose "not even wrong" remains the field's sharpest insult, never wrote a line about computers; his three matrices run in every one that is quantum.

History
1927
— Pauli introduces the spin matrices X, Y, Z in his non-relativistic theory of electron spin
1950
— Hahn discovers the spin echo, an X π-pulse that refocuses dephasing
1985
— Deutsch casts computation as a network of quantum gates acting on qubits
1995
— Shor's discretization theorem: correcting X, Y, Z corrects all continuous single-qubit noise
1998
— Gottesman's stabilizer formalism builds fault tolerance on tensor products of Paulis

Going further

Texts. Nielsen and Chuang, Quantum Computation and Quantum Information, §1.3.1 (single-qubit gates), §4.2 (rotations and the Bloch sphere), and Ch. 10 (error correction and discretization) · Preskill, Lecture Notes for Physics 219, Ch. 4 (quantum circuits) and Ch. 7 (quantum error correction) · Watrous, The Theory of Quantum Information, §1.1 · Mermin, Quantum Computer Science, Ch. 1–2 · Kitaev, Shen and Vyalyi, Classical and Quantum Computation, §8 · Gottesman, Stabilizer Codes and Quantum Error Correction (PhD thesis, 1997) for the Pauli-group formalism.

Provenance. The matrix forms, basis actions, and product rule σjσk=δjkI+iϵjklσl\sigma_j\sigma_k=\delta_{jk}I+i\epsilon_{jkl}\sigma_l follow Nielsen and Chuang §1.3.1 and §2.1.3; the exponential Rn^(θ)R_{\hat n}(\theta) and the identity X=iRx(π)X=iR_x(\pi) follow §4.2; the error-discretization argument follows Ch. 10. A verifier should recompute: (i) X∣0⟩=∣1⟩X|0\rangle=|1\rangle, Z∣1⟩=−∣1⟩Z|1\rangle=-|1\rangle, Y=iXZY=iXZ; (ii) Rx(π)=−iXR_x(\pi)=-iX so X=iRx(π)X=iR_x(\pi); (iii) HXH=ZHXH=Z, SXS†=YSXS^\dagger=Y, XZX=−ZXZX=-Z; (iv) the spin-echo collapse Rz(φ)XRz(φ)=XR_z(\varphi)XR_z(\varphi)=X, checked at φ=0.70\varphi=0.70; (v) (I⊗H) CNOT (I⊗H)=CZ(I\otimes H)\,\text{CNOT}\,(I\otimes H)=\text{CZ}. All named values (±1\pm1 eigenvalues, det⁡σ=−1\det\sigma=-1, Tr⁡σ=0\operatorname{Tr}\sigma=0) are standard.

Prerequisites. The Quantum Circuit Model · The Bloch Sphere Representation of Gates. Leads to. Single-Qubit Rotation Gates · Phase Gates (S and T) · The Hadamard Gate · The CNOT Gate · Z-Y Decomposition of Single-Qubit Gates · Universal Gate Sets.

Ask the tutor: ask me to trace any state through a Pauli circuit, rewrite a CNOT as a CZ, or show how a stabilizer syndrome turns a continuous error into a single discrete Pauli gate.

Why is the Pauli X called the "quantum NOT," and is it the only quantum NOT?

XX is the quantum NOT because it acts on the computational basis exactly as the classical NOT acts on a bit: X∣0⟩=∣1⟩X|0\rangle=|1\rangle, X∣1⟩=∣0⟩X|1\rangle=|0\rangle, and by linearity it swaps the amplitudes of any superposition, α∣0⟩+β∣1⟩→β∣0⟩+α∣1⟩\alpha|0\rangle+\beta|1\rangle\to\beta|0\rangle+\alpha|1\rangle. It is the unique gate that reproduces the classical truth table and leaves the relative phase untouched. There are "more quantum" cousins, though: the square-root-of-NOT X=Rx(π/2)\sqrt{X}=R_x(\pi/2) (up to phase), which applied twice gives XX, is a gate no classical bit can host. So XX is the classical NOT lifted verbatim; its fractional powers are strictly quantum.

If X and R_x(π) differ only by a global phase, why keep both notations?

On a single, isolated qubit they are interchangeable — the phase ii cancels in every probability and expectation, so a compiler may freely swap XX for Rx(π)R_x(\pi). The distinction matters the instant the phase becomes relative rather than global. Inside a controlled gate the operation acts only on the branch where the control is ∣1⟩|1\rangle, so a phase that was global on the target becomes a relative phase between control branches and is fully observable — this is exactly how phase kickback works. It also matters when composing rotations, since Rx(π)Rx(π)=Rx(2π)=−IR_x(\pi)R_x(\pi)=R_x(2\pi)=-I whereas X⋅X=+IX\cdot X=+I. Keep XX for the gate, RxR_x for the rotation, and track the phase whenever a control is involved.

Do the Pauli gates commute? What order should I apply them in?

Distinct Paulis never commute — they anticommute, XZ=−ZXXZ=-ZX, and multiply cyclically, XY=iZXY=iZ, YZ=iXYZ=iX, ZX=iYZX=iY. So order is not free: XX then ZZ differs from ZZ then XX by an overall sign. On a single qubit that sign is an ignorable global phase, but in a larger circuit — especially through a control — it is physical. What is order-free is repetition of the same gate: since X2=IX^2=I, two identical Paulis in a row cancel. So a compiler can freely delete adjacent identical Paulis and reorder distinct ones only by paying the tracked commutation phase.

What is the difference between the Pauli Z gate and the phase gate S?

Both are diagonal, but they are different rotations. The Pauli Z=diag(1,−1)Z=\mathrm{diag}(1,-1) is a π\pi-rotation about z^\hat z: it flips the phase of ∣1⟩|1\rangle by 180∘180^\circ and is its own inverse. The phase gate S=diag(1,i)=ZS=\mathrm{diag}(1,i)=\sqrt{Z} is a π/2\pi/2-rotation, so applied twice it gives ZZ; both are Clifford. Their relative T=S=diag(1,eiπ/4)T=\sqrt{S}=\mathrm{diag}(1,e^{i\pi/4}) is a π/4\pi/4-rotation and is not Clifford — the "magic" resource that lifts a stabilizer gate set to universality. So ZZ, SS, TT form a tower of ever-finer phase rotations, and confusing ZZ with SS is one of the commonest beginner slips.

How can a discrete set of three gates possibly fix a continuous range of errors?

Through measurement, not by covering the continuum directly. A physical error E=c0I+cxX+cyY+czZE=c_0I+c_xX+c_yY+c_zZ applied to an encoded qubit produces a superposition of the clean state and its three Pauli-shifted copies. The syndrome measurement then projects that superposition onto one branch, collapsing the continuous coefficients cμc_\mu into a discrete verdict — no error, XX, YY, or ZZ — which you undo with the named Pauli. You never learn the cμc_\mu; measuring discretizes the noise, and correcting the four basis cases corrects their entire span. This "discretization of errors" is what makes fault-tolerant quantum computing possible at all.

Why do real machines run R_z gates "virtually" but not R_x?

Because a ZZ-rotation is just a redefinition of phase, whereas an XX-rotation genuinely moves population between ∣0⟩|0\rangle and ∣1⟩|1\rangle. Single-qubit control is applied in a frame rotating at the qubit frequency; an Rz(θ)R_z(\theta) amounts to advancing the phase of that frame, implemented by adding θ\theta to the phase of every subsequent drive pulse — no pulse of its own, zero duration, zero added error. An Rx(θ)R_x(\theta) or Ry(θ)R_y(\theta), by contrast, needs a real resonant pulse of calibrated amplitude and length to tip the Bloch vector off the axis. So compilers push rotations onto the z^\hat z-axis as virtual-ZZ frame updates, spending real pulses only on the XX and YY rotations that must be driven.

Before this

Where this leads