Why this matters for simulation: Normal modes of vibrating structures and Fourier modes of a grid are both eigenbases that decouple a hard problem into many easy ones.
By the end of this lesson you can…
Convert a vector's coordinates between the standard basis and any other basis using P and P⁻¹.
Compute the matrix of a transformation in a new basis, B = P⁻¹AP, and explain why similar matrices share eigenvalues, trace and determinant.
Diagonalize a 2×2 or 3×3 matrix as A = PDP⁻¹ and use it to compute Aⁿ in closed form.
Decide whether a matrix is diagonalizable, and recognize defective matrices like the shear.
Apply the spectral theorem to a symmetric matrix to find the principal axes of an ellipse.
Decouple a coupled linear recurrence or ODE system into independent scalar problems, and connect this to normal modes and Fourier modes.
Suppose you are simulating two masses connected by springs, or a population split between a city and its suburbs, or the temperature at a thousand points along a rod. In every case the equations are coupled: what happens to one variable depends on all the others, so you can’t solve for any of them alone. In 1.5 Eigenvectors & Eigenvalues you found the special directions a matrix only stretches. This lesson cashes those eigenvectors in. If you describe the system in the eigenvector basis, the coupling vanishes and the matrix becomes diagonal: pure scaling, one independent number per direction. That single idea gives closed-form matrix powers, the solution of linear ODE systems, normal modes of vibration, and the spectral methods that the fastest fluid solvers use.
▶ VideoThe same transformation in two languages: standard grid vs eigen-grid, and A = PDP⁻¹captions only
Transcript
Last time we found eigenvectors: the special directions a matrix only stretches. Today we cash them in.
Here is a matrix A acting on the ordinary grid. Watch the grid lines: they tilt, they stretch, they shear. Every new coordinate is a mix of both old ones.
In the standard basis this looks messy. Four numbers, all tangled together. But the transformation itself is not messy. We are just describing it in the wrong language.
This matrix has two eigenvectors. Along v one, two one, it stretches by two. Along v two, negative one one, it shrinks by one half.
So let's build a new grid out of these two directions: lines parallel to v one and lines parallel to v two. It's a skewed grid, just like the ones from lesson one.
Now apply the same matrix. Look: every grid line stays parallel to itself. The grid simply stretches by two in one direction and squashes by half in the other.
Pure scaling along the grid lines. In this basis, the matrix is diagonal: two on the diagonal, one half, and zeros everywhere else.
Take the vector x equals one, two. In standard coordinates, that's one step right and two steps up.
In the eigenbasis it's one step along v one, then one step along v two. Its eigen coordinates are one, one.
Put the eigenvectors in the columns of a matrix P. Then P turns eigen coordinates into standard coordinates, and P inverse goes the other way.
That gives the big factorization: A equals P D P inverse. Read it from right to left, because that's the order the matrices hit a vector.
Step one, P inverse: translate into eigen coordinates. The skewed grid straightens into an ordinary square grid, and x lands on one, one.
Step two, D: scale. Stretch the first axis by two, squash the second by one half. Nothing else happens, the axes don't mix.
Step three, P: translate back to standard coordinates. And x lands exactly where A sends it, three and a half, two and a half.
Same transformation, different language. A and D are called similar matrices, and they share everything intrinsic: eigenvalues, determinant, and trace.
Now the payoff. Multiply A by itself n times, and all the inner P inverse P pairs cancel. A to the n is P, D to the n, P inverse, and powers of a diagonal matrix are trivial.
Watch a point iterate. In eigen coordinates, the first coordinate doubles every step and the second halves.
So the iterates swing over and hug the line of v one. Whichever eigenvalue is biggest in size wins in the long run. That's the dominant eigenvalue, and it predicts the long term shape of any linear recurrence.
Does this always work? No. Here is a shear. Its only eigenvalue is one, repeated.
Apply it, and every arrow gets knocked off its line except the horizontal one. One eigenvector direction is not enough to build a basis, so the shear cannot be diagonalized. We call it defective.
The best case is a symmetric matrix, one that equals its own transpose. Take two one, one two, and send the unit circle through it.
The circle becomes an ellipse, and its axes are exactly the eigenvectors, at right angles to each other, stretched by three and by one.
That's the spectral theorem: a real symmetric matrix always has real eigenvalues and a perpendicular set of eigenvectors. Stiffness matrices and diffusion operators are symmetric, so physics hands us this case all the time.
Here is why we care in differential equations. Two masses joined by three springs. Each mass's acceleration depends on both positions: the equations are coupled.
Change to the eigenvector basis of the stiffness matrix. In the first mode the masses swing together; in the second they swing in opposition, faster.
Each mode obeys its own simple oscillator equation, completely independent of the other. One hard coupled problem became two easy scalar ones.
The same trick powers fluid solvers. On a periodic grid, the sine and cosine waves are eigenvectors of the discrete Laplacian, and the fast Fourier transform is the change of basis.
So diffusion decouples: each mode just decays at its own rate, wiggly modes fastest. That's the heart of spectral methods, which we'll build much later in the course.
To recap: find the eigenvectors, change into their basis, and the matrix becomes pure scaling. Powers, recurrences and coupled systems all fall apart into independent pieces.
Next time: what happens when the eigenvalues aren't even real, and the matrix starts to rotate.
Coordinates in a different basis
Recall from 1.1 Vectors, Linear Combinations & Span that the components of a vector are its coefficients in a basis. Writing x=(1,2) really means x=1^+2^. Nothing forces us to use ^ and ^. Any two independent vectors in the plane form a basis, and each basis gives the same arrow different numbers.
Take the skewed basis B={b1,b2} with b1=(2,1) and b2=(−1,1). You met this basis in lesson 1.1’s problem “Coordinates in a skewed basis”, where you found that (1,5)=2b1+3b2. We write
[x]B=[c1c2]meansx=c1b1+c2b2.
So [(1,5)]B=(2,3). Geometrically, the basis vectors draw a skewed grid, and [x]B gives the grid address of the point x.
Change-of-basis matrices (both directions)
Stack the new basis vectors as the columns of a matrix:
P converts fromB-coordinates to standard coordinates. It’s the easy direction: just form the combination.
P−1 converts from standard coordinates toB-coordinates. It’s the hard direction, because it means solving a linear system. P−1 exists because the columns are independent (a basis), so detP=0.
For our basis, detP=2⋅1−(−1)⋅1=3, and the 2×2 inverse formula (swap the diagonal, negate the off-diagonal, divide by the determinant) gives
P−1=31[1−112],P−1[15]=31[69]=[23].✓
✅ Concept check
The columns of $P$ are a basis $\mathcal B$. You know a vector's standard coordinates $\vec x$ and want its $\mathcal B$-coordinates. What do you compute?
Why: Old = P · new, so new = P⁻¹ · old.
The same transformation in a different language: similarity
Now take the transformation from the video,
A=[1.50.511].
In the standard grid it tilts, stretches and shears every grid line, and each output coordinate mixes both inputs. What does the same transformation look like if we describe everything in B-coordinates?
Suppose you’re handed a vector in B-coordinates, [x]B, and want [Ax]B. You only know how A acts on standard coordinates, so take a round trip:
convert to standard coordinates: x=P[x]B;
apply the transformation: Ax=AP[x]B;
convert back: [Ax]B=P−1AP[x]B.
So the matrix of the transformation in the basis B is
[A]B=P−1AP
Two matrices related by B=P−1AP for some invertible P are called similar. They are the same linear transformation written in two coordinate systems. Here’s the surprise for our basis. Compute AP column by column:
In the eigen-grid, the transformation just stretches one family of grid lines by 2 and squashes the other by ½. The first B-coordinate doubles and the second halves, and they never interact. All the “messiness” of A came from describing it in the wrong basis.
Not every basis is this kind. With the basis (1,1),(0,1), i.e. Q=[1101], you get Q−1AQ=[2.5−110], which is still a mess. Only the eigenbasis diagonalizes.
What similar matrices share
Because similar matrices describe the same transformation, anything with a coordinate-free meaning must agree between them:
Eigenvalues. The characteristic polynomials are identical:
det(P−1AP−λI)=det(P−1(A−λI)P)=det(P−1)det(A−λI)det(P)=det(A−λI).
We used λI=P−1(λI)P and det(P−1)det(P)=1 (1.4 Determinants as Volume Scaling).
Determinant (the area-scaling factor) and trace (the sum of the eigenvalues) follow immediately. Check: detA=1.5−0.5=1=2⋅21, and trA=2.5=2+21. The messy Q−1AQ above also has trace 2.5 and determinant 0+1=1.
Eigenvectors are not shared as lists of numbers, because they are the same arrows written in different coordinates. If Av=λv, then B(P−1v)=P−1APP−1v=λ(P−1v).
✅ Concept check
$A$ is a 2×2 matrix with eigenvalues 2 and 5, and $B = P^{-1}AP$ for some invertible $P$. What is the trace of $B$?
Why: Similar matrices have the same eigenvalues, so tr B = 2 + 5 = 7 (and det B = 10), whatever P is.
Diagonalization: A = PDP⁻¹
Turn the similarity around. If P−1AP=D is diagonal, multiply by P on the left and P−1 on the right:
Why it works: AP=[Av1⋯Avn]=[λ1v1⋯λnvn]=PD. Multiplying a matrix on the right by a diagonal matrix scales its columns. Since the columns are independent, P is invertible, and A=PDP−1.
Read it right to left. The rightmost matrix hits x first:
Ax=3. back to standardP2. scale each axisD1. into eigen-coordinatesP−1x
Translate into eigen-coordinates, scale each coordinate by its own λ, and translate back. The video animates exactly these three steps for x=(1,2). Its eigen-coordinates are (1,1), D sends those to (2,21), and P sends that to 2b1+21b2=(3.5,2.5), which matches Ax computed directly.
Worked example: diagonalize a matrix by hand
Diagonalize A=[4213].
Step 1: eigenvalues.det(A−λI)=(4−λ)(3−λ)−2=λ2−7λ+10=(λ−5)(λ−2). So λ1=5 and λ2=2. As a check, the trace is 7=5+2 and the determinant is 10=5⋅2.
Step 2: eigenvectors. These come from the kernels of A−λI:
The factorization isn’t unique. You can rescale any eigenvector (that rescales a column of P and is undone by P−1), or list the eigenpairs in a different order, which permutes the columns of P and the diagonal of Dtogether. The diagonal entries of D, the eigenvalues, are the only fixed part.
✅ Concept check
You diagonalize $A = PDP^{-1}$, then swap the two columns of $P$ but leave $D$ alone. What happens?
Computing powers: Aⁿ = PDⁿP⁻¹
Here’s the payoff. Multiply A by itself and the inner factors cancel:
A2=(PDP−1)(PDP−1)=PD(P−1P)DP−1=PD2P−1,An=PDnP−1.
Powers of a diagonal matrix are trivial: Dn=diag(λ1n,…,λnn). Geometrically, n applications of A are n round trips into eigen-coordinates, but all the intermediate trips cancel, so you go in once, scale n times, and come back once.
Check at n=2: the formula gives 31[54422133]=[1814711], and multiplying A⋅A directly gives the same. For large n, 5n swamps 2n, so An≈35n[2211]. Every vector gets pulled toward the direction v1=(1,1). The dominant eigenvalue (the one with the largest ∣λ∣) wins, and that’s the reason power iteration from lesson 1.5 works.
Worked example: Fibonacci in closed form
The Fibonacci numbers 0,1,1,2,3,5,8,… obey Fn+1=Fn+Fn−1. Package two consecutive terms as a vector:
For an eigenvalue λ, the second row of F−λI reads x−λy=0, so (λ,1) is an eigenvector. Write the starting vector in eigen-coordinates. Since φ−ψ=5,
[10]=51([φ1]−[ψ1]).
Now each eigen-component just gets multiplied by its eigenvalue n times:
Fn[10]=51(φn[φ1]−ψn[ψ1])⟹Fn=5φn−ψn
This is Binet’s formula. Check: F2=(φ2−ψ2)/5=(φ−ψ)(φ+ψ)/5=5⋅1/5=1. ✓ Since ∣ψ∣<1, the ψn term dies out, so Fn is the nearest integer to φn/5 and Fn+1/Fn→φ, the golden ratio. The long-term growth rate is the dominant eigenvalue.
◆ InteractiveStandard view vs eigenbasis view of x → Ax
Loading simulation…
Try these in the explorer:
With the Skewed stretch preset, press Play. On the left, the iterates Anx0 sweep around and hug the v1 line. On the right, the same points in eigen-coordinates move in a perfectly predictable way: c1 doubles and c2 halves every step. The readout shows Dnc0 computed by hand.
Pick Fibonacci and step n up. Watch the ratio x/y in the readout approach 1.618. On the right, the c2 component flips sign each step because ψ<0, and it shrinks.
Pick Negative eigenvalue. The left panel zig-zags, while the right panel shows the reason: c2 is multiplied by −1 every step.
Pick Shear and Rotation. The right panel can’t be drawn. Why is the subject of the next section.
Pick Symmetric with the unit-circle checkbox on. The image ellipse’s axes lie exactly along the eigenvectors, which are perpendicular. Now drag the sliders to make b=c, and the ellipse axes come apart from the eigenvectors.
✏️ Pen & paperChange of basis in both directions●○○
Let B={(1,1),(1,2)}.
Find [x]B for x=(3,5).
Which vector has B-coordinates (2,−1)?
The transformation T(x,y)=(y,x) (reflection across y=x) has standard matrix A=[0110]. Find its matrix [T]B and check that the trace and determinant agree with A‘s.
AP=[1121] (the reflection swaps each column’s entries), so
[T]B=P−1AP=[2−1−11][1121]=[103−1].
The trace is 0 and the determinant is −1, the same as A. It’s triangular, so its eigenvalues 1 and −1 sit on the diagonal: a reflection fixes one line (λ=1) and flips another (λ=−1). The basis B isn’t the eigenbasis, so the matrix isn’t diagonal. The eigenbasis would be (1,1),(1,−1).
✏️ Pen & paperA closed form for Aⁿ●●○
Let A=[1141].
Diagonalize A.
Find a formula for An and check it at n=2.
Compute A10[21] without multiplying any matrices.
Show worked solution
det(A−λI)=(1−λ)2−4=0 gives 1−λ=±2, so λ1=3 and λ2=−1. For λ=3: A−3I=[−214−2], so v1=(2,1). For λ=−1: A+I=[2142], so v2=(2,−1). Then
An=PDnP−1=41[2⋅3n3n2(−1)n−(−1)n][112−2]=41[2⋅3n+2(−1)n3n−(−1)n4⋅3n−4(−1)n2⋅3n+2(−1)n].
At n=2 this is 41[2083220]=[5285]. Directly, A2=[1+41+14+44+1]=[5285]. ✓
(2,1) is the eigenvector v1, so its eigen-coordinates are (1,0). Therefore A10(2,1)=310(2,1)=(118098,59049).
When diagonalization fails
Everything above needed n independent eigenvectors to fill the columns of P. That’s the whole criterion:
Why distinct eigenvalues suffice (2×2 case). Suppose λ1=λ2 but v2=cv1 were parallel. Then Av2=cAv1=cλ1v1=λ1v2. But also Av2=λ2v2, so (λ1−λ2)v2=0, which is impossible for a nonzero eigenvector. The same idea, applied by induction, works in any dimension: eigenvectors for different eigenvalues are always independent.
The defective shear. The video’s counterexample is
S=[1011],det(S−λI)=(1−λ)2.
The eigenvalue λ=1 is repeated (algebraic multiplicity 2), but S−I=[0010] has a one-dimensional kernel spanned by (1,0) (geometric multiplicity 1). Only horizontal vectors stay on their line, and every other direction gets sheared sideways. One eigenvector direction can’t make a basis of the plane, so S is defective. Its powers betray this: Sn=[10n1] grows linearly in n, which no combination of λn=1n terms could produce.
Repeated eigenvalues don’t automatically mean failure. 2I=[2002] has λ=2 twice and is already diagonal, because every vector is an eigenvector. The question is always whether each eigenvalue has as many independent eigenvectors as its multiplicity. When it doesn’t, the best you can do is the Jordan form, which leads to solutions like teλt in 7.4 Complex & Repeated Eigenvalues.
Complex eigenvalues. The rotation [01−10] has no real eigenvectors at all (it moves every direction), so it isn’t diagonalizable over R. Over C it has eigenvalues ±i and is diagonalizable. 1.7 Complex Eigenvalues & Rotation shows how to read the rotation off those complex eigenvalues.
✅ Concept checkselect all that apply
Which of these matrices are diagonalizable over the real numbers? Select all that apply.
Why: Distinct eigenvalues or symmetry guarantee diagonalizability. A repeated eigenvalue needs a check of the eigenspace dimension.
✏️ Pen & paperDiagonalizable or defective?●●○
For each matrix, decide whether it is diagonalizable over R. Justify using eigenvalues and eigenspace dimensions.
[3403]
200020007
100120013
[11−2−1]
Show worked solution
It’s triangular, with λ=3 repeated. A−3I=[0400] has kernel spanned by (0,1) only, which is one-dimensional. It’s defective (a vertical shear scaled by 3).
It’s already diagonal, so it’s diagonalizable. λ=2 has the two-dimensional eigenspace spanned by e1,e2.
It’s triangular with distinct eigenvalues 1,2,3, so it’s diagonalizable by the sufficient condition. No eigenvector computation is needed.
The trace is 0 and the determinant is −1+2=1, so λ2+1=0 and λ=±i. There are no real eigenvalues, so it’s not diagonalizable over R. Over C the eigenvalues are distinct, so it is diagonalizable there.
Symmetric matrices and the spectral theorem
The best possible case is a symmetric matrix, AT=A. These are everywhere in physics: stiffness matrices of spring networks and structures, inertia tensors, covariance matrices, stress tensors, and the discrete Laplacian that drives diffusion and pressure solves.
Why the eigenvectors are perpendicular. Take eigenpairs Av1=λ1v1 and Av2=λ2v2 with λ1=λ2. Symmetry means (Au)⋅w=u⋅(Aw) for all vectors. So
Since λ1=λ2, we get v1⋅v2=0. For a 2×2 symmetric matrix [abbd], the discriminant of the characteristic polynomial is (a−d)2+4b2≥0, so the eigenvalues are real. That’s the 2D version of point 1.
The change of basis is now especially nice. Q is a rotation (possibly with a reflection), and converting into eigen-coordinates is just QTx, i.e. dot products with the eigenvectors, with no matrix inversion.
Worked example: principal axes of an ellipse
Take A=[2112]. Then λ2−4λ+3=0 gives λ1=3 with q1=21(1,1) and λ2=1 with q2=21(1,−1). These are perpendicular, as promised. So
A=Q21[111−1][3001]QT21[111−1].
Picture 1: the image of the unit circle.A sends the unit circle to an ellipse. Read QΛQT right to left: rotate the circle (which is still a circle), stretch by 3 and 1 along the axes, then rotate back. The result is an ellipse with semi-axes 3 along q1 and 1 along q2, which is what the video and the sim’s symmetric mode show.
Picture 2: a quadratic form. The curve xTAx=2x2+2xy+2y2=1 has an awkward xy cross term. In eigen-coordinates (u,v)=QTx,
xTAx=xTQΛQTx=(QTx)TΛ(QTx)=3u2+v2=1.
The cross term is gone. It’s an ellipse with semi-axis 1/3 along q1 and 1 along q2. The eigenvectors are its principal axes. The same computation finds the principal stresses in a solid and the principal axes of a rigid body’s rotation, and it decides whether an equilibrium of a potential is a minimum or a saddle.
✏️ Pen & paperRotate away the cross term●●○
Find the principal axes and semi-axis lengths of the ellipse 5x2+4xy+2y2=6.
Show worked solution
Write it as xTAx=6 with A=[5222]. The 4xy term splits evenly into the two off-diagonal entries. The trace is 7 and the determinant is 6, so λ2−7λ+6=0 and λ=6,1.
λ=6: A−6I=[−122−4], so q1=51(2,1).
λ=1: A−I=[4221], so q2=51(1,−2).
Check: q1⋅q2=(2−2)/5=0. ✓ In coordinates u,v along q1,q2, the equation becomes 6u2+v2=6, i.e. u2+6v2=1. The ellipse has semi-axis 1 along the direction (2,1) and semi-axis 6≈2.45 along (1,−2). The large eigenvalue gives the short axis, because the form grows fastest in that direction.
Decoupling coupled systems
Now we can say exactly what “diagonalization decouples” means. Take the coupled recurrence
xn+1=4xn+yn,yn+1=2xn+3yn,
i.e. xn+1=Axn with the worked-example matrix A=[4213]. Each new value depends on both old ones. Substitute eigen-coordinates xn=Pcn:
These are two independent scalar recurrences, each solved by inspection: c1,n=5nc1,0 and c2,n=2nc2,0. Concretely, from P−1=31[211−1], the eigen-coordinates are the special combinations c1=31(2x+y) and c2=31(x−y). You can verify directly that 2xn+1+yn+1=10xn+5yn=5(2xn+yn), and xn+1−yn+1=2xn−2yn=2(xn−yn). Diagonalization found the combinations of variables that evolve on their own.
The ODE version is identical. For x′=Ax, substituting x=Pc gives c′=Dc, so ci′=λici and ci(t)=eλitci(0). Translating back,
Two equal masses m sit between two walls, joined by three identical springs of stiffness k. Let x1,x2 be their displacements. Newton’s law, with k=m=1, gives
i.e. x¨=−Kx with the symmetric stiffness matrix K=[2−1−12]. Its eigenpairs are λ=1 with (1,1) and λ=3 with (1,−1), which are perpendicular as the spectral theorem promises. In eigen-coordinates q1=x1+x2 and q2=x1−x2 (up to normalization),
q¨1=−q1,q¨2=−3q2.
These are two independent simple harmonic oscillators, the normal modes. In mode 1 the masses swing together at ω=1, and the middle spring never stretches. In mode 2 they swing in opposition at the faster ω=3. Every motion of the system is a superposition of these two. The full theory, with damping and N masses, is in 14.1 Coupled Oscillators & Normal Modes.
✏️ Pen & paperCity and suburbs: long-run populations●●●
Each year, 10% of city dwellers move to the suburbs and 20% of suburbanites move to the city. Initially 1000 people live in the city and none in the suburbs. With xn=(cityn,suburbsn):
Write xn+1=Mxn.
Diagonalize M and find a closed form for xn.
What happens as n→∞? How fast does it get there?
Show worked solution
City next year = 90% of the city + 20% of the suburbs, and similarly for the suburbs:
M=[0.90.10.20.8].
Each column sums to 1, because nobody is created or destroyed. This makes M a Markov matrix.
2. The trace is 1.7 and the determinant is 0.72−0.02=0.7, so λ2−1.7λ+0.7=(λ−1)(λ−0.7) and λ1=1, λ2=0.7. Eigenvectors: M−I=[−0.10.10.2−0.2] gives v1=(2,1), and M−0.7I=[0.20.10.20.1] gives v2=(1,−1). Eigen-coordinates of x0=(1000,0): solve 2a+b=1000 and a−b=0, so a=b=1000/3. Therefore
xn=31000[[21]+(0.7)n[1−1]].
Check at n=1: 31000(2.7,0.3)=(900,100), which matches Mx0=(900,100). ✓
3. (0.7)n→0, so xn→(666.6,333.3), a 2 : 1 split in the direction of the λ=1 eigenvector, whatever the initial split was (only the total population matters). The deviation from equilibrium shrinks by a factor of 0.7 per year, so after about ln(100)/ln(1/0.7)≈13 years it’s within 1% of its initial size. The second eigenvalue sets the convergence rate.
Diagonalization in code
NumPy’s np.linalg.eig returns the eigenvalues and a matrix whose columns are unit eigenvectors, which is exactly the D and P of the factorization. For symmetric matrices, use np.linalg.eigh, which guarantees real eigenvalues and orthonormal eigenvectors.
🐍 PythonDiagonalize, take powers, and check Binet's formula
⌘/Ctrl + Enter
Now implement the factorization yourself. Your power_by_eig should build PDnP−1 from the eigenpairs. Because it only needs λn, it even works for fractionaln when the eigenvalues are positive, giving a matrix square root, which repeated multiplication can’t do.
🧪 Coding exerciseExercise: matrix powers two ways✓ passed
⌘/Ctrl + Enter
💡 For the loop, R = np.eye(len(A)), then repeat R = R @ A. For the eigen version: lam, P = np.linalg.eig(A); return (P @ np.diag(lam**n) @ np.linalg.inv(P)).real
The second exercise decouples a recurrence. The sequence an+1=an+2bn, bn+1=an is xn+1=Axn with A=[1120]. Predict xn by working in eigen-coordinates (no matrix powers allowed), and predict the long-term ratio an/bn from the dominant eigenvector alone.
🧪 Coding exerciseExercise: decouple a recurrence and predict its long-term ratio✓ passed
⌘/Ctrl + Enter
💡 Dominant index: k = np.argmax(np.abs(lam)); v = P[:, k]. The ratio v[0]/v[1] doesn't depend on how eig normalized v.
Finally, see the fluids claim numerically: the FFT matrix diagonalizes the periodic discrete Laplacian, and in Fourier space diffusion is just independent decay.
🐍 PythonThe FFT diagonalizes the periodic Laplacian
⌘/Ctrl + Enter
Key Takeaways
The same linear transformation has different matrices in different bases. If P has the new basis vectors as columns, then x=P[x]B and [x]B=P−1x.
Similar matrices B=P−1AP are one transformation in two languages. They share eigenvalues, determinant and trace.
If A has n independent eigenvectors, then A=PDP−1. Read right to left: into eigen-coordinates, scale each axis by its λ, and back.
Powers become trivial: An=PDnP−1. The dominant eigenvalue sets the long-run growth and direction (Fibonacci gives φ), and the next-largest sets how fast you get there.
A matrix is diagonalizable exactly when it has n independent eigenvectors. Distinct eigenvalues guarantee it. The shear is the classic defective counterexample, and rotations need complex numbers.
Spectral theorem: real symmetric matrices have real eigenvalues and orthonormal eigenvectors, A=QΛQT. The eigenvectors are the principal axes of the associated ellipse.
In the eigenbasis, coupled recurrences and ODE systems split into independent scalar problems. For ODEs, eAt=PeDtP−1.
Normal modes of structures and Fourier modes on periodic grids are eigenbases. The FFT diagonalizes the periodic Laplacian, which makes spectral fluid solvers fast.
Finished this lesson?
Mark it complete to track your progress (saved in this browser). Reading every section does this for you.