Reference ~2 min read

Appendix E — Math Identities Cheat-Sheet

The identities you'll reach for constantly. Conventions match Appendix C: ℏ=1\hbar = 1, big-endian qubits, rotation gates use the half-angle e−iθσ/2e^{-i\theta\sigma/2}.


1. Pauli Matrices

I=(1001),X=(0110),Y=(0−ii0),Z=(100−1). I=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad 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}.

Basic properties (let σj∈{X,Y,Z}\sigma_j \in \{X,Y,Z\}):

  • Hermitian and unitary: σj=σj†\sigma_j = \sigma_j^\dagger and σj2=I\sigma_j^2 = I.
  • Traceless: Tr(σj)=0\mathrm{Tr}(\sigma_j) = 0; eigenvalues ±1\pm 1.
  • det⁡(σj)=−1\det(\sigma_j) = -1.

Products and (anti)commutators (with Levi-Civita εjkl\varepsilon_{jkl}, {j,k,l}\{j,k,l\} a permutation of {x,y,z}\{x,y,z\}):

XY=iZ,YZ=iX,ZX=iY(cyclic); XY = iZ,\quad YZ = iX,\quad ZX = iY \qquad(\text{cyclic}); [σj,σk]=2i εjkl σl,{σj,σk}=2 δjkI,σjσk=δjkI+i εjklσl. [\sigma_j,\sigma_k] = 2i\,\varepsilon_{jkl}\,\sigma_l,\qquad \{\sigma_j,\sigma_k\} = 2\,\delta_{jk} I,\qquad \sigma_j\sigma_k = \delta_{jk} I + i\,\varepsilon_{jkl}\sigma_l.

Completeness: {I,X,Y,Z}\{I, X, Y, Z\} is an orthogonal basis for 2×22\times2 Hermitian matrices under the Hilbert–Schmidt inner product ⟨A,B⟩=Tr(A†B)\langle A,B\rangle = \mathrm{Tr}(A^\dagger B), with Tr(σjσk)=2δjk\mathrm{Tr}(\sigma_j\sigma_k) = 2\delta_{jk}. Hence any single-qubit density matrix is

ρ=12(I+r⃗⋅σ⃗),r⃗=(⟨X⟩,⟨Y⟩,⟨Z⟩),  ∣r⃗∣≤1. \rho = \tfrac12\big(I + \vec r\cdot\vec\sigma\big),\qquad \vec r = (\langle X\rangle,\langle Y\rangle,\langle Z\rangle),\ \ |\vec r|\le 1.

2. Common Gate Matrices

H=12(111−1),S=(100i),T=(100eiπ/4). H=\frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix},\quad S=\begin{pmatrix}1&0\\0&i\end{pmatrix},\quad T=\begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix}.

Relations: S=T2S = T^2, Z=S2Z = S^2, HXH=ZH X H = Z, HZH=XH Z H = X, HYH=−YH Y H = -Y, SXS†=YS X S^\dagger = Y.

Two-qubit (big-endian, control = qubit 0):

CNOT=(1000010000010010),CZ=(100001000010000−1),SWAP=(1000001001000001). \text{CNOT}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix},\quad \text{CZ}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&-1\end{pmatrix},\quad \text{SWAP}=\begin{pmatrix}1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{pmatrix}.

Useful: CZ=(I⊗H) CNOT (I⊗H)\text{CZ} = (I\otimes H)\,\text{CNOT}\,(I\otimes H), and SWAP=CNOT01 CNOT10 CNOT01\text{SWAP} = \text{CNOT}_{01}\,\text{CNOT}_{10}\,\text{CNOT}_{01}.


3. Rotation Gates (Exponentials of Paulis)

Since σj2=I\sigma_j^2 = I, the exponential closes into sines and cosines:

e−iθ n^⋅σ⃗/2=cos⁡ ⁣θ2 I−isin⁡ ⁣θ2 (n^⋅σ⃗),∣n^∣=1. e^{-i\theta\,\hat n\cdot\vec\sigma/2} = \cos\!\tfrac{\theta}{2}\,I - i\sin\!\tfrac{\theta}{2}\,(\hat n\cdot\vec\sigma), \qquad |\hat n| = 1.

The single-axis rotations:

