Eigenvalues & the Spectral Theorem

4.5 hours ~5 min read

Eigenvalues & the Spectral Theorem

Measurement outcomes are eigenvalues; the states you collapse into are eigenvectors. The spectral theorem — that observables can be diagonalized in an orthonormal eigenbasis — is the mathematical content of the measurement postulate, the reason phase estimation works, and the tool that lets us define functions of operators (like eiHte^{-iHt}). This is the technical heart of Course 0.1.

Learning Objectives

After this lesson you will be able to:

  1. Compute eigenvalues/eigenvectors via the characteristic polynomial and diagonalize a matrix.
  2. Define normal operators and state the spectral theorem for them.
  3. Write an operator in its spectral decomposition A=kλkPkA = \sum_k \lambda_k P_k.
  4. Explain degeneracy and project onto eigenspaces.
  5. Prove that operators are simultaneously diagonalizable iff they commute.

Intuition

An eigenvector of AA is a special direction that AA merely stretches (by the eigenvalue), without rotating it: Av=λvA|v\rangle = \lambda|v\rangle. If you can find a full basis of eigenvectors, the operator becomes trivial to understand — in that basis it's just "multiply coordinate kk by λk\lambda_k," a diagonal matrix. The spectral theorem says the operators of physics (Hermitian observables, unitary gates — all normal) always admit such an orthonormal eigenbasis. That's why we can always think of an observable as "a set of outcomes λk\lambda_k each attached to a perpendicular measurement direction."


Theory

Eigenvalues and eigenvectors

For an operator AA on Cn\mathbb{C}^n, a nonzero v|v\rangle is an eigenvector with eigenvalue λC\lambda\in\mathbb{C} if

Av=λv    (AλI)v=0. A|v\rangle = \lambda|v\rangle \;\Longleftrightarrow\; (A - \lambda I)|v\rangle = 0 .

A nonzero solution exists iff AλIA-\lambda I is singular, i.e. iff λ\lambda is a root of the characteristic polynomial

pA(λ)=det(AλI)=0. p_A(\lambda) = \det(A - \lambda I) = 0 .

Over C\mathbb{C}, pAp_A has degree nn and (by the fundamental theorem of algebra) exactly nn roots counted with multiplicity — every complex matrix has at least one eigenvalue. The eigenspace for λ\lambda is ker(AλI)\ker(A-\lambda I); its dimension is the geometric multiplicity, and λ\lambda is degenerate if that exceeds 11.

Diagonalization

AA is diagonalizable if there is a basis of eigenvectors. Stacking them as columns of VV,

A=VΛV1,Λ=diag(λ1,,λn). A = V \Lambda V^{-1}, \qquad \Lambda = \operatorname{diag}(\lambda_1,\dots,\lambda_n).

