Simple Algorithm
Quantum Computing · Rydberg State · 26 min

Pauli Exponentials & Rotation Algebra

exp(-iθP/2), commutation, and composing rotations.

Nearly every gate a compiler emits is a Pauli exponential e−iθP/2e^{-i\theta P/2}: a single-qubit rotation, a ZZZZ interaction, a Trotter step, a chemistry excitation. Three facts (that P2=IP^2=\id, that Paulis commute or anticommute, and that Cliffords permute Paulis) let you multiply, reorder and synthesize them at will.

What you’ll learn

  • Prove e−iθP/2=cos⁡θ2 I−isin⁡θ2 Pe^{-i\theta P/2}=\cos\tfrac\theta2\,\id-i\sin\tfrac\theta2\,P for any Pauli string, and derive the commuting, anticommuting and conjugation rules.
  • Compose two rotations with the Euler–Rodrigues (quaternion) formula.
  • Show that Rx(ε)Ry(ε)Rx(−ε)Ry(−ε)=Rz(ε2)+O(ε3)R_x(\varepsilon)R_y(\varepsilon)R_x(-\varepsilon)R_y(-\varepsilon)=R_z(\varepsilon^2)+\order{\varepsilon^3} and explain its role in Solovay–Kitaev and in Trotter error.
  • Synthesize any multi-qubit Pauli rotation with basis changes and a CNOT ladder, and count its cost.

One formula, four rules

The proof is the even/odd split of the power series from the Excited State lesson; nothing in it used n=1n=1. Four rules follow at once, and together they are the algebra of circuit rewriting.

RuleStatementWhy
Commuting[P,Q]=0⇒e−iaPe−ibQ=e−i(aP+bQ)=e−ibQe−iaP\comm{P}{Q}=0\Rightarrow e^{-iaP}e^{-ibQ}=e^{-i(aP+bQ)}=e^{-ibQ}e^{-iaP}Exponents of commuting operators add.
Anticommuting{P,Q}=0⇒Q e−iθP/2=e+iθP/2 Q\acomm{P}{Q}=0\Rightarrow Q\,e^{-i\theta P/2}=e^{+i\theta P/2}\,QPushing QQ through flips the sign of the PP term.
ConjugationU e−iθP/2 U†=e−iθ UPU†/2U\,e^{-i\theta P/2}\,U^\dagger=e^{-i\theta\,UPU^\dagger/2}True for any unitary; for a Clifford, UPU†UPU^\dagger is again a Pauli string.
Operator rotation{P,Q}=0⇒e−iθP/2 Q eiθP/2=cos⁡θ Q−isin⁡θ PQ\acomm{P}{Q}=0\Rightarrow e^{-i\theta P/2}\,Q\,e^{i\theta P/2}=\cos\theta\,Q-i\sin\theta\,PQCombine the anticommuting rule with P2=IP^2=\id; −iPQ-iPQ is again a Hermitian Pauli string.
Check your understanding

Which equals X Rz(θ) XX\,R_z(\theta)\,X?

  1. Rz(θ)R_z(\theta)
  2. Rz(−θ)R_z(-\theta)
  3. Rx(θ)R_x(\theta)
  4. −Rz(θ)-R_z(\theta)
Show the answer

B. Rz(−θ)R_z(-\theta)

XX anticommutes with ZZ, so XRz(θ)=Rz(−θ)XXR_z(\theta)=R_z(-\theta)X and therefore XRz(θ)X=Rz(−θ)XR_z(\theta)X=R_z(-\theta). On the Bloch sphere, a half-turn about xx flips the zz-axis and so reverses the sense of the rotation.

Composing rotations

