Computing Library › Linear Algebra
Linear Algebra

The Spectral Theorem

Every real symmetric matrix has real eigenvalues and an orthonormal basis of eigenvectors.

The statement

The spectral theorem says that a real symmetric matrix A can be written A = Q D Q^T, where Q is orthogonal (its columns form an orthonormal set of eigenvectors) and D is diagonal with real entries (the eigenvalues). This is the cleanest possible eigendecomposition: the eigenvectors are not merely independent but mutually perpendicular, and no inverse is needed since Q^{-1} = Q^T.

Two guarantees

The spectral expansion

The factorization can be rewritten as a sum: A = sum of lambda_i q_i q_i^T, a weighted combination of rank-one projections onto the eigen-directions. This expresses the matrix as a superposition of independent scaling actions along orthogonal axes, the finite-dimensional version of expanding an operator in its eigenmodes.

The complex analogue

For complex matrices, the theorem applies to Hermitian matrices (equal to their conjugate transpose) and more generally to normal matrices (those commuting with their conjugate transpose), which admit a unitary eigenbasis. Hermitian operators represent observables in quantum mechanics, and their real eigenvalues are the possible measurement outcomes.

python
import numpy as np
A = np.array([[2.0, 1.0], [1.0, 2.0]])   # symmetric
vals, Q = np.linalg.eigh(A)   # eigh for symmetric/Hermitian
print(np.allclose(Q @ np.diag(vals) @ Q.T, A))   # True
print(np.allclose(Q.T @ Q, np.eye(2)))           # orthonormal

Symmetric operators pervade physics, from stress and inertia tensors to the linearized stability operators of confined plasmas; the spectral theorem guarantees their normal modes are orthogonal and their eigenvalues physically meaningful.