Jacobi rotation

From Wikipedia, the free encyclopedia
Revision as of 19:36, 23 January 2025 by imported>Michael Devore (Eigenvalues example: double "with the")
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In numerical linear algebra, a Jacobi rotation is a rotation, Qk, of a 2-dimensional linear subspace of an n-dimensional inner product space, chosen to zero a symmetric pair of off-diagonal entries of an n×n real symmetric matrix, A, when applied as a similarity transformation:

AQkTAQk=A.
[**akkakaka**][**a'kk00a'**].

It is the core operation in the Jacobi eigenvalue algorithm, which is numerically stable and well-suited to implementation on parallel processors Template:Fact.

Only rows k and ℓ and columns k and ℓ of A will be affected, and that ATemplate:Prime 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

Qk=[10cssc01].

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 qk, 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:

qij=δij+(δikδjk+δiδj)(c1)+(δikδjδiδjk)s.

Suppose h is an index other than k or ℓ (which must themselves be distinct). Then the similarity update produces, algebraically:

a'hk=a'kh=cahksah
a'h=a'h=cah+sahk
a'k=a'k=(c2s2)ak+sc(akka)=0
a'kk=c2akk+s2a2scak
a'=s2akk+c2a+2scak.

Numerically stable computation

To determine the quantities needed for the update, we must solve the off-diagonal equation for zero Script error: No such module "Footnotes".. This implies that:

akaakk=scc2s2.

Set β to twice this quantity: β=2akaakk=2scc2s2=sin(2θ)cos(2θ)=tan(2θ).

Let t be tan θ. Then with a few trigonometric identities we reduce the equation to:

t2+2βt1=0.

For stability we choose the solution with |t|1, as this will make |s||c|; the angle of rotation is at most 45°. That solution may be expressed as t=sgn(β)|β|+β2+1. (In the case β=0 both solutions t=±1 are equally good, but sgn(β) must not be interpreted as zero.) From this we may obtain c and s as:

c=1t2+1
s=ct

Although we now could use the algebraic update equations given previously, it may be preferableTemplate:How to rewrite them. Let:

ρ=1cs,

so that ρ = tan(θ/2). Then the revised update equations are:

a'hk=a'kh=ahks(ah+ρahk)
a'h=a'h=ah+s(ahkρah)
a'k=a'k=0
a'kk=akktak
a'=a+tak

As previously remarked, we need never explicitly compute the rotation angle θ. In fact, we can reproduce the symmetric update determined by Qk by retaining only the three values k, ℓ, and t, with t set to zero for a null rotation.

Tridiagonal example

Some applications may require multiple zero entries in a similarity matrix, possibly in the form of a tridiagonal matrix.[1] 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, A is a 5X5 matrix that is to be tridiagonalized into a similar matrix, T.

A=[259117536259673111231375134]eigenvalues of A=[4.17145495.93080025.368258524.05476211.788758]|A|=37662

To tridiagonalize matrix A into matrix T, 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 (h=1,l=4) and for the selected rotational coordinates of S (h=1,k=3), 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]:

setting a'h=a'h=0 in above equation, a'h=a'h=cah+sahk9sin(θ)+11cos(θ)=0θ=tan1(11/9)=0.8850668sin(θ)=0.77395730cos(θ)=0.66323890More conveniountly:r=112+92=14.2126704sin(θ)=11/r=0.77395730cos(θ)=9/r=0.66323890S=[1000000.6632389000.7739573000010000.7739573000.66323890000001]T1=STAS=[212.08304690712.0830460.164383565.21391710.561643844.800114295.213917174.22079100.561643844.220794.16438363.310423674.800114213.31042364]eigenvalues of T1=[4.17145495.93080025.368258524.05476211.788758]|T1|=37662

The first rotation iteration, T1, produces a matrix with cells [1,4] and [4,1] zeroed, as expected. Furthermore, the eigenvalues and determinant of T1are identical to those of A and T1 is also symmetric, confirming that the Jacobian rotation was performed correctly. The next iteration for T2 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 T matrix is shown below.

T=[216.61324800016.61324810.1847835.11093460005.11093464.03041884.55413720004.55413723.39016720.435153350000.435153354.1749658]eigenvalues of T=[4.17145495.93080025.368258524.05476211.788758]|T|=37662

Since A and T have identical eigenvalues and determinants and T is also symmetric, A and T are similar matrices with T being tridiagonalized.

Eigenvalues example

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.

Starting with the same matrix A as the tridiagonal example,

A=[259117536259673111231375134]eigenvalues of A=[4.17145495.93080025.368258524.05476211.788758]|A|=37662

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], l=4,k=1 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]:

setting a'k=a'k=0 in above equation: a'k=a'k=(c2s2)ak+sc(akka)11(cos2(θ)sin2(θ))+(21)cos(θ)sin(θ)=0dividing by -cos2(θ):tan2(θ)tan(θ)/111=0tan(θ)=[1/11+1/112+4]/2=1.0464871θ=tan1(1.0464871)=0.80810980sin(θ)=0.72298259cos(θ)=0.69086625More conveniountly:r=1.04648712+1=1.4474582sin(θ)=1.0464871/r=0.72298259cos(θ)=1/r=0.69086625S=[0.69086625000.72298259001000001000.72298259000.69086625000001]T1=STAS=[9.51135784.90029644.048848402.66711594.9002964362.233180554.0488484678.5794421102.23318058.579442112.5113587.13347692.6671159517.13347694]eigenvalues of T1=[4.17145495.93080025.368258524.05476211.788758]|T1|=37662

The first rotation iteration, T1, produces a matrix with cells [1,4] and [4,1] zeroed, as expected. Furthermore, the eigenvalues and determinant of T1are identical to those of A and T1 is also symmetric, confirming that the Jacobian rotation was performed correctly. The next iteration for T2 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 T matrix is shown below.

T=[24.054762000005.93080020000011.788758000004.1714549000005.3682585]eigenvalues of T=[4.17145495.93080025.368258524.05476211.788758]|T|=37662

The eigenvalues are now displayed across the diagonal, and may be directly extracted for use elsewhere.

Since A and T have identical eigenvalues and determinants and T is also symmetric, A and T are similar matrices with T being successfully diagonalized.

See also

References

Template:Reflist

  • Script error: No such module "citation/CS1".


Template:Numerical linear algebra

  1. Script error: No such module "citation/CS1".