Rx(θ)=(cos⁡θ2−isin⁡θ2−isin⁡θ2cos⁡θ2), Ry(θ)=(cos⁡θ2−sin⁡θ2sin⁡θ2cos⁡θ2), Rz(θ)=(e−iθ/200eiθ/2). R_x(\theta)=\begin{pmatrix}\cos\frac\theta2 & -i\sin\frac\theta2\\ -i\sin\frac\theta2 & \cos\frac\theta2\end{pmatrix},\ R_y(\theta)=\begin{pmatrix}\cos\frac\theta2 & -\sin\frac\theta2\\ \sin\frac\theta2 & \cos\frac\theta2\end{pmatrix},\ R_z(\theta)=\begin{pmatrix}e^{-i\theta/2}&0\\0&e^{i\theta/2}\end{pmatrix}.

Identities:

  • Rz(π)=e−iπ/2ZR_z(\pi) = e^{-i\pi/2}Z,  Rx(π)=−iX\ R_x(\pi) = -iX,  Ry(π)=−iY\ R_y(\pi) = -iY (note the global phases).
  • H=eiπ/2Ry(π2)Rz(π)H = e^{i\pi/2} R_y(\tfrac{\pi}{2}) R_z(\pi) (up to global phase); more simply HH is a π\pi rotation about the n^=(x^+z^)/2\hat n = (\hat x + \hat z)/\sqrt2 axis.

Euler (ZYZ) decomposition. Any single-qubit unitary UU can be written, for some α,β,γ,δ∈R\alpha,\beta,\gamma,\delta\in\mathbb R,

U=eiα Rz(β) Ry(γ) Rz(δ). U = e^{i\alpha}\,R_z(\beta)\,R_y(\gamma)\,R_z(\delta).

This is why {Ry,Rz}\{R_y, R_z\} (plus phase) generate all of SU(2)SU(2) — see Term 2.2.


4. Operator Identities

  • Adjoint of a product: (AB)†=B†A†(AB)^\dagger = B^\dagger A^\dagger; (A⊗B)†=A†⊗B†(A\otimes B)^\dagger = A^\dagger\otimes B^\dagger.
  • Trace is cyclic: Tr(ABC)=Tr(CAB)=Tr(BCA)\mathrm{Tr}(ABC) = \mathrm{Tr}(CAB) = \mathrm{Tr}(BCA) (basis-independent).
  • Trace of a tensor product: Tr(A⊗B)=Tr(A) Tr(B)\mathrm{Tr}(A\otimes B) = \mathrm{Tr}(A)\,\mathrm{Tr}(B).
  • Expectation: ⟨A⟩=Tr(ρA)\langle A\rangle = \mathrm{Tr}(\rho A); for pure ρ=∣ψ⟩⟨ψ∣\rho=|\psi\rangle\langle\psi|, =⟨ψ∣A∣ψ⟩=\langle\psi|A|\psi\rangle.
  • Spectral decomposition: a normal operator A=∑iλi∣vi⟩⟨vi∣A=\sum_i \lambda_i |v_i\rangle\langle v_i| with {∣vi⟩}\{|v_i\rangle\} orthonormal; then f(A)=∑if(λi)∣vi⟩⟨vi∣f(A)=\sum_i f(\lambda_i)|v_i\rangle\langle v_i| for any function ff.
  • Function of a unitary's generator: if H=∑iEi∣Ei⟩⟨Ei∣H=\sum_i E_i|E_i\rangle\langle E_i| then e−iHt=∑ie−iEit∣Ei⟩⟨Ei∣e^{-iHt}=\sum_i e^{-iE_i t}|E_i\rangle\langle E_i|.

Baker–Campbell–Hausdorff (BCH):

eAeB=eA+B+12[A,B]+112[A,[A,B]]−112[B,[A,B]]+⋯. e^{A}e^{B} = e^{A+B+\frac12[A,B]+\frac1{12}[A,[A,B]]-\frac1{12}[B,[A,B]]+\cdots}.

If [A,B]=0[A,B]=0 then eAeB=eA+Be^A e^B = e^{A+B}. This is exactly why Trotterization is needed when [A,B]≠0[A,B]\neq 0 (see Term 3.4):

e−i(A+B)t=lim⁡n→∞(e−iAt/ne−iBt/n)n,e−i(A+B)δ=e−iAδe−iBδ+O(δ2). e^{-i(A+B)t} = \lim_{n\to\infty}\Big(e^{-iAt/n}e^{-iBt/n}\Big)^{n},\qquad e^{-i(A+B)\delta} = e^{-iA\delta}e^{-iB\delta} + O(\delta^2).

Hadamard lemma (operator conjugation):

