QuantumCore

Lesson 18 · 70 min · core

Pauli Gates & the Pauli Algebra

Loading progress…

The three Pauli matrices XX, YY, ZZ are simultaneously quantum gates (bit flip, bit-and-phase flip, phase flip), observables (spin components) and, together with II, a basis of all 2×22\times2 complex matrices. We compute all nine products σjσk\sigma_j\sigma_k explicitly and condense them into σjσk=δjkI+iϵjklσl\sigma_j\sigma_k=\delta_{jk}I+i\epsilon_{jkl}\sigma_l, derive the commutation and anticommutation relations and XYZ=iIXYZ=iI, prove that every A∈M2(C)A\in M_2(\mathbb C) equals 12∑PTr(PA) P\tfrac12\sum_P\mathrm{Tr}(PA)\,P (with real coefficients exactly when AA is Hermitian), prove (a⃗⋅σ⃗)(b⃗⋅σ⃗)=(a⃗⋅b⃗)I+i(a⃗×b⃗)⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=(\vec a\cdot\vec b)I+i(\vec a\times\vec b)\cdot\vec\sigma, and show that each Pauli gate rotates the Bloch sphere by π\pi about its own axis.

Prerequisites: The Bloch Sphere

Objectives and key results
  • Apply XX, YY, ZZ to the six cardinal states and read off the result, including the phases ±1\pm1, ±i\pm i.

  • Prove that each Pauli matrix is Hermitian, unitary and involutory, with eigenvalues ±1\pm1.

  • Compute all nine products σjσk\sigma_j\sigma_k and use σjσk=δjkI+iϵjklσl\sigma_j\sigma_k=\delta_{jk}I+i\epsilon_{jkl}\sigma_l, [σj,σk]=2iϵjklσl[\sigma_j,\sigma_k]=2i\epsilon_{jkl}\sigma_l and {σj,σk}=2δjkI\lbrace\sigma_j,\sigma_k\rbrace=2\delta_{jk}I.

  • Decompose any 2×22\times2 matrix as A=12∑P∈{I,X,Y,Z}Tr(PA) PA=\tfrac12\sum_{P\in\lbrace I,X,Y,Z\rbrace}\mathrm{Tr}(PA)\,P and decide Hermiticity from the coefficients.

  • Describe XX, YY, ZZ as rotations by π\pi of the Bloch vector: X:(rx,ry,rz)↦(rx,−ry,−rz)X:(r_x,r_y,r_z)\mapsto(r_x,-r_y,-r_z), and cyclically.

definition · Pauli matrices
X=(0110),Y=(0−ii0),Z=(100−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}
identity · Pauli product formula
σjσk=δjkI+iϵjklσl,[σj,σk]=2iϵjklσl,{σj,σk}=2δjkI,XYZ=iI\sigma_j\sigma_k=\delta_{jk}I+i\epsilon_{jkl}\sigma_l,\qquad[\sigma_j,\sigma_k]=2i\epsilon_{jkl}\sigma_l,\qquad\lbrace\sigma_j,\sigma_k\rbrace=2\delta_{jk}I,\qquad XYZ=iI
theorem · Pauli decomposition
A=12∑P∈{I,X,Y,Z}Tr(PA) P∀A∈M2(C),A=A†  ⟺  Tr(PA)∈R ∀PA=\tfrac12\sum_{P\in\lbrace I,X,Y,Z\rbrace}\mathrm{Tr}(PA)\,P\quad\forall A\in M_2(\mathbb C),\qquad A=A^\dagger\iff\mathrm{Tr}(PA)\in\mathbb R\ \forall P
identity · Vector identity
(a⃗⋅σ⃗)(b⃗⋅σ⃗)=(a⃗⋅b⃗) I+i(a⃗×b⃗)⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=(\vec a\cdot\vec b)\,I+i(\vec a\times\vec b)\cdot\vec\sigma
theorem · Paulis as π rotations
X:(rx,ry,rz)↦(rx,−ry,−rz),Y:(rx,ry,rz)↦(−rx,ry,−rz),Z:(rx,ry,rz)↦(−rx,−ry,rz)X:(r_x,r_y,r_z)\mapsto(r_x,-r_y,-r_z),\quad Y:(r_x,r_y,r_z)\mapsto(-r_x,r_y,-r_z),\quad Z:(r_x,r_y,r_z)\mapsto(-r_x,-r_y,r_z)

The Pauli matrices#

Definition

Pauli matrices

The Pauli matrices are the three 2×22\times2 complex matrices X=σx=σ1=(0110),Y=σy=σ2=(0−ii0),Z=σz=σ3=(100−1).X=\sigma_x=\sigma_1=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad Y=\sigma_y=\sigma_2=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\qquad Z=\sigma_z=\sigma_3=\begin{pmatrix}1&0\\0&-1\end{pmatrix}. Together with I=σ0I=\sigma_0 they form the set P={I,X,Y,Z}\mathcal P=\lbrace I,X,Y,Z\rbrace. We write σ⃗=(X,Y,Z)\vec\sigma=(X,Y,Z) and, for a⃗∈R3\vec a\in\mathbb R^3, a⃗⋅σ⃗=axX+ayY+azZ\vec a\cdot\vec\sigma=a_xX+a_yY+a_zZ. As gates they are called the bit flip XX, the phase flip ZZ and the bit-and-phase flip YY; in circuit libraries they are X, Y, Z (Qiskit) or PauliX, PauliY, PauliZ (PennyLane).

X=(0110)=X†=X−1X=\begin{pmatrix}0&1\\1&0\end{pmatrix}=X^\dagger=X^{-1}
Pauli-X (bit flip)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 0.0e+0)

Y=(0−ii0)=Y†=Y−1Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}=Y^\dagger=Y^{-1}
Pauli-Y (bit-and-phase flip)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 0.0e+0)

The matrix display below prints YY with exact entries (±i\pm i instead of decimals), labels its rows and columns by ∣0⟩,∣1⟩\lvert0\rangle,\lvert1\rangle, and lists the invariants that the proposition below proves for every Pauli matrix: Hermitian and unitary (hence normal), Tr Y=0+0=0\mathrm{Tr}\,Y=0+0=0, det⁡Y=0⋅0−(−i)⋅i=i2=−1\det Y=0\cdot0-(-i)\cdot i=i^2=-1, eigenvalues −1-1 and +1+1. Read its columns as images of basis states: column 00 is Y∣0⟩=(0,i)T=i∣1⟩Y\lvert0\rangle=(0,i)^{\mathsf T}=i\lvert1\rangle and column 11 is Y∣1⟩=(−i,0)T=−i∣0⟩Y\lvert1\rangle=(-i,0)^{\mathsf T}=-i\lvert0\rangle. The phases ±i\pm i are the only difference from the bit flip XX, and they are exactly what makes Y=iXZY=iXZ.

Z=(100−1)=Z†=Z−1Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}=Z^\dagger=Z^{-1}
Pauli-Z (phase flip)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 0.0e+0)

Derivation

