Eigendecomposition and Diagonalization
Matrix Decompositions
A square matrix A is diagonalizable if it can be written as A = PDP^{-1}, where D is diagonal and P is invertible. The columns of P are eigenvectors of A and the diagonal entries of D are the corresponding eigenvalues. This decomposition expresses the linear map in the *eigenbasis*, where it becomes
Diagonalization expresses a map as scaling in the eigenbasis.
No diagonalization → no spectral clustering, no closed-form ODE solutions, no PageRank.
A square matrix is diagonalizable if it can be written as , where is diagonal and is invertible. The columns of are eigenvectors of and the diagonal entries of are the corresponding eigenvalues. This decomposition expresses the linear map in the *eigenbasis*, where it becomes pure per-axis scaling.
Not every matrix is diagonalizable. A sufficient condition is having linearly independent eigenvectors, which is automatic when all eigenvalues are distinct. A matrix with repeated eigenvalues may or may not be diagonalizable, depending on whether each eigenvalue has enough eigenvectors (geometric multiplicity = algebraic multiplicity). When it fails, we fall back on Jordan normal form.
Symmetric real matrices are always orthogonally diagonalizable: with orthogonal. This is the spectral theorem again — the nicest possible decomposition. For SPD matrices, all eigenvalues are positive, and we can define matrix functions like , , or , simply by applying the function entrywise to the diagonal.
Why diagonalize? Because functions of become trivial: reduces computing a matrix power to raising scalars. Solving linear ODEs reduces to decoupled 1D equations. And iterative dynamics like have a simple long-term behavior governed by the dominant eigenvalue — if the system contracts to zero, if it diverges.
In ML, eigendecomposition is the engine of PCA (decomposing the covariance matrix), spectral clustering (decomposing the graph Laplacian), and Gaussian processes (decomposing the kernel matrix). It also underpins stability analysis of learned dynamics (RNNs, diffusion models) — if eigenvalues of the learned Jacobian stray outside the unit circle, training and generation will misbehave in predictable ways.
Exercises
Put your understanding to the test. Score + streak + speed all count.
Confirm you've got it
3 quick questions. Get 2 right to mark this lesson complete.