From this, Tr(A)=kλk\operatorname{Tr}(A) = \sum_k \lambda_k and det(A)=kλk\det(A) = \prod_k \lambda_k (eigenvalues are the trace/determinant's "atoms"). Not every matrix is diagonalizable (e.g. \begin{psmallmatrix}0&1\\0&0\end{psmallmatrix} is defective), but the operators we care about always are — because they are normal.

Normal operators and the spectral theorem

AA is normal if it commutes with its adjoint:

AA=AA. A^\dagger A = A A^\dagger .

Hermitian (A=AA^\dagger=A) and unitary (A=A1A^\dagger = A^{-1}) operators are both normal. The payoff:

Spectral theorem (finite-dimensional). AA is normal iff it is unitarily diagonalizable: there exists an orthonormal eigenbasis {vk}\{|v_k\rangle\} and eigenvalues λk\lambda_k with

A=kλkvkvk=UΛU,U=kvkek unitary. A = \sum_k \lambda_k\,|v_k\rangle\langle v_k| = U\Lambda U^\dagger, \quad U = \sum_k |v_k\rangle\langle e_k|\ \text{unitary}.

Proof of the key direction (normal ⇒ orthonormal eigenbasis), by induction on nn. Every operator on Cn\mathbb{C}^n has an eigenvalue λ1\lambda_1 with a unit eigenvector v1|v_1\rangle (root of pAp_A). Consider W={w:v1w=0}W = \{|w\rangle : \langle v_1|w\rangle = 0\}, the orthogonal complement of v1|v_1\rangle. Claim: WW is invariant under AA. First, normality gives that v1|v_1\rangle is also an eigenvector of AA^\dagger with eigenvalue λ1\overline{\lambda_1} (standard lemma: for normal AA, (AλI)x=(AλI)x\|(A-\lambda I)x\| = \|(A^\dagger - \overline\lambda I)x\|, so they share eigenvectors). Then for wW|w\rangle\in W: v1Aw=Av1w=λ1v1w=0\langle v_1|A w\rangle = \langle A^\dagger v_1|w\rangle = \lambda_1\langle v_1|w\rangle = 0, so AwWA|w\rangle\in W. The restriction AWA|_W is normal on the (n1)(n-1)-dimensional WW; by induction it has an orthonormal eigenbasis, which together with v1|v_1\rangle gives one for all of Cn\mathbb{C}^n. ∎

Spectral decomposition and eigenprojectors

Grouping repeated eigenvalues, write the distinct eigenvalues λk\lambda_k with orthogonal projectors PkP_k onto their eigenspaces:

A=kλkPk,Pk=i:λi=λkvivi,PkPl=δklPk,kPk=I. A = \sum_k \lambda_k P_k, \qquad P_k = \sum_{i:\,\lambda_i = \lambda_k}|v_i\rangle\langle v_i|, \qquad P_k P_l = \delta_{kl}P_k,\quad \sum_k P_k = I .

This is the form the measurement postulate uses (Term 1.3): outcome λk\lambda_k occurs with probability ψPkψ\langle\psi|P_k|\psi\rangle and collapses the state to Pkψ/PkψP_k|\psi\rangle/\|P_k|\psi\rangle\|.

Functions of operators

The spectral decomposition lets us apply any function f:CCf:\mathbb{C}\to\mathbb{C} to a normal operator:

f(A):=kf(λk)Pk. f(A) := \sum_k f(\lambda_k)\,P_k .

In particular eiHt=keiλktPke^{-iHt} = \sum_k e^{-i\lambda_k t}P_k — the engine of time evolution (Term 1.6) and of building gates from Hamiltonians. We develop this fully in 0.1.6.

Simultaneous diagonalization

Theorem. Two normal operators A,BA,B are simultaneously diagonalizable (share an orthonormal eigenbasis) iff [A,B]=0[A,B] = 0.

Proof (⇐, the useful direction). If they share an eigenbasis {vk}\{|v_k\rangle\} with $A|v_k\rangle = a_k|v_k\rangle,, B|v_k\rangle = b_k|v_k\rangle,then, then AB|v_k\rangle = a_k b_k|v_k\rangle = BA|v_k\rangle$ on a basis, so AB=BAAB = BA. Conversely if [A,B]=0[A,B]=0, BB preserves each eigenspace of AA (if $A|v\rangle = a|v\ranglethen then A(B|v\rangle) = BA|v\rangle = aB|v\rangle,so, so B|v\rangle$ is in the same eigenspace); diagonalizing BB within each eigenspace of AA yields a common eigenbasis. ∎

Physically: commuting observables are jointly measurable with definite simultaneous values — the formal counterpart of the commutator discussion in 0.1.4.


Worked Examples

Example 1 — Diagonalizing Pauli-XX

Characteristic polynomial of X = \begin{psmallmatrix}0&1\\1&0\end{psmallmatrix}: det(XλI)=λ21=0λ=±1\det(X-\lambda I) = \lambda^2 - 1 = 0 \Rightarrow \lambda = \pm 1. For λ=+1\lambda = +1: (XI)v=0(X-I)|v\rangle = 0 \Rightarrow components equal $\Rightarrow |v_+\rangle = \tfrac1{\sqrt2}(1,1)^T = |+\rangle.For. For \lambda = -1:: |v_-\rangle = \tfrac1{\sqrt2}(1,-1)^T = |-\rangle$. These are orthonormal (as the spectral theorem guarantees for the Hermitian XX). Spectral decomposition:

X=(+1)+++(1). X = (+1)|+\rangle\langle+| + (-1)|-\rangle\langle-| .

Check trace =11=0= 1 - 1 = 0 ✓ and det =(1)(1)=1= (1)(-1) = -1 ✓, matching 0.1.4.

Example 2 — A degenerate operator and its eigenprojector

Let A = \begin{psmallmatrix} 2 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & 5\end{psmallmatrix}. Eigenvalue $\lambda = 2isdoublydegeneratewitheigenspace is **doubly degenerate** with eigenspace \operatorname{span}{|0\rangle,|1\rangle}$, and λ=5\lambda = 5 with eigenvector 2|2\rangle. The eigenprojectors are

P2=00+11=diag(1,1,0),P5=22=diag(0,0,1), P_2 = |0\rangle\langle0| + |1\rangle\langle1| = \operatorname{diag}(1,1,0),\quad P_5 = |2\rangle\langle2| = \operatorname{diag}(0,0,1),

with A=2P2+5P5A = 2P_2 + 5P_5, P2+P5=IP_2 + P_5 = I, P2P5=0P_2 P_5 = 0. Note the eigenvectors within the degenerate space are not unique — any orthonormal pair spanning it works — but the projector P2P_2 is unique.


Hands-on (Python)

import numpy as np

X = np.array([[0, 1], [1, 0]], dtype=complex)

# For Hermitian/normal matrices, use eigh: returns REAL, sorted eigenvalues and an
# ORTHONORMAL eigenbasis (columns of vecs). Reserve np.linalg.eig for general matrices.
vals, vecs = np.linalg.eigh(X)
print(vals)                       # [-1.  1.]
print(np.round(vecs, 3))          # columns are |->, |+>  (orthonormal)

# Verify diagonalization A = V Λ V†:
Lam = np.diag(vals)
print(np.allclose(vecs @ Lam @ vecs.conj().T, X))   # True

# Spectral decomposition A = Σ λ_k |v_k><v_k|:
A_rebuilt = sum(l * np.outer(vecs[:, k], vecs[:, k].conj())
                for k, l in enumerate(vals))
print(np.allclose(A_rebuilt, X))  # True
# Functions of operators via the spectrum: build U = exp(-i X t) two ways and compare.
from scipy.linalg import expm

def f_of_operator(vals, vecs, f):
    return sum(f(l) * np.outer(vecs[:, k], vecs[:, k].conj())
               for k, l in enumerate(vals))

t = 0.7
U_spectral = f_of_operator(vals, vecs, lambda l: np.exp(-1j * l * t))
U_expm = expm(-1j * X * t)
print(np.allclose(U_spectral, U_expm))   # True — spectral calculus = matrix exponential
# Commuting ⇒ simultaneously diagonalizable. Z and Z commute trivially; X and Z do NOT:
Z = np.array([[1, 0], [0, -1]], dtype=complex)
def comm(A, B): return A @ B - B @ A
print(np.allclose(comm(X, Z), 0))        # False: X,Z share no common eigenbasis

Exercises

E1 (easy). Find the eigenvalues and orthonormal eigenvectors of Z=diag(1,1)Z = \operatorname{diag}(1,-1) and write its spectral decomposition.

Solution

Already diagonal: eigenvalues +1+1 (eigenvector 0|0\rangle) and 1-1 (1|1\rangle). Spectral form Z=(+1)00+(1)11Z = (+1)|0\rangle\langle0| + (-1)|1\rangle\langle1|.

E2 (easy). Show that the eigenvalues of any projector P=P=P2P = P^\dagger = P^2 are 00 or 11.

Solution

If Pv=λvP|v\rangle = \lambda|v\rangle then P2v=λ2vP^2|v\rangle = \lambda^2|v\rangle; but P2=PP^2 = P gives λ2=λ\lambda^2 = \lambda, so λ{0,1}\lambda\in\{0,1\}. (Eigenvalue 11: vectors in the subspace; 00: its orthogonal complement.)

E3 (medium). Prove that a Hermitian operator has real eigenvalues and that eigenvectors for distinct eigenvalues are orthogonal.

Solution

Let A=AA=A^\dagger, Av=λvA|v\rangle = \lambda|v\rangle with vv=1\langle v|v\rangle = 1. Then $\lambda = \langle v|A|v\rangle = \overline{\langle v|A^\dagger|v\rangle} = \overline{\langle v|A|v\rangle} = \overline\lambda,so, so \lambda\in\mathbb{R}.For. For A|v\rangle = a|v\rangle,, A|w\rangle = b|w\rangle$ with aba\neq b: awv=wAv=Awv=bwva\langle w|v\rangle = \langle w|A|v\rangle = \langle Aw|v\rangle = b\langle w|v\rangle (using bb real). So (ab)wv=0wv=0(a-b)\langle w|v\rangle = 0 \Rightarrow \langle w|v\rangle = 0. ∎

E4 (medium). Diagonalize the Hadamard H = \tfrac1{\sqrt2}\begin{psmallmatrix}1&1\\1&-1\end{psmallmatrix}. What are its eigenvalues?

Solution

det(HλI)=(12λ)(12λ)12=λ21=0\det(H-\lambda I) = (\tfrac1{\sqrt2}-\lambda)(-\tfrac1{\sqrt2}-\lambda) - \tfrac12 = \lambda^2 - 1 = 0, so λ=±1\lambda = \pm1 (consistent with H2=IH^2 = I). HH is Hermitian and unitary, an involution; its eigenvectors are the two fixed/anti-fixed directions of the reflection it represents (numerically, (0.924,0.383)T\approx(0.924, 0.383)^T for +1+1 and (0.383,0.924)T(-0.383, 0.924)^T for 1-1).

E5 (hard). Suppose normal operators A,BA,B satisfy [A,B]=0[A,B]=0 and AA has non-degenerate spectrum. Prove that every eigenvector of AA is also an eigenvector of BB, hence B=f(A)B = f(A) for some function ff.

Solution

If Av=avA|v\rangle = a|v\rangle with aa non-degenerate, then A(Bv)=BAv=aBvA(B|v\rangle) = BA|v\rangle = aB|v\rangle, so BvB|v\rangle lies in the (1-dimensional) eigenspace of AA for aa; thus Bv=bvB|v\rangle = b|v\rangle for some scalar bbv|v\rangle is an eigenvector of BB. Defining f(a):=bf(a) := b on the spectrum of AA gives B=af(a)vava=f(A)B = \sum_a f(a)|v_a\rangle\langle v_a| = f(A). ∎ (This is why, for a system with a non-degenerate Hamiltonian, every conserved quantity is a function of the energy.)


Checkpoint

  1. What equation defines an eigenvalue, and how does the characteristic polynomial find them?
  2. Define a normal operator and state the spectral theorem.
  3. Write a general spectral decomposition and give the eigenprojector properties.
  4. How do you define f(A)f(A) for a normal AA? Give the example used for time evolution.
  5. State the commute ⟺ simultaneously-diagonalizable theorem and its physical meaning.
Answers
  1. Av=λvA|v\rangle = \lambda|v\rangle, i.e. det(AλI)=0\det(A-\lambda I)=0; the roots of that degree-nn polynomial are the eigenvalues.
  2. AA=AAA^\dagger A = A A^\dagger; then AA has an orthonormal eigenbasis and A=kλkvkvk=UΛUA = \sum_k\lambda_k|v_k\rangle\langle v_k| = U\Lambda U^\dagger.
  3. A=kλkPkA = \sum_k\lambda_k P_k with PkPl=δklPkP_k P_l = \delta_{kl}P_k, kPk=I\sum_k P_k = I, PkP_k Hermitian.
  4. f(A)=kf(λk)Pkf(A) = \sum_k f(\lambda_k)P_k; e.g. eiHt=keiλktPke^{-iHt} = \sum_k e^{-i\lambda_k t}P_k.
  5. Normal A,BA,B share an orthonormal eigenbasis iff [A,B]=0[A,B]=0; physically, commuting observables are simultaneously measurable with definite joint values.

Further Reading

  • [Axl] Axler, Linear Algebra Done Right, Ch. 5, 7 — eigenvalues, the spectral theorem (a clean, determinant-free treatment).
  • [NC] Nielsen & Chuang, §2.1.7–2.1.8 — eigendecomposition and the spectral decomposition.
  • [HJ] Horn & Johnson, Matrix Analysis, Ch. 1, 2 — normal matrices, Schur/spectral theorems.

← Prev: Linear Operators & Matrices · Up: Term 0 · Next: Special Operators

Ready to measure your state?

5 exercises · 10 checkpoint questions

Start the quiz