Action of XX, YY, ZZ on the six cardinal states

  1. Step 1:
    X∣0⟩=(0110)(10)=(01)=∣1⟩,X∣1⟩=(0110)(01)=(10)=∣0⟩X\lvert0\rangle=\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}0\\1\end{pmatrix}=\lvert1\rangle,\qquad X\lvert1\rangle=\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}0\\1\end{pmatrix}=\begin{pmatrix}1\\0\end{pmatrix}=\lvert0\rangle
    XX swaps the two amplitudes: it is the classical NOT on basis states.
  2. Step 2:
    Y∣0⟩=(0−ii0)(10)=(0i)=i∣1⟩,Y∣1⟩=(−i0)=−i∣0⟩Y\lvert0\rangle=\begin{pmatrix}0&-i\\i&0\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}0\\i\end{pmatrix}=i\lvert1\rangle,\qquad Y\lvert1\rangle=\begin{pmatrix}-i\\0\end{pmatrix}=-i\lvert0\rangle
    YY swaps the amplitudes and attaches the phases ii and −i-i: Y=iXZY=iXZ.
  3. Step 3:
    Z∣0⟩=∣0⟩,Z∣1⟩=(100−1)(01)=−∣1⟩Z\lvert0\rangle=\lvert0\rangle,\qquad Z\lvert1\rangle=\begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}0\\1\end{pmatrix}=-\lvert1\rangle
    ZZ is diagonal: it leaves ∣0⟩\lvert0\rangle alone and multiplies ∣1⟩\lvert1\rangle by −1-1.
  4. Step 4:
    X∣±⟩=12(∣1⟩±∣0⟩)=±∣±⟩,Z∣±⟩=12(∣0⟩∓∣1⟩)=∣∓⟩X\lvert\pm\rangle=\tfrac1{\sqrt2}\big(\lvert1\rangle\pm\lvert0\rangle\big)=\pm\lvert\pm\rangle,\qquad Z\lvert\pm\rangle=\tfrac1{\sqrt2}\big(\lvert0\rangle\mp\lvert1\rangle\big)=\lvert\mp\rangle
    Linearity with ∣±⟩=12(∣0⟩±∣1⟩)\lvert\pm\rangle=\tfrac1{\sqrt2}(\lvert0\rangle\pm\lvert1\rangle); for ∣−⟩\lvert-\rangle, ∣1⟩−∣0⟩=−(∣0⟩−∣1⟩)\lvert1\rangle-\lvert0\rangle=-(\lvert0\rangle-\lvert1\rangle).
  5. Step 5:
    Y∣+⟩=12(i∣1⟩−i∣0⟩)=−i∣−⟩,Y∣−⟩=12(i∣1⟩+i∣0⟩)=i∣+⟩Y\lvert+\rangle=\tfrac1{\sqrt2}\big(i\lvert1\rangle-i\lvert0\rangle\big)=-i\lvert-\rangle,\qquad Y\lvert-\rangle=\tfrac1{\sqrt2}\big(i\lvert1\rangle+i\lvert0\rangle\big)=i\lvert+\rangle
    Insert Y∣0⟩=i∣1⟩Y\lvert0\rangle=i\lvert1\rangle and Y∣1⟩=−i∣0⟩Y\lvert1\rangle=-i\lvert0\rangle and factor out ∓i\mp i.
  6. Step 6:
    X∣±i⟩=12(∣1⟩±i∣0⟩)=±i 12(∣0⟩∓i∣1⟩)=±i∣∓i⟩X\lvert{\pm i}\rangle=\tfrac1{\sqrt2}\big(\lvert1\rangle\pm i\lvert0\rangle\big)=\pm i\,\tfrac1{\sqrt2}\big(\lvert0\rangle\mp i\lvert1\rangle\big)=\pm i\lvert{\mp i}\rangle
    With ∣±i⟩=12(∣0⟩±i∣1⟩)\lvert{\pm i}\rangle=\tfrac1{\sqrt2}(\lvert0\rangle\pm i\lvert1\rangle): factor ±i\pm i out, using 1±i=∓i\tfrac{1}{\pm i}=\mp i.
  7. Step 7:
    Y∣±i⟩=12(i∣1⟩±i(−i)∣0⟩)=12(±∣0⟩+i∣1⟩)=±∣±i⟩Y\lvert{\pm i}\rangle=\tfrac1{\sqrt2}\big(i\lvert1\rangle\pm i(-i)\lvert0\rangle\big)=\tfrac1{\sqrt2}\big(\pm\lvert0\rangle+i\lvert1\rangle\big)=\pm\lvert{\pm i}\rangle
    i(−i)=1i(-i)=1; for the lower sign, −∣0⟩+i∣1⟩=−(∣0⟩−i∣1⟩)-\lvert0\rangle+i\lvert1\rangle=-(\lvert0\rangle-i\lvert1\rangle).
  8. Step 8:
    Z∣±i⟩=12(∣0⟩∓i∣1⟩)=∣∓i⟩Z\lvert{\pm i}\rangle=\tfrac1{\sqrt2}\big(\lvert0\rangle\mp i\lvert1\rangle\big)=\lvert{\mp i}\rangle
    ZZ flips the sign of the ∣1⟩\lvert1\rangle amplitude.

Result

X∣0⟩=∣1⟩, Y∣0⟩=i∣1⟩, Z∣1⟩=−∣1⟩,X∣±⟩=±∣±⟩, Y∣±i⟩=±∣±i⟩, Z∣±⟩=∣∓⟩\boxed{X\lvert0\rangle=\lvert1\rangle,\ Y\lvert0\rangle=i\lvert1\rangle,\ Z\lvert1\rangle=-\lvert1\rangle,\quad X\lvert\pm\rangle=\pm\lvert\pm\rangle,\ Y\lvert{\pm i}\rangle=\pm\lvert{\pm i}\rangle,\ Z\lvert\pm\rangle=\lvert\mp\rangle}
Proposition

Each Pauli matrix is Hermitian, unitary and involutory

For σ∈{X,Y,Z}\sigma\in\lbrace X,Y,Z\rbrace: σ†=σ\sigma^\dagger=\sigma, σ2=I\sigma^2=I, and therefore σ†σ=I\sigma^\dagger\sigma=I. Each has trace 00, determinant −1-1, eigenvalues +1+1 and −1-1, and eigenvectors X:∣±⟩X:\lvert\pm\rangle, Y:∣±i⟩Y:\lvert{\pm i}\rangle, Z:∣0⟩,∣1⟩Z:\lvert0\rangle,\lvert1\rangle (eigenvalue +1+1 first).

