REFERENCE TOOLKIT
Appendix A — Mathematical toolkit
This appendix supplies details that are useful across chapters. It can be read when a calculation first needs them rather than memorized before beginning.
A.1 Matrix multiplication and adjoints
For matrices A of shape m×n and B of shape n×p, . The inner dimensions must match. For two square matrices,
The adjoint conjugates entries and transposes: . It reverses products: . Consequently a circuit’s inverse reverses gate order and replaces each gate with its adjoint.
An outer product is a matrix with entries . Its action on is . An inner product is a scalar. Confusing the order changes the mathematical type of the result.
A.2 Eigenvectors and diagonalization
An eigenvector satisfies with nonzero v. Eigenvalues solve . For a Hermitian two-by-two matrix
the characteristic equation is
Thus
These are real. Solve for each eigenvector and normalize. If eigenvalues are distinct, Hermiticity makes the eigenvectors orthogonal: taking matrix elements in both orders gives .
The spectral theorem writes a Hermitian matrix as with an orthonormal eigenbasis. It defines functions of A: . This explains exponentials of Hamiltonians, square roots of positive matrices, and matrix entropy.
A matrix is positive semidefinite exactly when all its eigenvalues are nonnegative. A two-by-two Hermitian density matrix with trace one is physical if its diagonal entries and determinant are nonnegative. Checking only trace and Hermiticity is insufficient.
A.3 Gram–Schmidt and projection
Given a normalized vector and another vector , subtract its component along u:
Then . If w is nonzero, normalize it. Repeating this process builds an orthonormal basis from linearly independent vectors.
For an orthonormal set, the projector onto its span is . It obeys . For a complete basis, P=I. Expanding a vector using this identity yields its projection coefficients.
The Cauchy–Schwarz inequality ensures that overlap probabilities between normalized states lie in [0,1]. Equality occurs when the vectors are linearly dependent.
A.4 Singular values and Schmidt form
For any matrix M, the eigenvalues of are nonnegative. Their square roots are its singular values. A singular-value decomposition is , with diagonal nonnegative Σ and unitary U,V of suitable shapes.
For a bipartite pure state’s coefficient matrix , the singular values are square roots of the Schmidt probabilities. In the fixed product bases, the reduced operators are and . Indeed, . Both have the same nonzero eigenvalues. Their equality of spectra explains equal reduced entropies for a pure joint state.
The largest singular value is the operator norm ‖M‖, the maximum stretching of a unit vector. The trace norm sums singular values. The Frobenius norm is . Different norms answer different error questions; state overlap, global operator error, and local observable error should not be interchanged.
A.5 Geometric sums and Fourier cancellation
For r≠1,
Multiply the left side by 1−r and all intermediate terms cancel. For a nontrivial Nth root of unity, , so the sum is zero. For r=1, the sum is N; using the quotient without taking the limit would divide by zero.
This one identity proves QFT column orthogonality and determines finite-precision phase-estimation peaks. Binary Hadamard cancellation is a related character-orthogonality identity for XOR rather than addition modulo N.
A.6 Continued fractions by recurrence
For partial quotients , initialize . Then
The kth convergent is . For : , , , and follow directly. In order finding, a good rational approximation still needs a modular check; the recurrence does not know the physical problem’s order.
A.7 Confidence and finite samples
For independent Bernoulli samples, the standard deviation of a sample proportion is . Substituting gives an estimated standard error, but near zero or one a naive normal interval can be misleading.
A distribution-free bound for independent bounded trials is Hoeffding’s inequality:
To make this at most δ, it suffices that . This is conservative but does not require an unknown p in the bound. It still assumes independence; repeated drift or correlated experimental errors need another analysis.
For several simultaneous claims, their combined error probability must be controlled. A union bound can allocate δ across them. Reporting many favorable outcomes from a large unreported search is not equivalent to testing one prespecified prediction.
A.8 Global phase in numerical comparisons
Two vectors may represent the same pure state while having different entries. Fidelity compares them without global-phase sensitivity. To compare entries, estimate the phase from a nonzero overlap and align one vector first.
Do not use phase-insensitive comparison when relative phases between controlled branches matter. A subroutine equal to a target up to phase may produce a different controlled operation if that phase is not tracked. The scope of the comparison must match the circuit’s use.