The QR algorithm is a numerical method in linear algebra designed to solve the complete eigenvalue problem, that is, to find all eigenvalues and eigenvectors of the matrix . It was developed in the late 1950s independently by V.N. Kublanovskaya and J. Francis.
Let A be a real matrix for which we want to find eigenvalues and vectors. Put A 0 = A. At the kth step (starting from k = 0), we calculate the QR decomposition A k = Q k R k , where Q k is the orthogonal matrix (i.e., Q k T = Q k −1 ), and R k is the upper triangular matrix . Then we define A k +1 = R k Q k .
notice, that
that is, all matrices A k are similar , that is, their eigenvalues are equal.
Suppose that all diagonal minors of the matrix A are not degenerate . Then the sequence of matrices A k as k → ∞ converges in shape to the cellular right triangular form corresponding to cells with identical eigenvalues modulo same. [one]
In order to obtain the eigenvectors of the matrix, we need to multiply all the matrices Q k .
Aglorhythm is considered computationally stable , because produced by orthogonal similarity transformations.
Proof for a symmetric positive definite matrix
We assume that the eigenvalues of a positive definite matrix A are ordered in descending order:
Let be
and S is a matrix composed of eigenvectors of the matrix A. Then, matrix A can be written as spectral decomposition
We find an expression for the powers of the original matrix in terms of the matrices Q k and R k . On the one hand, by the definition of the QR algorithm:
Applying this relation recursively, we obtain:
By entering the following notation:
we get
On the other hand:
Equating the right sides of the last two formulas, we obtain:
Suppose that there is an LU decomposition of the matrix S T :
then
We multiply on the right by the matrix inverse to U , and then by the inverse to Λ k :
It can be shown that
at without loss of generality, we can assume that there are units on the diagonal of the matrix L ; therefore,
We denote
moreover, the matrix P k is upper triangular, as the product of upper triangular and diagonal matrices.
Thus, we have proved that
- .
It follows from the uniqueness of the QR decomposition that if the product of the orthogonal and triangular matrix converges to the orthogonal matrix, then the triangular matrix converges to the identity matrix . From the foregoing it follows that
That is, the matrices S k converge to the eigenvector matrix of the matrix A.
Because
then
Passing to the limit, we get:
So, we have proved that the QR algorithm allows us to solve the complete eigenvalue problem for a symmetric positive definite matrix.
QR algorithm implementation
Under certain conditions, a sequence of matrices converges to a triangular matrix, Schur decomposition of the matrix . In this case, the eigenvalues of the triangular matrix are located on its diagonal, and the problem of finding the eigenvalues is considered solved. In convergence tests, it is not practical to require exact zeros in the zero part of the matrix, but you can use sets the error limits.
In the initial state of the matrix (without additional transformations), the cost of iterations is relatively high. The cost of the algorithm can be reduced by first bringing the matrix to the form of the upper Hessenberg matrix (the cost of which is estimated as arithmetic operations using a method based on the Householder transform ), and using a finite sequence of orthogonal similarity transformations. This algorithm is somewhat similar to a two-way QR decomposition. (In a conventional QR decomposition, the Householder reflection matrix is multiplied only on the left, when using the Hessenberg form the reflection matrix is multiplied on both the left and right.) Finding the QR decomposition of the upper Hessenberg matrix is estimated as arithmetic operations. Due to the fact that the shape of the Hessenberg matrix is almost upper triangular (it has only one sub-diagonal element that is not equal to zero), it is possible to immediately reduce the number of iterations required for converging the QR algorithm.
If the original matrix is symmetric, the upper Hessenberg matrix is also symmetric and therefore is three-diagonal. The whole sequence of matrices has the same property. . In this case, the cost of the procedure is estimated as arithmetic operations using the Householder Transformation Method. Finding a QR decomposition of a symmetric tridiagonal matrix is estimated as operations.
The rate of convergence depends on the degree of separation of the eigenvalues, and in practical implementation will be used "shifts", explicitly or implicitly, to enhance the separation of eigenvalues and to accelerate convergence. In a typical form for symmetric matrices, the QR algorithm accurately finds one eigenvalue (decreasing the dimension of the matrix) in one or two iterations, making this approach both effective and reliable.
Implicit QR code implementation
In modern computational practice, the QR algorithm is performed using its implicit version, which makes it easier to add multiple “shifts”. Initially, the matrix is reduced to the form of the upper Hessenberg matrix as well as in the explicit version. Then, at every step, the first column converted through a small-sized transformation of Householder similarity to the first column (or ), where is a polynomial of degree which defines a strategy for “shifts” (usually where and these are two eigenvalues of the residual submatrix size 2 x 2, this is the so-called implicit double shift). Then consecutive Householder transformations of dimension are made in order to return the working matrix to the form of the upper Hessenberg matrix.
Notes
- ↑ Numerical methods / N. S. Bakhvalov, N. P. Zhidkov, G. M. Kobelkov. - 3rd ed. - M: BINOM, Laboratory of knowledge, 2004. - S. 321. - 636 p. - ISBN 5-94774-175-X .