Proof (7 steps)
  1. Step 1:
    X†=X‾T=(0110)=X,Z†=(100−1)=ZX^\dagger=\overline{X}^{T}=\begin{pmatrix}0&1\\1&0\end{pmatrix}=X,\qquad Z^\dagger=\begin{pmatrix}1&0\\0&-1\end{pmatrix}=Z
    XX and ZZ are real and symmetric, so conjugate-transposing changes nothing.
  2. Step 2:
    Y†=(0−ii0)‾T=(0i−i0)T=(0−ii0)=YY^\dagger=\overline{\begin{pmatrix}0&-i\\i&0\end{pmatrix}}^{T}=\begin{pmatrix}0&i\\-i&0\end{pmatrix}^{T}=\begin{pmatrix}0&-i\\i&0\end{pmatrix}=Y
    Conjugation sends ∓i↦±i\mp i\mapsto\pm i; the transpose then swaps the two off-diagonal entries back.
  3. Step 3:
    X2=(0⋅0+1⋅10⋅1+1⋅01⋅0+0⋅11⋅1+0⋅0)=I,Y2=((−i)(i)00(i)(−i))=I,Z2=(100(−1)2)=IX^2=\begin{pmatrix}0\cdot0+1\cdot1&0\cdot1+1\cdot0\\1\cdot0+0\cdot1&1\cdot1+0\cdot0\end{pmatrix}=I,\quad Y^2=\begin{pmatrix}(-i)(i)&0\\0&(i)(-i)\end{pmatrix}=I,\quad Z^2=\begin{pmatrix}1&0\\0&(-1)^2\end{pmatrix}=I
    Direct multiplication; for YY the off-diagonal entries are 0⋅(−i)+(−i)⋅0=00\cdot(-i)+(-i)\cdot0=0 and i⋅0+0⋅i=0i\cdot0+0\cdot i=0, and (−i)(i)=−i2=1(-i)(i)=-i^2=1.
  4. Step 4:
    σ†σ=σ σ=I\sigma^\dagger\sigma=\sigma\,\sigma=I
    Combine Hermiticity with σ2=I\sigma^2=I: each Pauli is its own inverse and its own adjoint, so it is unitary.
  5. Step 5:
    det⁡(σ−λI)=λ2−(Tr σ)λ+det⁡σ=λ2−1\det(\sigma-\lambda I)=\lambda^2-(\mathrm{Tr}\,\sigma)\lambda+\det\sigma=\lambda^2-1
    For 2×22\times2 matrices the characteristic polynomial is λ2−Tr λ+det⁡\lambda^2-\mathrm{Tr}\,\lambda+\det; here Tr X=Tr Y=Tr Z=0\mathrm{Tr}\,X=\mathrm{Tr}\,Y=\mathrm{Tr}\,Z=0 and det⁡X=0−1\det X=0-1, det⁡Y=0−(−i)(i)=−1\det Y=0-(-i)(i)=-1, det⁡Z=(1)(−1)=−1\det Z=(1)(-1)=-1.
  6. Step 6:
    λ2−1=0  ⟺  λ=±1\lambda^2-1=0\iff\lambda=\pm1
    The eigenvalues are real (as for every Hermitian matrix) and lie on the unit circle (as for every unitary matrix): only ±1\pm1 satisfy both.
  7. Step 7:
    X∣±⟩=±∣±⟩,Y∣±i⟩=±∣±i⟩,Z∣0⟩=+∣0⟩, Z∣1⟩=−∣1⟩X\lvert\pm\rangle=\pm\lvert\pm\rangle,\qquad Y\lvert{\pm i}\rangle=\pm\lvert{\pm i}\rangle,\qquad Z\lvert0\rangle=+\lvert0\rangle,\ Z\lvert1\rangle=-\lvert1\rangle
    Read off from the action on cardinal states computed above; the eigenvectors of each Pauli are the two antipodal cardinal states on its own axis.

∎

The Pauli algebra#

Multiplying two Pauli matrices never produces anything new: the product of any two is again a Pauli matrix (or II) times one of the four phases ±1,±i\pm1,\pm i. We first compute all nine products by explicit 2×22\times2 multiplication, entry (r,c)(r,c) being ∑kArkBkc\sum_kA_{rk}B_{kc}, and then condense the table into a single formula.

Derivation

All nine products σjσk\sigma_j\sigma_k

  1. Step 1:
    X2=Y2=Z2=IX^2=Y^2=Z^2=I
    Proved entry by entry in the previous section.
  2. Step 2:
    XY=(0110)(0−ii0)=(0⋅0+1⋅i0⋅(−i)+1⋅01⋅0+0⋅i1⋅(−i)+0⋅0)=(i00−i)=iZXY=\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}0&-i\\i&0\end{pmatrix}=\begin{pmatrix}0\cdot0+1\cdot i&0\cdot(-i)+1\cdot0\\1\cdot0+0\cdot i&1\cdot(-i)+0\cdot0\end{pmatrix}=\begin{pmatrix}i&0\\0&-i\end{pmatrix}=iZ
    Row of XX times column of YY.
  3. Step 3:
    YX=(0−ii0)(0110)=(0⋅0+(−i)⋅10⋅1+(−i)⋅0i⋅0+0⋅1i⋅1+0⋅0)=(−i00i)=−iZYX=\begin{pmatrix}0&-i\\i&0\end{pmatrix}\begin{pmatrix}0&1\\1&0\end{pmatrix}=\begin{pmatrix}0\cdot0+(-i)\cdot1&0\cdot1+(-i)\cdot0\\i\cdot0+0\cdot1&i\cdot1+0\cdot0\end{pmatrix}=\begin{pmatrix}-i&0\\0&i\end{pmatrix}=-iZ
    Same two matrices in the opposite order: the sign flips.
  4. Step 4:
    YZ=(0−ii0)(100−1)=(0⋅1+(−i)⋅00⋅0+(−i)(−1)i⋅1+0⋅0i⋅0+0⋅(−1))=(0ii0)=iXYZ=\begin{pmatrix}0&-i\\i&0\end{pmatrix}\begin{pmatrix}1&0\\0&-1\end{pmatrix}=\begin{pmatrix}0\cdot1+(-i)\cdot0&0\cdot0+(-i)(-1)\\i\cdot1+0\cdot0&i\cdot0+0\cdot(-1)\end{pmatrix}=\begin{pmatrix}0&i\\i&0\end{pmatrix}=iX
    Right-multiplying by ZZ negates the second column of YY.
  5. Step 5:
    ZY=(100−1)(0−ii0)=(1⋅0+0⋅i1⋅(−i)+0⋅00⋅0+(−1)⋅i0⋅(−i)+(−1)⋅0)=(0−i−i0)=−iXZY=\begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}0&-i\\i&0\end{pmatrix}=\begin{pmatrix}1\cdot0+0\cdot i&1\cdot(-i)+0\cdot0\\0\cdot0+(-1)\cdot i&0\cdot(-i)+(-1)\cdot0\end{pmatrix}=\begin{pmatrix}0&-i\\-i&0\end{pmatrix}=-iX
    Left-multiplying by ZZ negates the second row of YY.
  6. Step 6:
    ZX=(100−1)(0110)=(1⋅0+0⋅11⋅1+0⋅00⋅0+(−1)⋅10⋅1+(−1)⋅0)=(01−10)=iYZX=\begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}0&1\\1&0\end{pmatrix}=\begin{pmatrix}1\cdot0+0\cdot1&1\cdot1+0\cdot0\\0\cdot0+(-1)\cdot1&0\cdot1+(-1)\cdot0\end{pmatrix}=\begin{pmatrix}0&1\\-1&0\end{pmatrix}=iY
    Compare with iY=(0−i2i20)=(01−10)iY=\begin{pmatrix}0&-i^2\\i^2&0\end{pmatrix}=\begin{pmatrix}0&1\\-1&0\end{pmatrix}.
  7. Step 7:
    XZ=(0110)(100−1)=(0⋅1+1⋅00⋅0+1⋅(−1)1⋅1+0⋅01⋅0+0⋅(−1))=(0−110)=−iYXZ=\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1&0\\0&-1\end{pmatrix}=\begin{pmatrix}0\cdot1+1\cdot0&0\cdot0+1\cdot(-1)\\1\cdot1+0\cdot0&1\cdot0+0\cdot(-1)\end{pmatrix}=\begin{pmatrix}0&-1\\1&0\end{pmatrix}=-iY
    Compare with −iY=(0i2−i20)=(0−110)-iY=\begin{pmatrix}0&i^2\\-i^2&0\end{pmatrix}=\begin{pmatrix}0&-1\\1&0\end{pmatrix}.

Result

XY=iZ, YZ=iX, ZX=iY,YX=−iZ, ZY=−iX, XZ=−iY,X2=Y2=Z2=I\boxed{XY=iZ,\ YZ=iX,\ ZX=iY,\qquad YX=-iZ,\ ZY=-iX,\ XZ=-iY,\qquad X^2=Y^2=Z^2=I}
Theorem

