Jacobi rotation
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:
- [math]\displaystyle{ A \mapsto Q_{k\ell}^T A Q_{k\ell} = A' . \,\! }[/math]
- [math]\displaystyle{ \begin{bmatrix} {*} & & & \cdots & & & * \\ & \ddots & & & & & \\ & & a_{kk} & \cdots & a_{k\ell} & & \\ \vdots & & \vdots & \ddots & \vdots & & \vdots \\ & & a_{\ell k} & \cdots & a_{\ell\ell} & & \\ & & & & & \ddots & \\ {*} & & & \cdots & & & * \end{bmatrix} \to \begin{bmatrix} {*} & & & \cdots & & & * \\ & \ddots & & & & & \\ & & a'_{kk} & \cdots & 0 & & \\ \vdots & & \vdots & \ddots & \vdots & & \vdots \\ & & 0 & \cdots & a'_{\ell\ell} & & \\ & & & & & \ddots & \\ {*} & & & \cdots & & & * \end{bmatrix}. }[/math]
It is the core operation in the Jacobi eigenvalue algorithm, which is numerically stable and well-suited to implementation on parallel processors[citation needed].
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
- [math]\displaystyle{ Q_{k\ell} = \begin{bmatrix} 1 & & & & & & \\ & \ddots & & & & 0 & \\ & & c & \cdots & s & & \\ & & \vdots & \ddots & \vdots & & \\ & & -s & \cdots & c & & \\ & 0 & & & & \ddots & \\ & & & & & & 1 \end{bmatrix} . }[/math]
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). Here c = cos θ and s = sin θ for some angle θ; but to apply the rotation, the angle itself is not required. Using Kronecker delta notation, the matrix entries can be written:
- [math]\displaystyle{ q_{ij} = \delta_{ij} + (\delta_{ik}\delta_{jk} + \delta_{i\ell}\delta_{j\ell})(c-1) + (\delta_{ik}\delta_{j\ell} - \delta_{i\ell}\delta_{jk})s . \,\! }[/math]
Suppose h is an index other than k or ℓ (which must themselves be distinct). Then the similarity update produces, algebraically:
- [math]\displaystyle{ a'_{hk} = a'_{kh} = c a_{hk} - s a_{h\ell} \,\! }[/math]
- [math]\displaystyle{ a'_{h\ell} = a'_{\ell h} = c a_{h\ell} + s a_{hk} \,\! }[/math]
- [math]\displaystyle{ a'_{k\ell} = a'_{\ell k} = (c^2-s^2)a_{k\ell} + sc (a_{kk} - a_{\ell\ell}) = 0 \,\! }[/math]
- [math]\displaystyle{ a'_{kk} = c^2 a_{kk} + s^2 a_{\ell\ell} - 2 s c a_{k\ell} \,\! }[/math]
- [math]\displaystyle{ a'_{\ell\ell} = s^2 a_{kk} + c^2 a_{\ell\ell} + 2 s c a_{k\ell}. \,\! }[/math]
Numerically stable computation
To determine the quantities needed for the update, we must solve the off-diagonal equation for zero (Golub Van Loan). This implies that:
- [math]\displaystyle{ \frac{c^2-s^2}{sc} = \frac{a_{\ell\ell} - a_{kk}}{a_{k\ell}} . }[/math]
Set β to half of this quantity:
- [math]\displaystyle{ \beta = \frac{a_{\ell\ell} - a_{kk}}{2 a_{k\ell}} . }[/math]
If akℓ is zero we can stop without performing an update, thus we never divide by zero. Let t be tan θ. Then with a few trigonometric identities we reduce the equation to:
- [math]\displaystyle{ t^2 + 2\beta t - 1 = 0 . \,\! }[/math]
For stability we choose the solution:
- [math]\displaystyle{ t = \frac{\sgn(\beta)}{|\beta|+\sqrt{\beta^2+1}} . }[/math]
From this we may obtain c and s as:
- [math]\displaystyle{ c = \frac{1}{\sqrt{t^2+1}} \,\! }[/math]
- [math]\displaystyle{ s = c t \,\! }[/math]
Although we now could use the algebraic update equations given previously, it may be preferable to rewrite them. Let:
- [math]\displaystyle{ \rho= \frac{1-c}{s} , }[/math]
so that ρ = tan(θ/2). Then the revised update equations are:
- [math]\displaystyle{ a'_{hk} = a'_{kh} = a_{hk} - s (a_{h\ell} + \rho a_{hk}) \,\! }[/math]
- [math]\displaystyle{ a'_{h\ell} = a'_{\ell h} = a_{h\ell} + s (a_{hk} - \rho a_{h\ell}) \,\! }[/math]
- [math]\displaystyle{ a'_{k\ell} = a'_{\ell k} = 0 \,\! }[/math]
- [math]\displaystyle{ a'_{kk} = a_{kk} - t a_{k \ell} \,\! }[/math]
- [math]\displaystyle{ a'_{\ell\ell} = a_{\ell\ell} + t a_{k \ell} \,\! }[/math]
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.
See also
References
- Golub, Gene H.; Van Loan, Charles F. (1996), Matrix Computations (3rd ed.), Baltimore: Johns Hopkins University Press, ISBN 978-0-8018-5414-9
Original source: https://en.wikipedia.org/wiki/Jacobi rotation.
Read more |