Only rows k and ℓ and columns k and ℓ of A will be affected, and that A′ will remain symmetric. Also, an explicit matrix for Qkℓ is rarely computed; instead, auxiliary values are computed and A is updated in an efficient and numerically stable way. However, for reference, we may write the matrix as
That is, Qkℓ is an identity matrix except for four entries, two on the diagonal (qkk and qℓℓ, both equal to c) and two symmetrically placed off the diagonal (qkℓ and qℓk, equal to s and −s, respectively), where c = cos θ and s = sin θ for some angle θ. This is the same matrix as defines a Givens rotation, but for Jacobi rotations the choice of angle is different (very roughly half as large), since the rotation is applied on both sides simultaneously. It is not necessary to calculate the angle itself to apply the rotation. Using Kronecker delta notation, the matrix entries can be written:
Suppose h is an index other than k or ℓ (which must themselves be distinct). Then the similarity update produces, algebraically:
The process of performing a Jacobi rotation involves solving the following expression in terms of rotation angle, θ.[1][2]
If we let c=cos(θ) and s=sin(θ), then
and the matrix entry a'kl, reduces to,
.
The Schur decomposition determines the rotation angle angle, θ, or more conveniently, sin(θ) and cos(θ), needed for the Jacobi rotation to set any a'kl to 0 when rotating on matrix entry (k,l), and yields the following expression when performing the matrix operation above,
.
Further algebraic manipulation with t=tan(θ) yields,
.
Then, define
the solution expression is then,
.
and
.
It is important to use the smaller of the two roots to insure a minimal angle solution is used.
c and s may then be determine directly from θ or more conveniently from the well known trigonometric identity expressions,
Therefore, the rotation angle, θ, never needs to be explicitly computed, and the Jacobi rotation may be performed with the three values k, ℓ, and t.
Although we now could use the algebraic update equations given previously, it may be preferable to rewrite them using trigonometric half angle identities. Let:
Some applications may require multiple zero entries in a similarity matrix, possibly in the form of a tridiagonal matrix. Since Jacobian rotations may remove zeros from other cells that were previously zeroed, it is usually not possible to achieve tridiagonalization by simply zeroing each off-tridiagonal cell individually in a medium to large matrix. However, if Jacobian rotations are repeatedly performed on the above-tridiagonal cell with the highest absolute value using an adjacent cell just below or to the left to rotate on, then all of the off-triangular cells are expected to converge on zero after several iterations. In the example below, is a 5X5 matrix that is to be tridiagonalized into a similar matrix, . Some applications do not permit rotating on cells to be zeroed and therefore requite rotation to be performed on adjacent cells. Note that the Symmetric Schur Decomposition process above does not apply in this case, but the arithmetic is simpler. [2]
To tridiagonalize matrix into matrix , the off-tridiagonal cells [1,3], [1,4], [1,5], [2,4], [2,5], and [3,5], must continue to be iteratively zeroed until the maximum absolute value of those cells is below an acceptable convergence threshold. This example will use 1.e-14.. The cells below the diagonal will be zeroed automatically, due to the symmetric nature of the matrix. The first Jacobian rotation will be on the off-tridiagonal cell with the highest absolute value, which by inspection is [1,4] with a value of 11. To make this entry zero, the condition specified in the above equations must be met for the cell coordinates to be zeroed () and for the selected rotational coordinates of (), and are reproduced below for the first iteration.
To force cell[1,4] and [4,1] to be 0 by rotating on cell[1][3]:
The first rotation iteration, , produces a matrix with cells [1,4] and [4,1] zeroed, as expected. Furthermore, the eigenvalues and determinant of are identical to those of and T1 is also symmetric, confirming that the Jacobian rotation was performed correctly. The next iteration for will select cell [2,5] which contains the highest absolute value, 4.8001142, of all the cells to be zeroed..
After 10 iterations of zeroing the cell with the maximum absolute value using Jacobian rotations on the cell just below it, the maximum absolute value of all off-tridiagonal cells is 2.6e-15. Assuming this convergence criteria is acceptably low for the application it is being performed for, the similar triangularized matrix is shown below.
Since and have identical eigenvalues and determinants and is also symmetric, and are similar matrices with being tridiagonalized.
Jacobian rotation can be used to extract the eigenvalues in a similar manner as the triangulation example above, but by zeroing all of the cells above the diagonal, instead of the tridiagonal, and performing the Jacobian rotation directly in the cells to be zeroed, instead of an adjacent cell, which is the process described in the Symmetric Schur Decomposition paragraph above.[1]
Starting with the same matrix as the tridiagonal example,
The first Jacobian rotation will be on the off-diagonal cell with the highest absolute value, which by inspection is [1,4] with a value of 11, and the rotation cell will also be [1,4], in the equations above. The rotation angle is the result of a quadratic solution, but it can be seen in the equation that if the matrix is symmetric, then a real solution is assured.
To force cell[1,4] and [4,1] to be 0 by rotating on cell[1][4]:
The first rotation iteration, , produces a matrix with cells [1,4] and [4,1] zeroed, as expected. Furthermore, the eigenvalues and determinant of are identical to those of and T1 is also symmetric, confirming that the Jacobian rotation was performed correctly. The next iteration for will select cell [3,4] which contains the highest absolute value, 8.5794421, of all the cells to be zeroed..
After 25 iterations of zeroing the cell with the maximum absolute value using Jacobian rotations on the cell just below it, the maximum absolute value of all off-diagonal cells is 9.0233029E-11. Assuming this convergence criteria is acceptably low for the application it is being performed for, the similar diagonalized matrix is shown below.
The eigenvalues are now displayed across the diagonal, and may be directly extracted for use elsewhere.
Since and have identical eigenvalues and determinants and is also symmetric, and are similar matrices with being successfully diagonalized.
^ abGolub, Gene H.; Van Loan, Charles F. (1996). Matrix Computations (3rd ed.). Baltimore and London: The Johns Hopkins University Press. pp. 426–428. ISBN0-8018-5414-8.{{cite book}}: CS1 maint: date and year (link)