Givens rotation
From Wikipedia, the free encyclopedia
In numerical linear algebra, a Givens rotation is a rotation in the plane spanned by two coordinates axes. Givens rotations are named after Wallace Givens who introduced them to numerical analysts in the 1950s while he was working at Argonne National Laboratory.
Contents |
[edit] Matrix representation
A Givens rotation is represented by a matrix of the form
where c = cos(θ) and s = sin(θ) appear at the intersections ith and jth rows and columns. That is, a Givens rotation matrix is the identity matrix with these substitutions:
The product G(i,j,θ)Tx represents a counterclockwise rotation of the vector x in the (i,j) plane of θ radians, hence the name Givens rotation.
The main use of Givens rotations in numerical linear algebra is to introduce zeros in vectors or matrices. This effect can, for example, be employed for computing the QR decomposition of a matrix. One advantage over Householder transformations is that they can easily be parallelised, and another is that often for very sparse matrices they have a lower operation count.
[edit] Stable calculation
When a Givens rotation matrix, G(i,k,θ), is multiplied times another matrix, A, from the left, GA, only rows i and k of A are affected. Thus we restrict attention to the following problem. Given a and b, find c = cos θ and s = sin θ such that
Explicit calculation of θ is rarely necessary or desirable. Instead we directly seek c, s, and r. An obvious solution would be
However, the computation for r may overflow or underflow. An alternative formulation which does not overflow if |b| ≥ |a| > 0 is t ← −a / b, s ← 1 / sqrt(1 + t2), c ← st; similar reformulations cover the other cases (Golub & Van Loan 1996, §5.1.8). Another possibility is to use the hypot function.
Furthermore, as Anderson (2000) discovered in improving LAPACK, a previously overlooked numerical consideration is continuity. To achieve this, we require r to be positive.
if (b = 0) then {c ← copysign(1,a); s ← 0; r ← abs(a)}
else if (a = 0) then {c ← 0; s ← copysign(1,b); r ← abs(b)}
else if (abs(b) > abs(a)) then
t ← a/b
u ← copysign(sqrt(1+t*t),b)
s ← 1/u
c ← s*t
r ← b*u
else
t ← b/a
u ← copysign(sqrt(1+t*t),a)
c ← 1/u
s ← c*t
r ← a*u
This is written in terms of the IEEE 754r copysign(x,y) function, which provides a safe and cheap way to copy the sign of y to x. If that is not available, x*sgn(y), using the sign function, is an alternative.
[edit] Example
Given the following 3x3 Matrix, perform two iterations of the Given's Rotation to bring the matrix to an upper Triangular matrix in order to compute the QR decomposition.
In order to form the desired matrix, we must zero elements (2,1) and (3,2). We first select element (2,1) to zero. Using a rotation matrix of:
We have the following matrix multiplication:
Where:
Plugging in these values for c and s and performing the matrix multiplication above yields a new A of:
We now want to zero element (3,2) to finish off the process. Using the same idea as before, we have a rotation matrix of:
We are presented with the following matrix multiplication:
Where:
Plugging in these values for c and s and performing the multiplications gives us a new matrix of:
This new matrix R is the upper triangular matrix needed to perform an iteration of the QR decomposition. Q is now formed using the transpose of the rotation matrices in the following manner:
Performing this matrix multiplication yields:
This completes two iterations of the Givens Rotation and calculating the QR decomposition can now be done.
[edit] See also
[edit] References
- Golub, Gene H.; Van Loan, Charles F. (1996), Matrix Computations (3rd ed.), Johns Hopkins, ISBN 978-0-8018-5414-9.
- Anderson, Edward (2000), Discontinuous Plane Rotations and the Symmetric Eigenvalue Problem, http://www.netlib.org/lapack/lawns/downloads/. LAPACK Working Note 150, University of Tennessee, UT-CS-00-454, December 4, 2000.
- D. Bindel, J. Demmel, W. Kahan, O. Marques. (2001) On Computing Givens rotations reliably and efficiently. LAPACK Working Note 148, University of Tennessee, UT-CS-00-449, January 31, 2001.
- Cybenko, George (March-April, 2001), "Reducing Quantum Computations to Elementary Unitary Operations", Computing in Science and Engineering 3 (2): 27-32, doi:, http://www.ar-tiste.com/cybenko2001.pdf
