DerivationThe Euler–Rodrigues composition law
  1. Rn^1(θ1)Rn^2(θ2)=(c1I−is1 n^1⋅σ⃗)(c2I−is2 n^2⋅σ⃗)R_{\hat n_1}(\theta_1)R_{\hat n_2}(\theta_2)=(c_1\id-is_1\,\hat n_1\cdot\vec\sigma)(c_2\id-is_2\,\hat n_2\cdot\vec\sigma)

    Write ck=cos⁡θk2c_k=\cos\tfrac{\theta_k}{2} and sk=sin⁡θk2s_k=\sin\tfrac{\theta_k}{2}.

  2. =c1c2 I−i (s1c2 n^1+c1s2 n^2)⋅σ⃗−s1s2 (n^1⋅σ⃗)(n^2⋅σ⃗)=c_1c_2\,\id-i\,(s_1c_2\,\hat n_1+c_1s_2\,\hat n_2)\cdot\vec\sigma-s_1s_2\,(\hat n_1\cdot\vec\sigma)(\hat n_2\cdot\vec\sigma)

    Expand.

  3. =(c1c2−s1s2 n^1⋅n^2)I−i(s1c2 n^1+c1s2 n^2+s1s2 n^1×n^2)⋅σ⃗=\big(c_1c_2-s_1s_2\,\hat n_1\cdot\hat n_2\big)\id-i\big(s_1c_2\,\hat n_1+c_1s_2\,\hat n_2+s_1s_2\,\hat n_1\times\hat n_2\big)\cdot\vec\sigma

    Apply (a⃗⋅σ⃗)(b⃗⋅σ⃗)=(a⃗⋅b⃗)I+i(a⃗×b⃗)⋅σ⃗(\vec a\cdot\vec\sigma)(\vec b\cdot\vec\sigma)=(\vec a\cdot\vec b)\id+i(\vec a\times\vec b)\cdot\vec\sigma.

  4. cos⁡θ32=c1c2−s1s2 n^1⋅n^2,sin⁡θ32 n^3=s1c2 n^1+c1s2 n^2+s1s2 n^1×n^2\cos\tfrac{\theta_3}{2}=c_1c_2-s_1s_2\,\hat n_1\cdot\hat n_2,\qquad\sin\tfrac{\theta_3}{2}\,\hat n_3=s_1c_2\,\hat n_1+c_1s_2\,\hat n_2+s_1s_2\,\hat n_1\times\hat n_2

    Read off the composite Rn^3(θ3)R_{\hat n_3}(\theta_3). This is quaternion multiplication: SU(2)SU(2) is the group of unit quaternions, and the cross product is why the order matters.

Predict before you look

Use the law: by what angle does Rx(π2) Ry(π2)R_x(\tfrac\pi2)\,R_y(\tfrac\pi2) rotate the Bloch sphere?

Show the answer

120 °

x^⋅y^=0\hat x\cdot\hat y=0, so cos⁡θ32=c1c2=12\cos\tfrac{\theta_3}{2}=c_1c_2=\tfrac12 and θ3=120°\theta_3=120°.

Commutators: what non-commuting rotations leave behind

DerivationThe group commutator
  1. eAeBe−Ae−B=exp⁡ ⁣([A,B]+O(ε3))when ∥A∥,∥B∥=O(ε)e^{A}e^{B}e^{-A}e^{-B}=\exp\!\big(\comm{A}{B}+\order{\varepsilon^3}\big)\qquad\text{when }\norm{A},\norm{B}=\order{\varepsilon}

    Baker–Campbell–Hausdorff to second order: the first-order terms cancel.

  2. A=−iε2X,B=−iε2Y,[A,B]=−ε24[X,Y]=−iε22 ZA=-\tfrac{i\varepsilon}{2}X,\quad B=-\tfrac{i\varepsilon}{2}Y,\qquad\comm{A}{B}=-\tfrac{\varepsilon^2}{4}\comm{X}{Y}=-\tfrac{i\varepsilon^2}{2}\,Z

    For rotations about xx and yy, using [X,Y]=2iZ\comm{X}{Y}=2iZ.

  3. Rx(ε)Ry(ε)Rx(−ε)Ry(−ε)=Rz(ε2)+O(ε3)R_x(\varepsilon)R_y(\varepsilon)R_x(-\varepsilon)R_y(-\varepsilon)=R_z(\varepsilon^2)+\order{\varepsilon^3}

    Small wiggles about xx and yy leave behind a much smaller rotation about the third axis.