Pauli product formula and its consequences

With σ1=X\sigma_1=X, σ2=Y\sigma_2=Y, σ3=Z\sigma_3=Z, the Kronecker delta δjk\delta_{jk} and the Levi-Civita symbol ϵjkl\epsilon_{jkl} (+1+1 for cyclic (j,k,l)(j,k,l), −1-1 for anticyclic, 00 if two indices coincide), and summation over the repeated index ll: σjσk=δjkI+iϵjklσl.\sigma_j\sigma_k=\delta_{jk}I+i\epsilon_{jkl}\sigma_l. Consequently [σj,σk]=σjσk−σkσj=2iϵjklσl[\sigma_j,\sigma_k]=\sigma_j\sigma_k-\sigma_k\sigma_j=2i\epsilon_{jkl}\sigma_l, {σj,σk}=σjσk+σkσj=2δjkI\lbrace\sigma_j,\sigma_k\rbrace=\sigma_j\sigma_k+\sigma_k\sigma_j=2\delta_{jk}I, and XYZ=iIXYZ=iI.

Proof (6 steps)
  1. Step 1:
    j=k:σjσj=I=δjjI+iϵjjl⏟=0σlj=k:\quad\sigma_j\sigma_j=I=\delta_{jj}I+i\underbrace{\epsilon_{jjl}}_{=0}\sigma_l
    The three squares equal II, and ϵ\epsilon vanishes whenever two indices coincide.
  2. Step 2:
    (j,k,l)∈{(1,2,3),(2,3,1),(3,1,2)}:σjσk=iσl=0⋅I+i (+1) σl(j,k,l)\in\lbrace(1,2,3),(2,3,1),(3,1,2)\rbrace:\quad\sigma_j\sigma_k=i\sigma_l=0\cdot I+i\,(+1)\,\sigma_l
    These are XY=iZXY=iZ, YZ=iXYZ=iX, ZX=iYZX=iY from the table, and ϵjkl=+1\epsilon_{jkl}=+1 for cyclic triples; for fixed j≠kj\neq k only one ll gives a nonzero ϵjkl\epsilon_{jkl}, so the sum over ll has one term.
  3. Step 3:
    (j,k,l)∈{(2,1,3),(3,2,1),(1,3,2)}:σjσk=−iσl=0⋅I+i (−1) σl(j,k,l)\in\lbrace(2,1,3),(3,2,1),(1,3,2)\rbrace:\quad\sigma_j\sigma_k=-i\sigma_l=0\cdot I+i\,(-1)\,\sigma_l
    These are YX=−iZYX=-iZ, ZY=−iXZY=-iX, XZ=−iYXZ=-iY, and ϵjkl=−1\epsilon_{jkl}=-1 for anticyclic triples. All nine ordered pairs (j,k)(j,k) are now covered.
  4. Step 4:
    [σj,σk]=(δjkI+iϵjklσl)−(δkjI+iϵkjlσl)=i(ϵjkl−ϵkjl)σl=2iϵjklσl[\sigma_j,\sigma_k]=\big(\delta_{jk}I+i\epsilon_{jkl}\sigma_l\big)-\big(\delta_{kj}I+i\epsilon_{kjl}\sigma_l\big)=i\big(\epsilon_{jkl}-\epsilon_{kjl}\big)\sigma_l=2i\epsilon_{jkl}\sigma_l
    Apply the formula to both orders; δ\delta is symmetric so the II terms cancel, and ϵ\epsilon is antisymmetric, ϵkjl=−ϵjkl\epsilon_{kjl}=-\epsilon_{jkl}.
  5. Step 5:
    {σj,σk}=(δjk+δkj)I+i(ϵjkl+ϵkjl)σl=2δjkI\lbrace\sigma_j,\sigma_k\rbrace=\big(\delta_{jk}+\delta_{kj}\big)I+i\big(\epsilon_{jkl}+\epsilon_{kjl}\big)\sigma_l=2\delta_{jk}I
    Now the antisymmetric ϵ\epsilon terms cancel and the symmetric δ\delta terms add. For j≠kj\neq k this says σjσk=−σkσj\sigma_j\sigma_k=-\sigma_k\sigma_j: distinct Paulis anticommute.
  6. Step 6:
    XYZ=(XY)Z=(iZ)Z=iZ2=iIXYZ=(XY)Z=(iZ)Z=iZ^2=iI
    Associativity, XY=iZXY=iZ and Z2=IZ^2=I.

∎

Quick check

What is the commutator [X,Y]=XY−YX[X,Y]=XY-YX?

Select one answer

The Pauli basis of 2×2 matrices#

Definition

Hilbert–Schmidt inner product

On the complex vector space M2(C)M_2(\mathbb C) of 2×22\times2 complex matrices (dimension 44), the Hilbert–Schmidt inner product is ⟨A,B⟩HS=Tr(A†B)=∑r,cArc‾Brc\langle A,B\rangle_{HS}=\mathrm{Tr}(A^\dagger B)=\sum_{r,c}\overline{A_{rc}}B_{rc}. It is the ordinary inner product of C4\mathbb C^4 after stacking the four entries of each matrix into a column, so it is conjugate-linear in AA, linear in BB, and ⟨A,A⟩HS=∑r,c∣Arc∣2>0\langle A,A\rangle_{HS}=\sum_{r,c}\lvert A_{rc}\rvert^2>0 for A≠0A\neq0.

Lemma

Orthogonality of the Pauli basis

For P,Q∈P={I,X,Y,Z}P,Q\in\mathcal P=\lbrace I,X,Y,Z\rbrace: ⟨P,Q⟩HS=Tr(P†Q)=2δPQ\langle P,Q\rangle_{HS}=\mathrm{Tr}(P^\dagger Q)=2\delta_{PQ}. Hence P\mathcal P is an orthogonal basis of M2(C)M_2(\mathbb C).

Proof (5 steps)
  1. Step 1:
    Tr(P†Q)=Tr(PQ)\mathrm{Tr}(P^\dagger Q)=\mathrm{Tr}(PQ)
    Every element of P\mathcal P is Hermitian.
  2. Step 2:
    P=Q:Tr(P2)=Tr I=2P=Q:\quad\mathrm{Tr}(P^2)=\mathrm{Tr}\,I=2
    I2=X2=Y2=Z2=II^2=X^2=Y^2=Z^2=I.
  3. Step 3:
    P=I≠Q:Tr(IQ)=Tr Q=0P=I\neq Q:\quad\mathrm{Tr}(IQ)=\mathrm{Tr}\,Q=0
    The diagonals of XX, YY, ZZ are (0,0)(0,0), (0,0)(0,0) and (1,−1)(1,-1): all three are traceless. The case Q=I≠PQ=I\neq P is identical.
  4. Step 4:
    P=σj≠Q=σk:Tr(σjσk)=Tr(iϵjklσl)=iϵjkl Tr σl=0P=\sigma_j\neq Q=\sigma_k:\quad\mathrm{Tr}(\sigma_j\sigma_k)=\mathrm{Tr}\big(i\epsilon_{jkl}\sigma_l\big)=i\epsilon_{jkl}\,\mathrm{Tr}\,\sigma_l=0
    Product formula with δjk=0\delta_{jk}=0, then tracelessness.
  5. Step 5:
    ∑QcQQ=0 ⇒ 0=Tr(P∑QcQQ)=∑QcQ 2δPQ=2cP  ∀P\textstyle\sum_{Q}c_QQ=0\ \Rightarrow\ 0=\mathrm{Tr}\big(P\textstyle\sum_Qc_QQ\big)=\sum_Qc_Q\,2\delta_{PQ}=2c_P\ \ \forall P
    Four mutually orthogonal nonzero vectors are linearly independent; since dim⁡M2(C)=4\dim M_2(\mathbb C)=4, they form a basis.

