Diagonalize a real symmetric matrix by following a sequence of plane rotations. Each step removes a symmetric pair of off-diagonal entries while preserving the eigenvalues.
The Jacobi method repeatedly chooses the largest off-diagonal entry and applies an orthogonal rotation in the corresponding coordinate plane. The transformed matrix stays symmetric, and its off-diagonal entries approach zero.
The columns of $Q_k$ accumulate the rotations. When $A_k$ is nearly diagonal, its diagonal entries approximate the eigenvalues and the columns of $Q_k$ are the corresponding orthonormal eigenvectors.
The off-diagonal Frobenius norm is used as a convergence measure. Rotations preserve the Frobenius norm and symmetry.
Highlighted cells show the pair selected for the next rotation. The diagonal entries of the current matrix are the eigenvalue estimates; values are rounded for display.
These residuals measure how closely the computed vectors are orthonormal and how accurately they reconstruct the original matrix.
Both residuals are Frobenius norms. Small values indicate that $Q^TQ\approx I$ and $A_0\approx Q\Lambda Q^T$.