Appendix E — Math Identities Cheat-Sheet
The identities you'll reach for constantly. Conventions match Appendix C :
ℏ = 1 \hbar = 1 ℏ = 1 , big-endian qubits, rotation gates use the half-angle e − i θ σ / 2 e^{-i\theta\sigma/2} e − i θ σ /2 .
1. Pauli Matrices
I = ( 1 0 0 1 ) , X = ( 0 1 1 0 ) , Y = ( 0 − i i 0 ) , Z = ( 1 0 0 − 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}.
I = ( 1 0 0 1 ) , X = ( 0 1 1 0 ) , Y = ( 0 i − i 0 ) , Z = ( 1 0 0 − 1 ) . Basic properties (let σ j ∈ { X , Y , Z } \sigma_j \in \{X,Y,Z\} σ j ∈ { X , Y , Z } ):
Hermitian and unitary: σ j = σ j † \sigma_j = \sigma_j^\dagger σ j = σ j † and σ j 2 = I \sigma_j^2 = I σ j 2 = I .
Traceless: T r ( σ j ) = 0 \mathrm{Tr}(\sigma_j) = 0 Tr ( σ j ) = 0 ; eigenvalues ± 1 \pm 1 ± 1 .
det ( σ j ) = − 1 \det(\sigma_j) = -1 det ( σ j ) = − 1 .
Products and (anti)commutators (with Levi-Civita ε j k l \varepsilon_{jkl} ε j k l , { j , k , l } \{j,k,l\} { j , k , l } a permutation
of { x , y , z } \{x,y,z\} { x , y , z } ):
X Y = i Z , Y Z = i X , Z X = i Y ( cyclic ) ;
XY = iZ,\quad YZ = iX,\quad ZX = iY \qquad(\text{cyclic});
X Y = i Z , Y Z = i X , Z X = iY ( cyclic ) ; [ σ j , σ k ] = 2 i ε j k l σ l , { σ j , σ k } = 2 δ j k I , σ j σ k = δ j k I + i ε j k l σ 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.
[ σ j , σ k ] = 2 i ε j k l σ l , { σ j , σ k } = 2 δ j k I , σ j σ k = δ j k I + i ε j k l σ l . Completeness: { I , X , Y , Z } \{I, X, Y, Z\} { I , X , Y , Z } is an orthogonal basis for 2 × 2 2\times2 2 × 2 Hermitian matrices under the
Hilbert–Schmidt inner product ⟨ A , B ⟩ = T r ( A † B ) \langle A,B\rangle = \mathrm{Tr}(A^\dagger B) ⟨ A , B ⟩ = Tr ( A † B ) , with
T r ( σ j σ k ) = 2 δ j k \mathrm{Tr}(\sigma_j\sigma_k) = 2\delta_{jk} Tr ( σ j σ k ) = 2 δ j k . Hence any single-qubit density matrix is
ρ = 1 2 ( 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 1 ( I + r ⋅ σ ) , r = (⟨ X ⟩ , ⟨ Y ⟩ , ⟨ Z ⟩) , ∣ r ∣ ≤ 1.
2. Common Gate Matrices
H = 1 2 ( 1 1 1 − 1 ) , S = ( 1 0 0 i ) , T = ( 1 0 0 e i π / 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}.
H = 2 1 ( 1 1 1 − 1 ) , S = ( 1 0 0 i ) , T = ( 1 0 0 e iπ /4 ) . Relations: S = T 2 S = T^2 S = T 2 , Z = S 2 Z = S^2 Z = S 2 , H X H = Z H X H = Z H X H = Z , H Z H = X H Z H = X H Z H = X , H Y H = − Y H Y H = -Y H Y H = − Y , S X S † = Y S X S^\dagger = Y S X S † = Y .
Two-qubit (big-endian, control = qubit 0):
CNOT = ( 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 ) , CZ = ( 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 − 1 ) , SWAP = ( 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 ) .
\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}.
CNOT = 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 , CZ = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 − 1 , SWAP = 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 . Useful: CZ = ( I ⊗ H ) CNOT ( I ⊗ H ) \text{CZ} = (I\otimes H)\,\text{CNOT}\,(I\otimes H) CZ = ( I ⊗ H ) CNOT ( I ⊗ H ) , and
SWAP = CNOT 01 CNOT 10 CNOT 01 \text{SWAP} = \text{CNOT}_{01}\,\text{CNOT}_{10}\,\text{CNOT}_{01} SWAP = CNOT 01 CNOT 10 CNOT 01 .
3. Rotation Gates (Exponentials of Paulis)
Since σ j 2 = I \sigma_j^2 = I σ j 2 = I , the exponential closes into sines and cosines:
e − i θ n ^ ⋅ σ ⃗ / 2 = cos θ 2 I − i sin θ 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.
e − i θ n ^ ⋅ σ /2 = cos 2 θ I − i sin 2 θ ( n ^ ⋅ σ ) , ∣ n ^ ∣ = 1. The single-axis rotations:
R x ( θ ) = ( cos θ 2 − i sin θ 2 − i sin θ 2 cos θ 2 ) , R y ( θ ) = ( cos θ 2 − sin θ 2 sin θ 2 cos θ 2 ) , R z ( θ ) = ( e − i θ / 2 0 0 e i θ / 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}.
R x ( θ ) = ( cos 2 θ − i sin 2 θ − i sin 2 θ cos 2 θ ) , R y ( θ ) = ( cos 2 θ sin 2 θ − sin 2 θ cos 2 θ ) , R z ( θ ) = ( e − i θ /2 0 0 e i θ /2 ) . Identities:
R z ( π ) = e − i π / 2 Z R_z(\pi) = e^{-i\pi/2}Z R z ( π ) = e − iπ /2 Z , R x ( π ) = − i X \ R_x(\pi) = -iX R x ( π ) = − i X , R y ( π ) = − i Y \ R_y(\pi) = -iY R y ( π ) = − iY (note the global phases).
H = e i π / 2 R y ( π 2 ) R z ( π ) H = e^{i\pi/2} R_y(\tfrac{\pi}{2}) R_z(\pi) H = e iπ /2 R y ( 2 π ) R z ( π ) (up to global phase); more simply H H H is a π \pi π
rotation about the n ^ = ( x ^ + z ^ ) / 2 \hat n = (\hat x + \hat z)/\sqrt2 n ^ = ( x ^ + z ^ ) / 2 axis.
Euler (ZYZ) decomposition. Any single-qubit unitary U U U can be written, for some
α , β , γ , δ ∈ R \alpha,\beta,\gamma,\delta\in\mathbb R α , β , γ , δ ∈ R ,
U = e i α R z ( β ) R y ( γ ) R z ( δ ) .
U = e^{i\alpha}\,R_z(\beta)\,R_y(\gamma)\,R_z(\delta).
U = e i α R z ( β ) R y ( γ ) R z ( δ ) . This is why { R y , R z } \{R_y, R_z\} { R y , R z } (plus phase) generate all of S U ( 2 ) SU(2) S U ( 2 ) — see
Term 2.2 .
4. Operator Identities
Adjoint of a product: ( A B ) † = B † A † (AB)^\dagger = B^\dagger A^\dagger ( A B ) † = B † A † ; ( A ⊗ B ) † = A † ⊗ B † (A\otimes B)^\dagger = A^\dagger\otimes B^\dagger ( A ⊗ B ) † = A † ⊗ B † .
Trace is cyclic: T r ( A B C ) = T r ( C A B ) = T r ( B C A ) \mathrm{Tr}(ABC) = \mathrm{Tr}(CAB) = \mathrm{Tr}(BCA) Tr ( A B C ) = Tr ( C A B ) = Tr ( B C A ) (basis-independent).
Trace of a tensor product: T r ( A ⊗ B ) = T r ( A ) T r ( B ) \mathrm{Tr}(A\otimes B) = \mathrm{Tr}(A)\,\mathrm{Tr}(B) Tr ( A ⊗ B ) = Tr ( A ) Tr ( B ) .
Expectation: ⟨ A ⟩ = T r ( ρ A ) \langle A\rangle = \mathrm{Tr}(\rho A) ⟨ A ⟩ = Tr ( ρ A ) ; for pure ρ = ∣ ψ ⟩ ⟨ ψ ∣ \rho=|\psi\rangle\langle\psi| ρ = ∣ ψ ⟩ ⟨ ψ ∣ , = ⟨ ψ ∣ A ∣ ψ ⟩ =\langle\psi|A|\psi\rangle = ⟨ ψ ∣ A ∣ ψ ⟩ .
Spectral decomposition: a normal operator A = ∑ i λ i ∣ v i ⟩ ⟨ v i ∣ A=\sum_i \lambda_i |v_i\rangle\langle v_i| A = ∑ i λ i ∣ v i ⟩ ⟨ v i ∣ with
{ ∣ v i ⟩ } \{|v_i\rangle\} { ∣ v i ⟩} orthonormal; then f ( A ) = ∑ i f ( λ i ) ∣ v i ⟩ ⟨ v i ∣ f(A)=\sum_i f(\lambda_i)|v_i\rangle\langle v_i| f ( A ) = ∑ i f ( λ i ) ∣ v i ⟩ ⟨ v i ∣ for any function f f f .
Function of a unitary's generator: if H = ∑ i E i ∣ E i ⟩ ⟨ E i ∣ H=\sum_i E_i|E_i\rangle\langle E_i| H = ∑ i E i ∣ E i ⟩ ⟨ E i ∣ then
e − i H t = ∑ i e − i E i t ∣ E i ⟩ ⟨ E i ∣ e^{-iHt}=\sum_i e^{-iE_i t}|E_i\rangle\langle E_i| e − i H t = ∑ i e − i E i t ∣ E i ⟩ ⟨ E i ∣ .
Baker–Campbell–Hausdorff (BCH):
e A e B = e A + B + 1 2 [ A , B ] + 1 12 [ A , [ A , B ] ] − 1 12 [ B , [ A , B ] ] + ⋯ .
e^{A}e^{B} = e^{A+B+\frac12[A,B]+\frac1{12}[A,[A,B]]-\frac1{12}[B,[A,B]]+\cdots}.
e A e B = e A + B + 2 1 [ A , B ] + 12 1 [ A , [ A , B ]] − 12 1 [ B , [ A , B ]] + ⋯ . If [ A , B ] = 0 [A,B]=0 [ A , B ] = 0 then e A e B = e A + B e^A e^B = e^{A+B} e A e B = e A + B . This is exactly why Trotterization is needed when
[ A , B ] ≠ 0 [A,B]\neq 0 [ A , B ] = 0 (see Term 3.4 ):
e − i ( A + B ) t = lim n → ∞ ( e − i A t / n e − i B t / n ) n , e − i ( A + B ) δ = e − i A δ e − i B δ + 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).
e − i ( A + B ) t = n → ∞ lim ( e − i A t / n e − i B t / n ) n , e − i ( A + B ) δ = e − i A δ e − i B δ + O ( δ 2 ) . Hadamard lemma (operator conjugation):
e A B e − A = B + [ A , B ] + 1 2 ! [ A , [ A , B ] ] + ⋯ .
e^{A}Be^{-A} = B + [A,B] + \tfrac1{2!}[A,[A,B]] + \cdots.
e A B e − A = B + [ A , B ] + 2 ! 1 [ A , [ A , B ]] + ⋯ .
5. Tensor-Product (Kronecker) Identities
Mixed-product: ( A ⊗ B ) ( C ⊗ D ) = ( A C ) ⊗ ( B D ) (A\otimes B)(C\otimes D) = (AC)\otimes(BD) ( A ⊗ B ) ( C ⊗ D ) = ( A C ) ⊗ ( B D ) .
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) ( A ⊗ B ) ( ∣ a ⟩ ⊗ ∣ b ⟩) = ( A ∣ a ⟩) ⊗ ( B ∣ b ⟩) .
Adjoint / inverse / transpose distribute: ( A ⊗ B ) − 1 = A − 1 ⊗ B − 1 (A\otimes B)^{-1} = A^{-1}\otimes B^{-1} ( A ⊗ B ) − 1 = A − 1 ⊗ B − 1 , etc.
Eigenvalues: if A ∣ u ⟩ = a ∣ u ⟩ A|u\rangle=a|u\rangle A ∣ u ⟩ = a ∣ u ⟩ and B ∣ v ⟩ = b ∣ v ⟩ B|v\rangle=b|v\rangle B ∣ v ⟩ = b ∣ v ⟩ , then
( A ⊗ B ) ( ∣ u ⟩ ⊗ ∣ v ⟩ ) = a b ( ∣ u ⟩ ⊗ ∣ v ⟩ ) (A\otimes B)(|u\rangle\otimes|v\rangle) = ab\,(|u\rangle\otimes|v\rangle) ( A ⊗ B ) ( ∣ u ⟩ ⊗ ∣ v ⟩) = ab ( ∣ u ⟩ ⊗ ∣ v ⟩) .
Dimension: A ( m × m ) ⊗ B ( n × n ) A\,(m\times m)\otimes B\,(n\times n) A ( m × m ) ⊗ B ( n × n ) is m n × m n mn\times mn mn × mn .
6. Complex Numbers, Roots of Unity, and the QFT Kernel
Euler: e i θ = cos θ + i sin θ e^{i\theta} = \cos\theta + i\sin\theta e i θ = cos θ + i sin θ ; ∣ e i θ ∣ = 1 \ |e^{i\theta}|=1 ∣ e i θ ∣ = 1 .
N N N -th roots of unity: ω = e 2 π i / N \omega = e^{2\pi i/N} ω = e 2 π i / N satisfies ω N = 1 \omega^N = 1 ω N = 1 and
∑ k = 0 N − 1 ω k = 0 \sum_{k=0}^{N-1}\omega^{k} = 0 ∑ k = 0 N − 1 ω k = 0 (for N > 1 N>1 N > 1 ).
Geometric sum: ∑ k = 0 N − 1 r k = 1 − r N 1 − r \displaystyle\sum_{k=0}^{N-1} r^k = \frac{1-r^N}{1-r} k = 0 ∑ N − 1 r k = 1 − r 1 − r N for r ≠ 1 r\neq1 r = 1 .
Orthogonality (DFT/QFT core):
1 N ∑ x = 0 N − 1 e 2 π i x ( j − k ) / N = δ j k . \displaystyle \frac1N\sum_{x=0}^{N-1} e^{2\pi i x(j-k)/N} = \delta_{jk}. N 1 x = 0 ∑ N − 1 e 2 π i x ( j − k ) / N = δ j k .
QFT action: QFT ∣ x ⟩ = 1 N ∑ y = 0 N − 1 e 2 π i x y / N ∣ y ⟩ , N = 2 n . \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. QFT ∣ x ⟩ = N 1 y = 0 ∑ N − 1 e 2 π i x y / N ∣ y ⟩ , N = 2 n .
7. Probability & Statistics (for shots and estimation)
Born rule: p i = ∣ ⟨ i ∣ ψ ⟩ ∣ 2 p_i = |\langle i|\psi\rangle|^2 p i = ∣ ⟨ i ∣ ψ ⟩ ∣ 2 ; ∑ i p i = 1 \sum_i p_i = 1 ∑ i p i = 1 .
Sample-mean estimator of ⟨ A ⟩ \langle A\rangle ⟨ A ⟩ from M M M shots has standard error
σ / M \sigma/\sqrt M σ / M ; halving the error costs 4 × 4\times 4 × the shots. Plan QPU budgets accordingly.
Binomial outcome: estimating a probability p p p from M M M shots gives variance p ( 1 − p ) / M p(1-p)/M p ( 1 − p ) / M .
Hoeffding bound: Pr [ ∣ p ^ − p ∣ ≥ ϵ ] ≤ 2 e − 2 M ϵ 2 \Pr[\,|\hat p - p| \ge \epsilon\,] \le 2e^{-2M\epsilon^2} Pr [ ∣ p ^ − p ∣ ≥ ϵ ] ≤ 2 e − 2 M ϵ 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) cos ( π /8 ) , sin ( π /8 )
≈ 0.9239 , 0.3827 \approx 0.9239,\ 0.3827 ≈ 0.9239 , 0.3827
$\langle 0
H
Optimal Grover iterations (database size N N N , one marked)
⌊ π 4 N ⌋ \big\lfloor \frac{\pi}{4}\sqrt N \big\rfloor ⌊ 4 π N ⌋
CHSH classical bound / quantum (Tsirelson) bound
2 2 2 / 2 2 2\sqrt2 2 2
Purity range for d d d -dim state
[ 1 d , 1 ] \big[\tfrac1d,\,1\big] [ d 1 , 1 ]
QFT gate count (n n n qubits)
Θ ( n 2 ) \Theta(n^2) Θ ( 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 →