The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

The QR Algorithm: Sweeping a Matrix into Schur Form

Chapter 9 · Mathematics for AI and Machine Learning · Advanced · 1:56

An interactive live film: the entries of A_k stand as bars; QR steps shrink everything below the diagonal and the diagonal settles on the eigenvalues, with the rates on a log panel. Choose a shift that kills the bottom entry in five steps.

Narration

Here is a matrix that is not symmetric, with eigenvalues four, two and one. Each bar is the size of one entry: blue on the diagonal, red below it, grey above.

One step of the QR algorithm factors the matrix as Q times R, and multiplies them back the other way, R times Q. That is Q transposed A Q, an orthogonal similarity, so the eigenvalues stay the same.

The rest of the narration is in the book's Companion.

More from Chapter 9

Interactive1:34LoRA: a Low-Rank UpdateChapter 9Preview1:48LDL Is Completing the SquareChapter 9Preview1:25Superposition and Sparse CodingChapter 9Preview1:47Rank-Revealing QR: Pick the Columns in a Good OrderChapter 9Preview1:36Non-Negative Matrix Factorization: a Cone of PartsChapter 9Preview1:33CUR: Rebuilding a Matrix from Its Own Rows and ColumnsChapter 9