The QR Algorithm
The QR algorithm is the workhorse of numerical eigenvalue computation. It computes all eigenvalues of a matrix simultaneously with guaranteed convergence and cost (after reduction to Hessenberg form).
Basic QR Algorithm
The basic QR algorithm produces a sequence of similar matrices: given , compute the QR factorization and set . Since is unitarily similar to , all iterates share the same eigenvalues. Under mild conditions (distinct eigenvalue magnitudes), converges to upper triangular (or quasi-upper triangular in real arithmetic), with eigenvalues on the diagonal.
For : QR factorization gives , (approximately). Then ; the off-diagonal entries shrink by a factor of per iteration. After a few iterations, .
Shifted QR Algorithm
The shifted QR algorithm uses , . The shift accelerates convergence by targeting specific eigenvalues. The Wilkinson shift chooses as the eigenvalue of the bottom-right submatrix of that is closer to . For symmetric matrices, the Wilkinson shift guarantees cubic convergence of the bottom-right entry to an eigenvalue.
Direct QR factorization costs per step. Hessenberg reduction first transforms (upper Hessenberg, for ) in operations using Householder reflectors. Each QR step on a Hessenberg matrix costs only (using Givens rotations), and the result is again Hessenberg. The implicit QR algorithm (Francis algorithm) performs the shift without explicitly forming , using a "bulge chase" that maintains the Hessenberg structure.
Practical Implementation
For real matrices with complex eigenvalues, the double-shift (Francis) QR step implicitly applies two shifts (a complex conjugate pair) simultaneously, maintaining real arithmetic throughout. This is achieved by computing , taking only its first column, and performing a "bulge chase" with Householder reflectors to restore Hessenberg form.
For a random symmetric matrix: unshifted QR requires iterations to converge. With the Wilkinson shift: iterations per eigenvalue on average, for a total of iterations. Total cost: for Hessenberg reduction plus per eigenvalue extraction, giving an overall algorithm.