This one identity explains three things.

  • Two axes generate everything. Rotations about two non-parallel axes generate all of SU(2)SU(2): commutators supply the missing direction, so the Lie algebra they generate is all of su(2)\mathfrak{su}(2).
  • Solovay–Kitaev. A rotation δ\delta-close to I\id is a group commutator of two rotations of size O(δ)\order{\sqrt\delta}, and replacing those by δ\delta-accurate approximations costs only O(δ3/2)\order{\delta^{3/2}} error. Recursing gives accuracy εk∼εk−13/2\varepsilon_k\sim\varepsilon_{k-1}^{3/2} at length ℓk=5ℓk−1\ell_k=5\ell_{k-1}, hence O(log⁡c(1/ε))\order{\log^{c}(1/\varepsilon)} gates with c=log⁡5/log⁡32≈3.97c=\log5/\log\tfrac32\approx3.97 (Dawson & Nielsen 2006).
  • Trotter error. First-order product formulas fail at second order, through the commutator: ∥e−i(A+B)t−(e−iAt/re−iBt/r)r∥≤t22r∥[A,B]∥\norm{e^{-i(A+B)t}-\big(e^{-iAt/r}e^{-iBt/r}\big)^r}\le\tfrac{t^2}{2r}\norm{\comm{A}{B}}.

Multi-qubit Pauli rotations

DerivationA ZZ rotation from two CNOTs
  1. CNOT (I⊗Rz(θ)) CNOT ∣x1x2⟩=CNOT (I⊗Rz(θ))∣x1, x1⊕x2⟩\mathrm{CNOT}\,\big(\id\otimes R_z(\theta)\big)\,\mathrm{CNOT}\,\ket{x_1x_2}=\mathrm{CNOT}\,\big(\id\otimes R_z(\theta)\big)\ket{x_1,\,x_1\oplus x_2}

    The first CNOT writes the parity x1⊕x2x_1\oplus x_2 onto qubit 2.

  2. =e−iθ(−1)x1⊕x2/2∣x1x2⟩=e−iθz1z2/2∣x1x2⟩,zj=(−1)xj=e^{-i\theta(-1)^{x_1\oplus x_2}/2}\ket{x_1x_2}=e^{-i\theta z_1z_2/2}\ket{x_1x_2},\qquad z_j=(-1)^{x_j}

    Rz(θ)∣b⟩=e−iθ(−1)b/2∣b⟩R_z(\theta)\ket b=e^{-i\theta(-1)^b/2}\ket b, and the second CNOT restores qubit 2.

  3. CNOT (I⊗Rz(θ)) CNOT=e−iθ Z⊗Z/2\mathrm{CNOT}\,\big(\id\otimes R_z(\theta)\big)\,\mathrm{CNOT}=e^{-i\theta\,Z\otimes Z/2}

    They agree on every basis state, so they are equal as operators.

For a general Pauli string, use the conjugation rule. Rotate each non-identity factor to ZZ with a single-qubit Clifford (HH maps X↦ZX\mapsto Z; HS†HS^\dagger maps Y↦ZY\mapsto Z), compute the parity of the ww affected qubits onto one of them with a CNOT ladder, apply Rz(θ)R_z(\theta) there, and undo everything. A weight-ww rotation costs 2(w−1)2(w-1) CNOTs, one RzR_z and at most 2w2w single-qubit Cliffords. This "phase gadget" is the workhorse of Trotterized simulation and variational ansätze.

Key takeaways

  • For any Pauli string, e−iθP/2=cos⁡θ2 I−isin⁡θ2 Pe^{-i\theta P/2}=\cos\tfrac\theta2\,\id-i\sin\tfrac\theta2\,P. Commuting exponents add, anticommuting Paulis flip the angle, and Ue−iθP/2U†=e−iθ UPU†/2Ue^{-i\theta P/2}U^\dagger=e^{-i\theta\,UPU^\dagger/2}.
  • Rotations compose like unit quaternions, cos⁡θ32=c1c2−s1s2 n^1⋅n^2\cos\tfrac{\theta_3}{2}=c_1c_2-s_1s_2\,\hat n_1\cdot\hat n_2; for example Rx(π2)Ry(π2)=R(1,1,1)/3(2π3)R_x(\tfrac\pi2)R_y(\tfrac\pi2)=R_{(1,1,1)/\sqrt3}(\tfrac{2\pi}{3}).
  • The group commutator of two ε\varepsilon-rotations is an ε2\varepsilon^2-rotation about the third axis: the engine of Solovay–Kitaev and the source of Trotter error.
  • e−iθZZ/2=CNOT (I⊗Rz(θ)) CNOTe^{-i\theta ZZ/2}=\mathrm{CNOT}\,(\id\otimes R_z(\theta))\,\mathrm{CNOT}; a weight-ww Pauli rotation costs 2(w−1)2(w-1) CNOTs plus Clifford basis changes.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Which equals Z e−iθX/2Z\,e^{-i\theta X/2}?

  1. e−iθX/2 Ze^{-i\theta X/2}\,Z
  2. e+iθX/2 Ze^{+i\theta X/2}\,Z
  3. e−iθY/2 Ze^{-i\theta Y/2}\,Z
  4. −e−iθX/2 Z-e^{-i\theta X/2}\,Z
