determin.ant
06-eigenvalues / 6.4

Module 6: Eigenvalues

Diagonalization

Where you'll see this: computing matrix powers efficiently. To find A¹⁰⁰ directly would be 99 matrix multiplications. Via diagonalization, A¹⁰⁰ = P D¹⁰⁰ P⁻¹, and D¹⁰⁰ is trivial — just raise each diagonal entry to the 100th power. This powers Markov chains, population models, and graph analysis.

Diagonalization is the process of expressing a matrix in its "natural coordinate system" — aligned with the eigenvectors — where it becomes as simple as possible.

The decomposition

If A has n linearly independent eigenvectors v1,v2\mathbf{v}_1, \mathbf{v}_2, then:

A=PDP1A = P D P^{-1}

where P has the eigenvectors as columns, and D is diagonal with eigenvalues:

P=[v1v2],D=[λ100λ2]P = \begin{bmatrix} \mathbf{v}_1 & \mathbf{v}_2 \end{bmatrix}, \quad D = \begin{bmatrix} \lambda_1 & 0 \\ 0 & \lambda_2 \end{bmatrix}

How to read it

Think of AxA\mathbf{x} as three steps:

  1. P⁻¹x — re-express x in the eigenvector basis
  2. Dx — scale each component (diagonal = just multiplication)
  3. Px — convert back to the standard basis
Diagonalization is a change of basis into a coordinate system where the transformation is pure scaling. In that system, the matrix is just two independent scalar multiplications.

When it fails

Not every matrix is diagonalizable over ℝ:

  • Complex eigenvalues → no real eigenvectors
  • Repeated eigenvalue without enough independent eigenvectors (defective matrix)

Rotation matrices are the classic example: no real eigenvectors, can't be diagonalized over ℝ.

Try it

Edit the matrix and see the P, D, P⁻¹ decomposition. The product P·D·P⁻¹ should reconstruct A exactly. Try a rotation matrix — it will report that diagonalization fails.

Matrix powers via diagonalization:
import numpy as np
A = np.array([[3, 1], [1, 3]])
eigenvalues, P = np.linalg.eig(A)
D = np.diag(eigenvalues)
P_inv = np.linalg.inv(P)

# A^10 = P @ D^10 @ P_inv
A_power_10 = P @ np.diag(eigenvalues**10) @ P_inv
print(np.allclose(A_power_10, np.linalg.matrix_power(A, 10)))  # True
Complex EigenvaluesPositive Definite Matrices
[
]
î → [3, 1]ĵ → [1, 3]

A = P · D · P⁻¹

Columns of P are the eigenvectors. D has eigenvalues on the diagonal.

P
1-111
D
4002
P⁻¹
0.50.5-0.50.5
A (original)
3113
=
P·D·P⁻¹
3113

Try a rotation matrix — it can't be diagonalized over ℝ.