∎

Theorem

Pauli decomposition

Every A∈M2(C)A\in M_2(\mathbb C) has the unique expansion A=∑P∈PaPPA=\sum_{P\in\mathcal P}a_PP with aP=12Tr(PA)a_P=\tfrac12\mathrm{Tr}(PA). Explicitly a0=12(A00+A11),ax=12(A01+A10),ay=i2(A01−A10),az=12(A00−A11).a_0=\tfrac12(A_{00}+A_{11}),\quad a_x=\tfrac12(A_{01}+A_{10}),\quad a_y=\tfrac{i}{2}(A_{01}-A_{10}),\quad a_z=\tfrac12(A_{00}-A_{11}). Moreover AA is Hermitian if and only if all four coefficients are real.

Proof (6 steps)
  1. Step 1:
    A=∑Q∈PaQQA=\textstyle\sum_{Q\in\mathcal P}a_QQ
    P\mathcal P is a basis (previous lemma), so the coefficients exist and are unique.
  2. Step 2:
    Tr(PA)=∑QaQ Tr(PQ)=∑QaQ 2δPQ=2aP ⇒ aP=12Tr(PA)\mathrm{Tr}(PA)=\textstyle\sum_Qa_Q\,\mathrm{Tr}(PQ)=\sum_Qa_Q\,2\delta_{PQ}=2a_P\ \Rightarrow\ a_P=\tfrac12\mathrm{Tr}(PA)
    Multiply by PP on the left, take the trace (linear), and use Tr(PQ)=2δPQ\mathrm{Tr}(PQ)=2\delta_{PQ}.
  3. Step 3:
    XA=(A10A11A00A01),YA=(−iA10−iA11iA00iA01),ZA=(A00A01−A10−A11)XA=\begin{pmatrix}A_{10}&A_{11}\\A_{00}&A_{01}\end{pmatrix},\quad YA=\begin{pmatrix}-iA_{10}&-iA_{11}\\iA_{00}&iA_{01}\end{pmatrix},\quad ZA=\begin{pmatrix}A_{00}&A_{01}\\-A_{10}&-A_{11}\end{pmatrix}
    XX swaps the rows of AA; YY swaps them and multiplies the new rows by −i-i and ii; ZZ negates the second row.
  4. Step 4:
    Tr A=A00+A11,  Tr(XA)=A10+A01,  Tr(YA)=i(A01−A10),  Tr(ZA)=A00−A11\mathrm{Tr}\,A=A_{00}+A_{11},\ \ \mathrm{Tr}(XA)=A_{10}+A_{01},\ \ \mathrm{Tr}(YA)=i(A_{01}-A_{10}),\ \ \mathrm{Tr}(ZA)=A_{00}-A_{11}
    Add the diagonal entries of each product and halve to get the explicit formulas.
  5. Step 5:
    aP∈R ∀P ⇒ A†=∑PaP‾ P†=∑PaPP=Aa_P\in\mathbb R\ \forall P\ \Rightarrow\ A^\dagger=\textstyle\sum_P\overline{a_P}\,P^\dagger=\sum_Pa_PP=A
    The adjoint is conjugate-linear and each PP is Hermitian.
  6. Step 6:
    A=A† ⇒ Tr(PA)‾=Tr((PA)†)=Tr(A†P†)=Tr(AP)=Tr(PA)A=A^\dagger\ \Rightarrow\ \overline{\mathrm{Tr}(PA)}=\mathrm{Tr}\big((PA)^\dagger\big)=\mathrm{Tr}(A^\dagger P^\dagger)=\mathrm{Tr}(AP)=\mathrm{Tr}(PA)
    Tr M‾=Tr M†\overline{\mathrm{Tr}\,M}=\mathrm{Tr}\,M^\dagger, (PA)†=A†P†(PA)^\dagger=A^\dagger P^\dagger, Hermiticity of AA and PP, and cyclicity of the trace; a number equal to its own conjugate is real.

∎

Derivation

Worked example: B=(12+i2−i−1)B=\begin{pmatrix}1&2+i\\2-i&-1\end{pmatrix}

  1. Step 1:
    B†=(1‾2−i‾2+i‾−1‾)=(12+i2−i−1)=BB^\dagger=\begin{pmatrix}\overline{1}&\overline{2-i}\\\overline{2+i}&\overline{-1}\end{pmatrix}=\begin{pmatrix}1&2+i\\2-i&-1\end{pmatrix}=B
    BB is Hermitian, so all four coefficients must come out real.
  2. Step 2:
    b0=12Tr B=12(1+(−1))=0b_0=\tfrac12\mathrm{Tr}\,B=\tfrac12\big(1+(-1)\big)=0
    Coefficient of II: half the trace.
  3. Step 3:
    XB=(2−i−112+i),bx=12Tr(XB)=12((2−i)+(2+i))=2XB=\begin{pmatrix}2-i&-1\\1&2+i\end{pmatrix},\qquad b_x=\tfrac12\mathrm{Tr}(XB)=\tfrac12\big((2-i)+(2+i)\big)=2
    XX swaps the rows of BB.
  4. Step 4:
    YB=(−i(2−i)−i(−1)i⋅1i(2+i))=(−1−2iii−1+2i)YB=\begin{pmatrix}-i(2-i)&-i(-1)\\i\cdot1&i(2+i)\end{pmatrix}=\begin{pmatrix}-1-2i&i\\i&-1+2i\end{pmatrix}
    −i(2−i)=−2i+i2=−1−2i-i(2-i)=-2i+i^2=-1-2i and i(2+i)=2i+i2=−1+2ii(2+i)=2i+i^2=-1+2i.
  5. Step 5:
    by=12Tr(YB)=12((−1−2i)+(−1+2i))=12(−2)=−1b_y=\tfrac12\mathrm{Tr}(YB)=\tfrac12\big((-1-2i)+(-1+2i)\big)=\tfrac12(-2)=-1
    The imaginary parts cancel, as they must for a Hermitian matrix.
  6. Step 6:
    ZB=(12+i−(2−i)1),bz=12Tr(ZB)=12(1+1)=1ZB=\begin{pmatrix}1&2+i\\-(2-i)&1\end{pmatrix},\qquad b_z=\tfrac12\mathrm{Tr}(ZB)=\tfrac12(1+1)=1
    ZZ negates the second row of BB.
  7. Step 7:
    0⋅I+2X−Y+Z=(0220)+(0i−i0)+(100−1)=(12+i2−i−1)=B0\cdot I+2X-Y+Z=\begin{pmatrix}0&2\\2&0\end{pmatrix}+\begin{pmatrix}0&i\\-i&0\end{pmatrix}+\begin{pmatrix}1&0\\0&-1\end{pmatrix}=\begin{pmatrix}1&2+i\\2-i&-1\end{pmatrix}=B
    Reconstruction check: −Y=(0i−i0)-Y=\begin{pmatrix}0&i\\-i&0\end{pmatrix}, and the entries add up to BB.

Result