eABe−A=B+[A,B]+12![A,[A,B]]+⋯ . e^{A}Be^{-A} = B + [A,B] + \tfrac1{2!}[A,[A,B]] + \cdots.

5. Tensor-Product (Kronecker) Identities

  • Mixed-product: (A⊗B)(C⊗D)=(AC)⊗(BD)(A\otimes B)(C\otimes D) = (AC)\otimes(BD).
  • Action on product states: (A⊗B)(∣a⟩⊗∣b⟩)=(A∣a⟩)⊗(B∣b⟩)(A\otimes B)(|a\rangle\otimes|b\rangle) = (A|a\rangle)\otimes(B|b\rangle).
  • Adjoint / inverse / transpose distribute: (A⊗B)−1=A−1⊗B−1(A\otimes B)^{-1} = A^{-1}\otimes B^{-1}, etc.
  • Eigenvalues: if A∣u⟩=a∣u⟩A|u\rangle=a|u\rangle and B∣v⟩=b∣v⟩B|v\rangle=b|v\rangle, then (A⊗B)(∣u⟩⊗∣v⟩)=ab (∣u⟩⊗∣v⟩)(A\otimes B)(|u\rangle\otimes|v\rangle) = ab\,(|u\rangle\otimes|v\rangle).
  • Dimension: A (m×m)⊗B (n×n)A\,(m\times m)\otimes B\,(n\times n) is mn×mnmn\times mn.

6. Complex Numbers, Roots of Unity, and the QFT Kernel

  • Euler: eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta;  ∣eiθ∣=1\ |e^{i\theta}|=1.
  • NN-th roots of unity: ω=e2πi/N\omega = e^{2\pi i/N} satisfies ωN=1\omega^N = 1 and ∑k=0N−1ωk=0\sum_{k=0}^{N-1}\omega^{k} = 0 (for N>1N>1).
  • Geometric sum: ∑k=0N−1rk=1−rN1−r\displaystyle\sum_{k=0}^{N-1} r^k = \frac{1-r^N}{1-r} for r≠1r\neq1.
  • Orthogonality (DFT/QFT core): 1N∑x=0N−1e2πix(j−k)/N=δjk.\displaystyle \frac1N\sum_{x=0}^{N-1} e^{2\pi i x(j-k)/N} = \delta_{jk}.
  • QFT action: QFT ∣x⟩=1N∑y=0N−1e2πixy/N ∣y⟩,N=2n.\displaystyle \text{QFT}\,|x\rangle = \frac{1}{\sqrt N}\sum_{y=0}^{N-1} e^{2\pi i xy/N}\,|y\rangle,\quad N=2^n.

7. Probability & Statistics (for shots and estimation)

  • Born rule: pi=∣⟨i∣ψ⟩∣2p_i = |\langle i|\psi\rangle|^2; ∑ipi=1\sum_i p_i = 1.
  • Sample-mean estimator of ⟨A⟩\langle A\rangle from MM shots has standard error σ/M\sigma/\sqrt M; halving the error costs 4×4\times the shots. Plan QPU budgets accordingly.
  • Binomial outcome: estimating a probability pp from MM shots gives variance p(1−p)/Mp(1-p)/M.
  • Hoeffding bound: Pr⁡[ ∣p^−p∣≥ϵ ]≤2e−2Mϵ2\Pr[\,|\hat p - p| \ge \epsilon\,] \le 2e^{-2M\epsilon^2} — how many shots guarantee a target confidence.

8. Frequently Used Special Values

Quantity Value
cos⁡(π/8), sin⁡(π/8)\cos(\pi/8),\ \sin(\pi/8) ≈0.9239, 0.3827\approx 0.9239,\ 0.3827
$\langle 0 H
Optimal Grover iterations (database size NN, one marked) ⌊π4N⌋\big\lfloor \frac{\pi}{4}\sqrt N \big\rfloor
CHSH classical bound / quantum (Tsirelson) bound 22 / 222\sqrt2
Purity range for dd-dim state [1d, 1]\big[\tfrac1d,\,1\big]
QFT gate count (nn qubits) Θ(n2)\Theta(n^2)

Further Reading

  • [NC] Nielsen & Chuang, §2.1, §4.2, and the inside-cover gate tables.
  • [Pre] Preskill, Ch. 2–3 for the operator algebra; Ch. 5 for channels.
  • Appendix C — Notation & Glossary for symbol conventions.

← Prev: Appendix D — References · Back to Program Index →