Expanding in the Eigenbasis
Linear Algebra
What you need to know first 3 concepts, 2 layers
The requisite-knowledge inventory for this page, bottom-up: the primitives at the base, combined upward until you reach what this page assumes. Skim the layers you already own; start wherever the ground gets unfamiliar.
- base
- Linear algebraconcept
- L1
- Matrix eigenvalue problems
- The eigenvalue problem (Ax = λx)concept
- ↳you are here
2 of these are concepts without a dedicated page yet — the grey chips. Following the linked ones first makes the rest land.
"Expand it in the eigenbasis" is one of the most reused moves in all of applied mathematics, and once you see why, you start spotting it everywhere. The reason is a single sentence: the eigenbasis is the coordinate system where the operator is diagonal. In that basis, a coupled matrix problem falls apart into independent one-number problems — one per eigenvalue — and almost everything you want to do to a matrix becomes easy.
One identity
For a symmetric operator , any function of it acts by applying that function to each eigenvalue, leaving the eigenvectors untouched:
Three steps, always the same: decompose along the eigenvectors, scale each component by , recombine. The eigenvectors never move — only the weights change. Pick a different and you get a different corner of science, but it is the same move every time. The demo below is exactly this: one fixed spectrum, reshaped by whichever you choose — watch which eigenvalue ends up dominating.
The largest eigenvalue wins by a landslide — this is exactly why power iteration converges to the dominant eigenvector.
The same move, all over the map
Swap the function and the identical algebra becomes the resolvent, time evolution, diffusion, power iteration, perturbation theory, or principal components. Each row below is the same three steps with a different :
| What expanding in the eigenbasis gives you | On this site | |
|---|---|---|
| Resolvent / spectral function — poles at the eigenvalues, Lorentzian response. | The resolvent, Casida | |
| ODEs / normal modes — each mode evolves on its own; is a growth rate or frequency. | LIF networks | |
| Heat / diffusion — high modes die first; separation of variables is eigen-expansion of the Laplacian. | Separation of variables, Green's functions | |
| Quantum dynamics — each energy eigenstate carries its own phase. | Quantum chemistry | |
| Markov chains / power iteration — the dominant eigenvalue wins; the gap sets the mixing time. | Power iteration | |
| Perturbation theory — the energy denominators are the resolvent of in its eigenbasis. | Perturbation methods | |
| itself | PCA — eigenbasis of the covariance; the eigenvalues are the variances along principal directions. | PCA from scratch |
The cleanest example of all is the Fourier series: and are the eigenfunctions of , so a Fourier expansion is "expand in the eigenbasis," and solving the heat equation by Fourier is just applying to each mode.
It's one line of code
Because the move is always the same, so is the implementation: diagonalize once, then any function of the matrix is that function applied to the eigenvalues. Every assertion below passes — the eigenbasis form is bit-for-bit the direct computation.
import numpy as np
from scipy.linalg import expm
lam, V = np.linalg.eigh(A) # eigenvalues, orthonormal eigenvectors
f_of_A = lambda f: V @ np.diag(f(lam)) @ V.T # go to eigenbasis, apply f, come back
# every function of A is just f applied to each eigenvalue:
assert np.allclose(f_of_A(np.exp), expm(A)) # time evolution
assert np.allclose(f_of_A(lambda l: 1/(8-l)), np.linalg.inv(8*np.eye(len(A))-A)) # resolvent
assert np.allclose(f_of_A(lambda l: l**5), np.linalg.matrix_power(A, 5)) # power So when a derivation says "expand in the eigenbasis," it is reaching for this: the basis where the operator is diagonal, where collapses to mode by mode. The resolvent on this site, the normal modes of a network, a Fourier solution of the heat equation, the convergence of power iteration — all the same step, separated only by which they pick.