B=(12+i2−i−1)=2X−Y+Z,(b0,bx,by,bz)=(0,2,−1,1)\boxed{B=\begin{pmatrix}1&2+i\\2-i&-1\end{pmatrix}=2X-Y+Z,\qquad(b_0,b_x,b_y,b_z)=(0,2,-1,1)}

The decomposition as a table. The Pauli decomposer applies cP=1dTr(PA)c_P=\tfrac1d\mathrm{Tr}(PA) to a matrix AA of dimension dd, lists the nonzero coefficients, the reconstruction error max⁡∣A−∑PcPP∣\max\lvert A-\sum_Pc_PP\rvert, and the Hermitian and unitary checks. The two decomposers in this section show fixed matrices (the lab's matrix is yours to decompose by hand). The first is the Hadamard gate of the next lesson; derive its coefficients before reading the table.

Derivation

H=12(111−1)H=\tfrac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix} in the Pauli basis

  1. Step 1:
    cI=12Tr H=12⋅12(1+(−1))=0c_I=\tfrac12\mathrm{Tr}\,H=\tfrac12\cdot\tfrac1{\sqrt2}\big(1+(-1)\big)=0
    Half the trace; HH is traceless.
  2. Step 2:
    XH=12(1−111),cX=12Tr(XH)=12⋅1+12=12XH=\tfrac1{\sqrt2}\begin{pmatrix}1&-1\\1&1\end{pmatrix},\qquad c_X=\tfrac12\mathrm{Tr}(XH)=\tfrac12\cdot\tfrac{1+1}{\sqrt2}=\tfrac1{\sqrt2}
    XX swaps the rows of HH.
  3. Step 3:
    YH=12(−iiii),cY=12Tr(YH)=122(−i+i)=0YH=\tfrac1{\sqrt2}\begin{pmatrix}-i&i\\i&i\end{pmatrix},\qquad c_Y=\tfrac12\mathrm{Tr}(YH)=\tfrac1{2\sqrt2}(-i+i)=0
    YY swaps the rows and multiplies the new rows by −i-i and ii, as in the theorem.
  4. Step 4:
    ZH=12(11−11),cZ=12Tr(ZH)=12ZH=\tfrac1{\sqrt2}\begin{pmatrix}1&1\\-1&1\end{pmatrix},\qquad c_Z=\tfrac12\mathrm{Tr}(ZH)=\tfrac1{\sqrt2}
    ZZ negates the second row of HH.
  5. Step 5:
    H=12X+12Z=n^⋅σ⃗,n^=12(1,0,1),∑P∣cP∣2=12+12=1H=\tfrac1{\sqrt2}X+\tfrac1{\sqrt2}Z=\hat n\cdot\vec\sigma,\qquad\hat n=\tfrac1{\sqrt2}(1,0,1),\qquad\textstyle\sum_P\lvert c_P\rvert^2=\tfrac12+\tfrac12=1
    All coefficients are real, so HH is Hermitian; n^\hat n is a unit vector, so H2=IH^2=I by the vector identity of the next section. The sum of ∣cP∣2\lvert c_P\rvert^2 equals 12Tr(H†H)=1\tfrac12\mathrm{Tr}(H^\dagger H)=1, as for every unitary 2×22\times2 matrix.

Result

(cI,cX,cY,cZ)=(0,12,0,12)≈(0, 0.7071, 0, 0.7071)\boxed{(c_I,c_X,c_Y,c_Z)=\big(0,\tfrac1{\sqrt2},0,\tfrac1{\sqrt2}\big)\approx(0,\,0.7071,\,0,\,0.7071)}

Two qubits. On two qubits the basis is the 1616 Pauli words P0⊗P1P_0\otimes P_1, written as two letters with the left letter acting on qubit 0 (the most significant bit). Since Tr(A⊗B)=TrA TrB\mathrm{Tr}(A\otimes B)=\mathrm{Tr}A\,\mathrm{Tr}B, two words satisfy Tr(PQ)=4δPQ\mathrm{Tr}(PQ)=4\delta_{PQ}, so the coefficients are cP=14Tr(PA)c_P=\tfrac14\mathrm{Tr}(PA). The second decomposer shows the controlled-NOT gate of Module 2.3, CNOT=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X\mathrm{CNOT}=\lvert0\rangle\langle0\rvert\otimes I+\lvert1\rangle\langle1\rvert\otimes X, which flips qubit 1 exactly when qubit 0 is 11.

Derivation

CNOT=12(II+IX+ZI−ZX)\mathrm{CNOT}=\tfrac12\big(II+IX+ZI-ZX\big)

  1. Step 1:
    ∣0⟩⟨0∣=12(I+Z),∣1⟩⟨1∣=12(I−Z)\lvert0\rangle\langle0\rvert=\tfrac12(I+Z),\qquad\lvert1\rangle\langle1\rvert=\tfrac12(I-Z)
    diag(1,0)=12(diag(1,1)+diag(1,−1))\mathrm{diag}(1,0)=\tfrac12\big(\mathrm{diag}(1,1)+\mathrm{diag}(1,-1)\big) and diag(0,1)=12(diag(1,1)−diag(1,−1))\mathrm{diag}(0,1)=\tfrac12\big(\mathrm{diag}(1,1)-\mathrm{diag}(1,-1)\big).
  2. Step 2:
    CNOT=12(I+Z)⊗I+12(I−Z)⊗X=12(I⊗I+Z⊗I+I⊗X−Z⊗X)\mathrm{CNOT}=\tfrac12(I+Z)\otimes I+\tfrac12(I-Z)\otimes X=\tfrac12\big(I\otimes I+Z\otimes I+I\otimes X-Z\otimes X\big)
    Substitute and expand with the bilinearity of ⊗\otimes. As words: IIII, ZIZI, IXIX and ZXZX.
  3. Step 3:
    (Z⊗X) CNOT=Z∣0⟩⟨0∣⊗X+Z∣1⟩⟨1∣⊗X2=∣0⟩⟨0∣⊗X−∣1⟩⟨1∣⊗I(Z\otimes X)\,\mathrm{CNOT}=Z\lvert0\rangle\langle0\rvert\otimes X+Z\lvert1\rangle\langle1\rvert\otimes X^2=\lvert0\rangle\langle0\rvert\otimes X-\lvert1\rangle\langle1\rvert\otimes I
    Mixed-product rule, Z∣0⟩=∣0⟩Z\lvert0\rangle=\lvert0\rangle, Z∣1⟩=−∣1⟩Z\lvert1\rangle=-\lvert1\rangle and X2=IX^2=I.
  4. Step 4:
    cZX=14(Tr∣0⟩⟨0∣⋅TrX−Tr∣1⟩⟨1∣⋅TrI)=14(1⋅0−1⋅2)=−12c_{ZX}=\tfrac14\big(\mathrm{Tr}\lvert0\rangle\langle0\rvert\cdot\mathrm{Tr}X-\mathrm{Tr}\lvert1\rangle\langle1\rvert\cdot\mathrm{Tr}I\big)=\tfrac14(1\cdot0-1\cdot2)=-\tfrac12
    Trace check of one coefficient with Tr(A⊗B)=TrA TrB\mathrm{Tr}(A\otimes B)=\mathrm{Tr}A\,\mathrm{Tr}B; the other three follow the same way.
  5. Step 5:
    ∑P∣cP∣2=4⋅14=1=14Tr(CNOT†CNOT)\textstyle\sum_P\lvert c_P\rvert^2=4\cdot\tfrac14=1=\tfrac14\mathrm{Tr}\big(\mathrm{CNOT}^\dagger\mathrm{CNOT}\big)
    Four coefficients ±12\pm\tfrac12 and twelve zeros; the Parseval identity for an orthogonal basis confirms that nothing is missing.

