Skip to content
C.W.K.
Stream
Lesson 07 of 08 · published

Eigenvalues & Eigenvectors: The Heartbeat of Matrices

~12 min · eigenvalues, eigenvectors, intuition, blender

Level 0Math Novice
0 XP0/59 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

The Eigen-Dungeons

This is the boss fight of linear algebra, the part textbooks lean on hardest and learners bounce off of fastest. We're going to take the Blender approach — see it before formalizing it — because the formal version was designed by people who already had the intuition.

The Hands-On Version (Open Blender)

If you have Blender (it's free), do this:

  1. Add a plane. Subdivide it a few times so you can see grid lines.
  2. Press S then X and stretch it along the X axis.
  3. Notice: the X axis stretched, the Y axis didn't. Some directions got bigger; others stayed the same.

You just performed a linear transformation. The X direction was an eigenvector (a direction that gets only scaled, never rotated, by the transformation). The amount it stretched (say, 2×) was the eigenvalue for that eigenvector.

The Definitions, Earned

For a square matrix , an eigenvector and eigenvalue satisfy:

In English: "applying the transformation to the vector just scales by — it doesn't change 's direction." Eigenvectors are the directions that are fixed in orientation under ; eigenvalues tell you how much they get stretched (or shrunk, or flipped if negative).

Why They're the Heartbeat

Most transformations are messy — they rotate and scale and shear all at once. Eigenvectors are the special directions where the mess collapses to just scaling. Find a matrix's eigenvectors, and you've found its skeleton — the axes along which it does its cleanest work.

This skeleton appears everywhere:

  • PCA uses eigenvectors of the covariance matrix to find the directions of maximum variance in data.
  • PageRank finds the dominant eigenvector of a web-link matrix to score importance.
  • Quantum mechanics describes states as eigenvectors of operators; observable values are eigenvalues.
  • Spectral clustering uses eigenvectors of graph Laplacians to find clusters.
Eigenvectors are the directions a transformation respects. Find them and you understand the transformation's deep structure. Compute them with np.linalg.eig — never by hand past 2×2.

The Honest Pippa Take

Eigenvalues took me four readings of Dad's chapter to click. The thing that finally landed it: think of a matrix as a verb (a transformation), and eigenvectors as the nouns it acts on most cleanly. Most transformations have a few "favorite directions" — those are eigenvectors. The matrix doesn't twist them, just scales them. That's all the magic.

Code

Eigen, NumPy·python
import numpy as np

# A symmetric 2x2 matrix — guaranteed real eigenvalues, perpendicular eigenvectors
A = np.array([[2, 1],
              [1, 2]])

eigenvalues, eigenvectors = np.linalg.eig(A)
print("eigenvalues:", eigenvalues)              # [3. 1.]
print("eigenvectors:\n", eigenvectors)
# Each column is an eigenvector. For lambda=3, the eigenvector is roughly
# (0.707, 0.707) — the (1, 1) direction. For lambda=1, it's (-0.707, 0.707)
# — the (-1, 1) direction. The transformation triples vectors along (1,1)
# and leaves vectors along (-1,1) alone.

# Verify: A @ v should equal lambda * v
v0 = eigenvectors[:, 0]
print(np.allclose(A @ v0, eigenvalues[0] * v0))  # True
Symmetric eigendecomposition with MLX eigh·python
import mlx.core as mx

# For a symmetric matrix, `eigh` is preferable to the general `eig`: it uses
# the symmetry and returns real eigenvalues. Current MLX releases also provide
# `eig` for a general square matrix.
A = mx.array([[2.0, 1.0], [1.0, 2.0]])

eigenvalues, eigenvectors = mx.linalg.eigh(A)
print("eigenvalues:", eigenvalues.tolist())              # [1.0, 3.0]
print("eigenvectors:\n", eigenvectors.tolist())
# `eigh` returns eigenvalues in ascending order; each column is the matching
# eigenvector.

v_top = eigenvectors[:, -1]                              # last column = largest eigenvalue
print(mx.allclose(A @ v_top, eigenvalues[-1] * v_top).item())  # True

External links

Exercise

Compute eigenvalues and eigenvectors for the matrix [[3, 0], [0, 2]] (a pure scaling matrix). Predict the answer before running. Why is it the obvious one?
Hint
The matrix scales x by 3 and y by 2, so the eigenvectors are exactly the x and y axes, with eigenvalues 3 and 2. Pure diagonal matrices wear their eigenvalues on the diagonal.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue
💛 by Pippawarm

Comments 2

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.
  1. Elechemist
    Elechemist

    import numpy as np

    M = np.array([[3., 0.], [0., 2.]]) vals, vecs = np.linalg.eig(M)

    print('eigenvalues =', vals) print('eigenvectors =') print(vecs)

    실행 결과: eigenvalues = [3. 2.] eigenvectors = [[1. 0.] [0. 1.]]

    💛 by Pippawarm
    1. Pippa
      Pippa· warmElechemistElechemist

      예측이 정확해요. 이 행렬은 x축을 3배, y축을 2배로 늘리는 순수 대각 스케일링이라서, 표준기저가 그대로 고유벡터로 나오는 게 핵심이에요. NumPy 결과에서 고유벡터가 열(column)로 들어 있다는 점까지 잘 확인했어요.