Show the answer

B. e+iθX/2 Ze^{+i\theta X/2}\,Z

ZZ anticommutes with XX, so Z(cos⁡θ2 I−isin⁡θ2 X)=(cos⁡θ2 I+isin⁡θ2 X)Z=e+iθX/2ZZ\big(\cos\tfrac\theta2\,\id-i\sin\tfrac\theta2\,X\big)=\big(\cos\tfrac\theta2\,\id+i\sin\tfrac\theta2\,X\big)Z=e^{+i\theta X/2}Z.

Question 2

About which axis does Ry(π2) Rx(π2)R_y(\tfrac\pi2)\,R_x(\tfrac\pi2) rotate?

  1. (1,1,−1)/3(1,1,-1)/\sqrt3
  2. (1,1,1)/3(1,1,1)/\sqrt3
  3. z^\hat z
  4. (1,−1,1)/3(1,-1,1)/\sqrt3
Show the answer

A. (1,1,−1)/3(1,1,-1)/\sqrt3

With n^1=y^\hat n_1=\hat y and n^2=x^\hat n_2=\hat x: sin⁡θ32 n^3=12(y^+x^+y^×x^)=12(x^+y^−z^)\sin\tfrac{\theta_3}{2}\,\hat n_3=\tfrac12(\hat y+\hat x+\hat y\times\hat x)=\tfrac12(\hat x+\hat y-\hat z). The cross-product term is what makes the order matter.

Question 3

With a simple CNOT ladder, how many CNOTs does e−iθ X⊗Y⊗Z⊗X/2e^{-i\theta\,X\otimes Y\otimes Z\otimes X/2} need?

  1. 3
  2. 4
  3. 8
  4. 6
Show the answer

D. 6

Weight w=4w=4: three CNOTs compute the parity and three uncompute it, 2(w−1)=62(w-1)=6. The basis changes are single-qubit Cliffords and cost no CNOTs.

Question 4

To leading order, what is Rx(ε)Ry(ε)Rx(−ε)Ry(−ε)R_x(\varepsilon)R_y(\varepsilon)R_x(-\varepsilon)R_y(-\varepsilon)?

  1. I\id, exactly
  2. Rz(2ε)R_z(2\varepsilon)
  3. Rz(ε2)R_z(\varepsilon^2), up to O(ε3)\order{\varepsilon^3}
  4. Rx(ε2)R_x(\varepsilon^2)
Show the answer

C. Rz(ε2)R_z(\varepsilon^2), up to O(ε3)\order{\varepsilon^3}

The group commutator is exp⁡[A,B]\exp\comm{A}{B} to leading order, with A=−iε2XA=-\tfrac{i\varepsilon}{2}X, B=−iε2YB=-\tfrac{i\varepsilon}{2}Y and [A,B]=−iε22Z\comm{A}{B}=-\tfrac{i\varepsilon^2}{2}Z: a rotation by ε2\varepsilon^2 about zz.

Further reading

  • M. A. Nielsen & I. L. Chuang, Quantum Computation and Quantum Information, §4.2 (Exercise 4.15) and §4.7 (Cambridge, 10th anniv. ed., 2010).
  • S. Lloyd, "Universal quantum simulators", Science 273, 1073 (1996).
  • C. M. Dawson & M. A. Nielsen, "The Solovay–Kitaev algorithm", Quantum Inf. Comput. 6, 81 (2006).
  • A. M. Childs, Y. Su, M. C. Tran, N. Wiebe & S. Zhu, "Theory of Trotter error with commutator scaling", Phys. Rev. X 11, 011020 (2021).
  • D. Litinski, "A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery", Quantum 3, 128 (2019).