Result

CNOT0→1=12(II+IX+ZI−ZX)\boxed{\mathrm{CNOT}_{0\to1}=\tfrac12\big(II+IX+ZI-ZX\big)}

The table lists exactly four rows, cII=cIX=cZI=12c_{II}=c_{IX}=c_{ZI}=\tfrac12 and cZX=−12c_{ZX}=-\tfrac12, all real: CNOT\mathrm{CNOT} is Hermitian as well as unitary, like the single Paulis. The letter order matters. With the control on qubit 1 the same computation gives CNOT1→0=12(II+XI+IZ−XZ)\mathrm{CNOT}_{1\to0}=\tfrac12\big(II+XI+IZ-XZ\big): every word is mirrored.

Quick check

Which expression equals the projector ∣0⟩⟨0∣=(1000)\lvert0\rangle\langle0\rvert=\begin{pmatrix}1&0\\0&0\end{pmatrix}?

Select one answer

The identity (a·σ)(b·σ) = (a·b)I + i(a×b)·σ#

Theorem

Product of two Pauli vectors

For all a⃗,b⃗∈R3\vec a,\vec b\in\mathbb R^3 (indeed for any vectors whose components commute with the Paulis): (a⃗⋅σ⃗)(b⃗⋅σ⃗)=(a⃗⋅b⃗) I+i(a⃗×b⃗)⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=(\vec a\cdot\vec b)\,I+i(\vec a\times\vec b)\cdot\vec\sigma. In particular (n^⋅σ⃗)2=I(\hat n\cdot\vec\sigma)^2=I for every unit vector n^\hat n.

