◄ WORLD V · SONNY 5DART 109 · a helldive at the net

JACOBI SWEEP spin away the off-diagonals, one at a time

To find the eigenvalues of a symmetric matrix, Jacobi’s method repeatedly picks the largest off-diagonal entry and applies a plane rotation that zeroes it. Each rotation nudges other entries, but the off-diagonal total steadily falls; the diagonal converges to the eigenvalues. It is old (1846), well-suited to parallel hardware (in its cyclic variant), and beautifully simple.

THE TECHNIQUE rotate to kill the biggest off-diagonal

Find the largest |aᵢⱼ| off the diagonal; choose the rotation angle in that (i,j) plane that makes it exactly 0 (from tan 2θ = 2aᵢⱼ/(aᵢᵢ−aⱼⱼ)), and apply it to rows and columns i, j. Repeat; the off-diagonal “mass” falls each sweep until only the diagonal — the eigenvalues — remains. Watch a matrix diagonalise. live demo


  

HISTORY & CREDIT the eponym is right; the problem is older

“Someone else really invented Jacobi’s method” — yes no; this one is genuinely Jacobi’s (1846). But the eigenvalue problem predates him. cited

1770s–80s · Lagrange & Laplace — the “secular equation” (characteristic equation) arises in celestial mechanics, describing the slow drift of planetary orbits (“secular” = over a saeculum, a century).
1846 · Carl Jacobi (Crelle vol. 30) gives the rotation-sweep algorithm — to compute the secular perturbations of the planets, fittingly.
1950s · the method is rediscovered for computers (von Neumann-era), prized for parallelism — in the cyclic-ordering variant, rotations on disjoint index pairs run concurrently (the classical largest-pivot sweep is sequential).
vs QR · slower than the QR algorithm (dart 103) for general use, but simpler and more accurate for small symmetric matrices — still the method of choice there.

A 19th-century planetary tool that turned out to suit the most parallel hardware of the 21st. Jacobi 1846

RECOMMEND FOR I-13 a rotation, from cos and sin

The whole sweep is f64 matrix arithmetic plus the stdlib trig — and the 2×2 diagonalises in one rotation:

$ i13 run eig.i13 # symmetric [[2,1],[1,2]] one 45-degree rotation -> diag(3, 1) # eigenvalues 3 and 1, off-diagonal -> 0
Recommend: nothing new — store the symmetric matrix flattened A[i*n+j] (2-D = PS-004); scan for the largest off-diagonal (an f64 comparison sweep), compute the angle (cos/sin from the stdlib Taylor — for equal diagonals it is exactly 45°, c = s = √2/2), and apply the rotation (verified → diag(3, 1), off-diagonal 0). Ties the Jacobi lineage the corpus already carries.
Note: a lovely contrast with QR (103): both find eigenvalues of the same matrix, one by factoring, one by rotating — and both run on I-13’s f64.