Proof (6 steps)
  1. Step 1:
    (a⃗⋅σ⃗)(b⃗⋅σ⃗)=(∑jajσj)(∑kbkσk)=∑j,kajbk σjσk(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=\Big(\textstyle\sum_ja_j\sigma_j\Big)\Big(\sum_kb_k\sigma_k\Big)=\sum_{j,k}a_jb_k\,\sigma_j\sigma_k
    Expand both sums; the scalars aj,bka_j,b_k commute with the matrices.
  2. Step 2:
    =∑j,kajbk(δjkI+i∑lϵjklσl)=\textstyle\sum_{j,k}a_jb_k\big(\delta_{jk}I+i\textstyle\sum_l\epsilon_{jkl}\sigma_l\big)
    Insert the Pauli product formula for each of the nine pairs (j,k)(j,k).
  3. Step 3:
    =(∑jajbj)I+i∑l(∑j,kϵjklajbk)σl=\Big(\textstyle\sum_ja_jb_j\Big)I+i\sum_l\Big(\sum_{j,k}\epsilon_{jkl}a_jb_k\Big)\sigma_l
    The δjk\delta_{jk} collapses the double sum to j=kj=k; in the second term exchange the order of summation.
  4. Step 4:
    ∑j,kϵjklajbk=∑j,kϵljkajbk=(a⃗×b⃗)l\textstyle\sum_{j,k}\epsilon_{jkl}a_jb_k=\sum_{j,k}\epsilon_{ljk}a_jb_k=(\vec a\times\vec b)_l
    ϵ\epsilon is invariant under cyclic permutations, and (a⃗×b⃗)l=∑j,kϵljkajbk(\vec a\times\vec b)_l=\sum_{j,k}\epsilon_{ljk}a_jb_k is the component form of the cross product, e.g. (a⃗×b⃗)3=a1b2−a2b1(\vec a\times\vec b)_3=a_1b_2-a_2b_1.
  5. Step 5:
    (a⃗⋅σ⃗)(b⃗⋅σ⃗)=(a⃗⋅b⃗) I+i(a⃗×b⃗)⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=(\vec a\cdot\vec b)\,I+i(\vec a\times\vec b)\cdot\vec\sigma
    Substitute both identifications.
  6. Step 6:
    a⃗=b⃗=n^:(n^⋅σ⃗)2=(n^⋅n^)I+i(n^×n^)⋅σ⃗=I\vec a=\vec b=\hat n:\quad(\hat n\cdot\vec\sigma)^2=(\hat n\cdot\hat n)I+i(\hat n\times\hat n)\cdot\vec\sigma=I
    n^⋅n^=1\hat n\cdot\hat n=1 and n^×n^=0⃗\hat n\times\hat n=\vec0. This is what makes e−iαn^⋅σ⃗/2=cos⁡α2I−isin⁡α2n^⋅σ⃗e^{-i\alpha\hat n\cdot\vec\sigma/2}=\cos\tfrac\alpha2I-i\sin\tfrac\alpha2\hat n\cdot\vec\sigma in the next lessons.

∎

Quick check

For a⃗=(1,2,0)\vec a=(1,2,0) and b⃗=(0,1,3)\vec b=(0,1,3), write (a⃗⋅σ⃗)(b⃗⋅σ⃗)=c0I+c⃗⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=c_0I+\vec c\cdot\vec\sigma. What is c0c_0?

tolerance ±0.001

Paulis as π rotations of the Bloch sphere#

A gate UU acts on a density operator by ρ↦UρU†\rho\mapsto U\rho U^\dagger. For a Pauli gate U=σj=σj†U=\sigma_j=\sigma_j^\dagger this is ρ↦σjρσj\rho\mapsto\sigma_j\rho\sigma_j. Writing ρ=12(I+r⃗⋅σ⃗)\rho=\tfrac12(I+\vec r\cdot\vec\sigma) (lesson The Bloch Sphere), all we need is the conjugation σjσkσj\sigma_j\sigma_k\sigma_j, which the anticommutation relations settle at once.

Derivation

Derivation of σjρσj\sigma_j\rho\sigma_j for ρ=12(I+r⃗⋅σ⃗)\rho=\tfrac12(I+\vec r\cdot\vec\sigma)

  1. Step 1:
    σjσjσj=σj I=σj\sigma_j\sigma_j\sigma_j=\sigma_j\,I=\sigma_j
    σj2=I\sigma_j^2=I: conjugation by σj\sigma_j fixes σj\sigma_j itself.
  2. Step 2:
    k≠j:σjσkσj=−σkσjσj=−σkk\neq j:\quad\sigma_j\sigma_k\sigma_j=-\sigma_k\sigma_j\sigma_j=-\sigma_k
    Anticommute the first two factors, σjσk=−σkσj\sigma_j\sigma_k=-\sigma_k\sigma_j, then use σj2=I\sigma_j^2=I.
  3. Step 3:
    XYX=(XY)X=iZX=i(iY)=−Y,XZX=(XZ)X=−iYX=−i(−iZ)=−ZXYX=(XY)X=iZX=i(iY)=-Y,\qquad XZX=(XZ)X=-iYX=-i(-iZ)=-Z
    The same two conjugations checked directly from the product table.
  4. Step 4:
    XρX=12(XIX+rxXXX+ryXYX+rzXZX)=12(I+rxX−ryY−rzZ)X\rho X=\tfrac12\big(XIX+r_xXXX+r_yXYX+r_zXZX\big)=\tfrac12\big(I+r_xX-r_yY-r_zZ\big)
    Linearity of ρ↦XρX\rho\mapsto X\rho X and the two rules above with j=1j=1.
  5. Step 5:
    YρY=12(I−rxX+ryY−rzZ),ZρZ=12(I−rxX−ryY+rzZ)Y\rho Y=\tfrac12\big(I-r_xX+r_yY-r_zZ\big),\qquad Z\rho Z=\tfrac12\big(I-r_xX-r_yY+r_zZ\big)
    Same computation with j=2j=2 and j=3j=3: the component along the gate's own axis survives, the two perpendicular components change sign.
  6. Step 6:
    Rn^(π)=cos⁡π2 I−isin⁡π2 n^⋅σ⃗=−i n^⋅σ⃗ ⇒ X=iRx(π), Y=iRy(π), Z=iRz(π)R_{\hat n}(\pi)=\cos\tfrac\pi2\,I-i\sin\tfrac\pi2\,\hat n\cdot\vec\sigma=-i\,\hat n\cdot\vec\sigma\ \Rightarrow\ X=iR_x(\pi),\ Y=iR_y(\pi),\ Z=iR_z(\pi)
    The rotation formula Rn^(α)=e−iαn^⋅σ⃗/2R_{\hat n}(\alpha)=e^{-i\alpha\hat n\cdot\vec\sigma/2} at α=π\alpha=\pi. The factor ii is a global phase, so each Pauli gate is the rotation by π\pi about its own axis.
  7. Step 7:
    MX=(1000−1000−1),MY=(−10001000−1),MZ=(−1000−10001)M_X=\begin{pmatrix}1&0&0\\0&-1&0\\0&0&-1\end{pmatrix},\quad M_Y=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&-1\end{pmatrix},\quad M_Z=\begin{pmatrix}-1&0&0\\0&-1&0\\0&0&1\end{pmatrix}
    Read off the maps r⃗↦Mr⃗\vec r\mapsto M\vec r from the coefficients above. Each MM is the SO(3)SO(3) rotation by π\pi about x^\hat x, y^\hat y, z^\hat z respectively (e.g. about x^\hat x: (ry,rz)↦(rycos⁡π−rzsin⁡π, rysin⁡π+rzcos⁡π)=(−ry,−rz)(r_y,r_z)\mapsto(r_y\cos\pi-r_z\sin\pi,\ r_y\sin\pi+r_z\cos\pi)=(-r_y,-r_z)): a half turn keeps the axis and reverses the plane perpendicular to it.

Result

X:(rx,ry,rz)↦(rx,−ry,−rz),Y:(rx,ry,rz)↦(−rx,ry,−rz),Z:(rx,ry,rz)↦(−rx,−ry,rz)\boxed{X:(r_x,r_y,r_z)\mapsto(r_x,-r_y,-r_z),\qquad Y:(r_x,r_y,r_z)\mapsto(-r_x,r_y,-r_z),\qquad Z:(r_x,r_y,r_z)\mapsto(-r_x,-r_y,r_z)}

Circuit · 1 qubit

Quantum circuit on 1 qubitX on q0q0X

The bit flip: X∣0⟩=∣1⟩X\lvert0\rangle=\lvert1\rangle. On the Bloch sphere the north pole (0,0,1)(0,0,1) is rotated by π\pi about the xx axis to the south pole (0,0,−1)(0,0,-1).

∣ψ⟩=1∣1⟩\lvert\psi\rangle = 1\lvert 1\rangle

Circuit · 1 qubit

Quantum circuit on 1 qubitH on q0; Z on q0q0HZ

The phase flip: HH prepares ∣+⟩\lvert+\rangle at (1,0,0)(1,0,0), then Z∣+⟩=12(∣0⟩−∣1⟩)=∣−⟩Z\lvert+\rangle=\tfrac1{\sqrt2}(\lvert0\rangle-\lvert1\rangle)=\lvert-\rangle. The rotation by π\pi about zz sends (1,0,0)(1,0,0) to (−1,0,0)(-1,0,0); the measurement probabilities in the computational basis do not change, only the relative phase does.

∣ψ⟩=12∣0⟩−12∣1⟩\lvert\psi\rangle = \tfrac{1}{\sqrt{2}}\lvert 0\rangle - \tfrac{1}{\sqrt{2}}\lvert 1\rangle

Quick check

A qubit with Bloch vector r⃗=(0.3,−0.5,0.8)\vec r=(0.3,-0.5,0.8) passes through YY and then ZZ. What is the yy component of the final Bloch vector?

tolerance ±0.001

Quick check

Which state is left on the same point of the Bloch sphere by the gate YY?

Select one answer

Check it numerically. The snippet below uses the simulator's exact gate matrices to confirm XY=iZXY=iZ, YX=−iZYX=-iZ and XYZ=iIXYZ=iI, and then decomposes the worked example BB in the Pauli basis with bP=12Tr(PB)b_P=\tfrac12\mathrm{Tr}(PB) and rebuilds it.

TypeScriptrunnable
import { I2, matrix, PAULI_X, PAULI_Y, PAULI_Z } from '@/lib/quantum-simulator';

// The Pauli algebra: XY = iZ, YX = -iZ, XYZ = iI
const iZ = matrix.scale(PAULI_Z, { re: 0, im: 1 });
console.log('XY == iZ: ' + matrix.approxEqual(matrix.mul(PAULI_X, PAULI_Y), iZ));
console.log('YX == -iZ: ' + matrix.approxEqual(matrix.mul(PAULI_Y, PAULI_X), matrix.scale(iZ, -1)));
console.log('XYZ == iI: ' + matrix.approxEqual(matrix.mulAll(PAULI_X, PAULI_Y, PAULI_Z), matrix.scale(I2, { re: 0, im: 1 })));

// Pauli decomposition of B = [[1, 2+i], [2-i, -1]] with b_P = Tr(P B) / 2
const B = matrix.fromRows([[[1, 0], [2, 1]], [[2, -1], [-1, 0]]]);
const names = ['I', 'X', 'Y', 'Z'];
const paulis = [I2, PAULI_X, PAULI_Y, PAULI_Z];
let rebuilt = matrix.zeros(2);
paulis.forEach((P, k) => {
  const t = matrix.trace(matrix.mul(P, B));
  const b = t.re / 2;
  console.log('b_' + names[k] + ' = ' + b.toFixed(4) + '  (imaginary part ' + Math.abs(t.im / 2).toFixed(4) + ')');
  rebuilt = matrix.add(rebuilt, matrix.scale(P, b));
});
console.log('sum_P b_P P == B: ' + matrix.approxEqual(rebuilt, B));

Expected output

XY == iZ: true
YX == -iZ: true
XYZ == iI: true
b_I = 0.0000  (imaginary part 0.0000)
b_X = 2.0000  (imaginary part 0.0000)
b_Y = -1.0000  (imaginary part 0.0000)
b_Z = 1.0000  (imaginary part 0.0000)
sum_P b_P P == B: true

References

  1. M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), §2.1.3 (the Pauli matrices) and §4.2 (single qubit operations).doi:10.1017/CBO9780511976667
  2. J. Preskill, Lecture Notes for Physics 219: Quantum Computation, Chapter 2 (foundations: the qubit, Pauli operators and the Bloch sphere).theory.caltech.edu

Hands-on labs

  • Pauli products and the Pauli decomposition

    2 steps · auto-graded

    Multiply two Pauli matrices by hand to see XY=iZXY=iZ (and why the order matters), then expand a Hermitian 2×22\times2 matrix in the Pauli basis using aP=12Tr(PA)a_P=\tfrac12\mathrm{Tr}(PA).

    Open lab