In numerical analysis, one of the most important problems is designing efficient and stable algorithms for finding the eigenvalues of a matrix. These eigenvalue algorithms may also find eigenvectors.
See main article: Eigenvalues and eigenvectors and Generalized eigenvector. Given an square matrix of real or complex numbers, an eigenvalue and its associated generalized eigenvector are a pair obeying the relation
\left(A-λI\right)k{v}=0,
where is a nonzero column vector, is the identity matrix, is a positive integer, and both and are allowed to be complex even when is real.l When, the vector is called simply an eigenvector, and the pair is called an eigenpair. In this case, . Any eigenvalue of has ordinary[1] eigenvectors associated to it, for if is the smallest integer such that for a generalized eigenvector, then is an ordinary eigenvector. The value can always be taken as less than or equal to . In particular, for all generalized eigenvectors associated with .
For each eigenvalue of, the kernel consists of all eigenvectors associated with (along with 0), called the eigenspace of, while the vector space consists of all generalized eigenvectors, and is called the generalized eigenspace. The geometric multiplicity of is the dimension of its eigenspace. The algebraic multiplicity of is the dimension of its generalized eigenspace. The latter terminology is justified by the equation
pA\left(z\right)=\det\left(zI-A\right)=
k | |
\prod | |
i=1 |
(z-
\alphai | |
λ | |
i) |
,
where is the determinant function, the are all the distinct eigenvalues of and the are the corresponding algebraic multiplicities. The function is the characteristic polynomial of . So the algebraic multiplicity is the multiplicity of the eigenvalue as a zero of the characteristic polynomial. Since any eigenvector is also a generalized eigenvector, the geometric multiplicity is less than or equal to the algebraic multiplicity. The algebraic multiplicities sum up to, the degree of the characteristic polynomial. The equation is called the characteristic equation, as its roots are exactly the eigenvalues of . By the Cayley–Hamilton theorem, itself obeys the same equation: .[2] As a consequence, the columns of the matrix must be either 0 or generalized eigenvectors of the eigenvalue, since they are annihilated by
(A-
\alphaj | |
λ | |
jI) |
Any collection of generalized eigenvectors of distinct eigenvalues is linearly independent, so a basis for all of can be chosen consisting of generalized eigenvectors. More particularly, this basis can be chosen and organized so that
If these basis vectors are placed as the column vectors of a matrix, then can be used to convert to its Jordan normal form:
V-1AV=\begin{bmatrix}λ1&\beta1&0&\ldots&0\ 0&λ2&\beta2&\ldots&0\ 0&0&λ3&\ldots&0\ \vdots&\vdots&\vdots&\ddots&\vdots\ 0&0&0&\ldots&λn\end{bmatrix},
where the are the eigenvalues, if and otherwise.
More generally, if is any invertible matrix, and is an eigenvalue of with generalized eigenvector, then . Thus is an eigenvalue of with generalized eigenvector . That is, similar matrices have the same eigenvalues.
See main article: Adjoint matrix, Normal matrix and Hermitian matrix. The adjoint of a complex matrix is the transpose of the conjugate of : . A square matrix is called normal if it commutes with its adjoint: . It is called Hermitian if it is equal to its adjoint: . All Hermitian matrices are normal. If has only real elements, then the adjoint is just the transpose, and is Hermitian if and only if it is symmetric. When applied to column vectors, the adjoint can be used to define the canonical inner product on : .[3] Normal, Hermitian, and real-symmetric matrices have several useful properties:
It is possible for a real or complex matrix to have all real eigenvalues without being Hermitian. For example, a real triangular matrix has its eigenvalues along its diagonal, but in general is not symmetric.
Any problem of numeric calculation can be viewed as the evaluation of some function for some input . The condition number of the problem is the ratio of the relative error in the function's output to the relative error in the input, and varies with both the function and the input. The condition number describes how error grows during the calculation. Its base-10 logarithm tells how many fewer digits of accuracy exist in the result than existed in the input. The condition number is a best-case scenario. It reflects the instability built into the problem, regardless of how it is solved. No algorithm can ever produce more accurate results than indicated by the condition number, except by chance. However, a poorly designed algorithm may produce significantly worse results. For example, as mentioned below, the problem of finding eigenvalues for normal matrices is always well-conditioned. However, the problem of finding the roots of a polynomial can be very ill-conditioned. Thus eigenvalue algorithms that work by finding the roots of the characteristic polynomial can be ill-conditioned even when the problem is not.
For the problem of solving the linear equation where is invertible, the matrix condition number is given by, where is the operator norm subordinate to the normal Euclidean norm on . Since this number is independent of and is the same for and, it is usually just called the condition number of the matrix . This value is also the absolute value of the ratio of the largest singular value of to its smallest. If is unitary, then, so . For general matrices, the operator norm is often difficult to calculate. For this reason, other matrix norms are commonly used to estimate the condition number.
For the eigenvalue problem, Bauer and Fike proved that if is an eigenvalue for a diagonalizable matrix with eigenvector matrix, then the absolute error in calculating is bounded by the product of and the absolute error in . As a result, the condition number for finding is . If is normal, then is unitary, and . Thus the eigenvalue problem for all normal matrices is well-conditioned.
The condition number for the problem of finding the eigenspace of a normal matrix corresponding to an eigenvalue has been shown to be inversely proportional to the minimum distance between and the other distinct eigenvalues of . In particular, the eigenspace problem for normal matrices is well-conditioned for isolated eigenvalues. When eigenvalues are not isolated, the best that can be hoped for is to identify the span of all eigenvectors of nearby eigenvalues.
The most reliable and most widely used algorithm for computing eigenvalues is John G. F. Francis' QR algorithm, considered one of the top ten algorithms of 20th century.[4]
Any monic polynomial is the characteristic polynomial of its companion matrix. Therefore, a general algorithm for finding eigenvalues could also be used to find the roots of polynomials. The Abel–Ruffini theorem shows that any such algorithm for dimensions greater than 4 must either be infinite, or involve functions of greater complexity than elementary arithmetic operations and fractional powers. For this reason algorithms that exactly calculate eigenvalues in a finite number of steps only exist for a few special classes of matrices. For general matrices, algorithms are iterative, producing better approximate solutions with each iteration.
Some algorithms produce every eigenvalue, others will produce a few, or only one. However, even the latter algorithms can be used to find all eigenvalues. Once an eigenvalue of a matrix has been identified, it can be used to either direct the algorithm towards a different solution next time, or to reduce the problem to one that no longer has as a solution.
Redirection is usually accomplished by shifting: replacing with for some constant . The eigenvalue found for must have added back in to get an eigenvalue for . For example, for power iteration, . Power iteration finds the largest eigenvalue in absolute value, so even when is only an approximate eigenvalue, power iteration is unlikely to find it a second time. Conversely, inverse iteration based methods find the lowest eigenvalue, so is chosen well away from and hopefully closer to some other eigenvalue.
Reduction can be accomplished by restricting to the column space of the matrix, which carries to itself. Since is singular, the column space is of lesser dimension. The eigenvalue algorithm can then be applied to the restricted matrix. This process can be repeated until all eigenvalues are found.
If an eigenvalue algorithm does not produce eigenvectors, a common practice is to use an inverse iteration based algorithm with set to a close approximation to the eigenvalue. This will quickly converge to the eigenvector of the closest eigenvalue to . For small matrices, an alternative is to look at the column space of the product of for each of the other eigenvalues .
A formula for the norm of unit eigenvector components of normal matrices was discovered by Robert Thompson in 1966 and rediscovered independently by several others.[5] [6] [7] [8] [9] If is an normal matrix with eigenvalues and corresponding unit eigenvectors whose component entries are, let be the matrix obtained by removing the -th row and column from, and let be its -th eigenvalue. Then
If
p,pj
A
Aj
p'
λi(A)
See main article: Hessenberg matrix.
Because the eigenvalues of a triangular matrix are its diagonal elements, for general matrices there is no finite method like gaussian elimination to convert a matrix to triangular form while preserving eigenvalues. But it is possible to reach something close to triangular. An upper Hessenberg matrix is a square matrix for which all entries below the subdiagonal are zero. A lower Hessenberg matrix is one for which all entries above the superdiagonal are zero. Matrices that are both upper and lower Hessenberg are tridiagonal. Hessenberg and tridiagonal matrices are the starting points for many eigenvalue algorithms because the zero entries reduce the complexity of the problem. Several methods are commonly used to convert a general matrix into a Hessenberg matrix with the same eigenvalues. If the original matrix was symmetric or Hermitian, then the resulting matrix will be tridiagonal.
When only eigenvalues are needed, there is no need to calculate the similarity matrix, as the transformed matrix has the same eigenvalues. If eigenvectors are needed as well, the similarity matrix may be needed to transform the eigenvectors of the Hessenberg matrix back into eigenvectors of the original matrix.
Method | Applies to | Produces | Cost without similarity matrix | Cost with similarity matrix | Description | |
---|---|---|---|---|---|---|
Householder transformations | General | Hessenberg | [10] | Reflect each column through a subspace to zero out its lower entries. | ||
Givens rotations | General | Hessenberg | Apply planar rotations to zero out individual entries. Rotations are ordered so that later ones do not cause zero entries to become non-zero again. | |||
General | Hessenberg | Perform Gram–Schmidt orthogonalization on Krylov subspaces. | ||||
Hermitian | Tridiagonal | Arnoldi iteration for Hermitian matrices, with shortcuts. |
For symmetric tridiagonal eigenvalue problems all eigenvalues (without eigenvectors) can be computed numerically in time O(n log(n)), using bisection on the characteristic polynomial.
Iterative algorithms solve the eigenvalue problem by producing sequences that converge to the eigenvalues. Some algorithms also produce sequences of vectors that converge to the eigenvectors. Most commonly, the eigenvalue sequences are expressed as sequences of similar matrices which converge to a triangular or diagonal form, allowing the eigenvalues to be read easily. The eigenvector sequences are expressed as the corresponding similarity matrices.
Method | Applies to | Produces | Cost per step | Convergence | Description | |
---|---|---|---|---|---|---|
Hermitian | largest/smallest eigenpairs | |||||
general | eigenpair with largest value | linear | Repeatedly applies the matrix to an arbitrary starting vector and renormalizes. | |||
general | linear | Power iteration for | ||||
Hermitian | any eigenpair | cubic | Power iteration for, where for each iteration is the Rayleigh quotient of the previous iteration. | |||
positive-definite real symmetric | eigenpair with value closest to μ | Inverse iteration using a preconditioner (an approximate inverse to). | ||||
real symmetric tridiagonal | any eigenvalue | linear | Uses the bisection method to find roots of the characteristic polynomial, supported by the Sturm sequence. | |||
real symmetric tridiagonal | any eigenvalue | cubic | Uses Laguerre's method to find roots of the characteristic polynomial, supported by the Sturm sequence. | |||
Hessenberg | all eigenvalues | cubic | Factors A = QR, where Q is orthogonal and R is triangular, then applies the next iteration to RQ. | |||
all eigenpairs | ||||||
real symmetric | all eigenvalues | quadratic | Uses Givens rotations to attempt clearing all off-diagonal entries. This fails, but strengthens the diagonal. | |||
Hermitian tridiagonal | all eigenvalues | Divides the matrix into submatrices that are diagonalized then recombined. | ||||
all eigenpairs | ||||||
real symmetric tridiagonal | all eigenpairs | Constructs a computable homotopy path from a diagonal eigenvalue problem. | ||||
real symmetric | eigenpair with value closest to μ | Preconditioned inverse iteration applied to | ||||
real symmetric tridiagonal | some or all eigenpairs | "Multiple relatively robust representations" – performs inverse iteration on a LDLT decomposition of the shifted matrix. | ||||
general | Eigenpair with largest eigenvalue | super-linear | Repeatedly computes the Gram product and rescales, deterministically. |
While there is no simple algorithm to directly calculate eigenvalues for general matrices, there are numerous special classes of matrices where eigenvalues can be directly calculated. These include:
Since the determinant of a triangular matrix is the product of its diagonal entries, if T is triangular, then . Thus the eigenvalues of T are its diagonal entries.
If is any polynomial and then the eigenvalues of also satisfy the same equation. If happens to have a known factorization, then the eigenvalues of lie among its roots.
For example, a projection is a square matrix satisfying . The roots of the corresponding scalar polynomial equation,, are 0 and 1. Thus any projection has 0 and 1 for its eigenvalues. The multiplicity of 0 as an eigenvalue is the nullity of, while the multiplicity of 1 is the rank of .
Another example is a matrix that satisfies for some scalar . The eigenvalues must be . The projection operators
P | \left(I+ | ||||
|
A | |
\alpha |
\right)
P | \left(I- | ||||
|
A | |
\alpha |
\right)
AP+=\alphaP+ AP-=-\alphaP-
P+P+=P+ P-P-=P- P+P-=P-P+=0.
The column spaces of and are the eigenspaces of corresponding to and, respectively.
For dimensions 2 through 4, formulas involving radicals exist that can be used to find the eigenvalues. While a common practice for 2×2 and 3×3 matrices, for 4×4 matrices the increasing complexity of the root formulas makes this approach less attractive.
For the 2×2 matrix
A=\begin{bmatrix}a&b\ c&d\end{bmatrix},
the characteristic polynomial is
\det\begin{bmatrix}λ-a&-b\ -c&λ-d\end{bmatrix}=λ2-\left(a+d\right)λ+\left(ad-bc\right)=λ2-λ{\rmtr}(A)+\det(A).
Thus the eigenvalues can be found by using the quadratic formula:
λ=
{\rmtr | |
(A) |
\pm\sqrt{{\rmtr}2(A)-4\det(A)}}{2}.
Defining to be the distance between the two eigenvalues, it is straightforward to calculate
\partialλ | |
\partiala |
=
1 | |
2 |
\left(1\pm
a-d | |
{\rmgap |
(A)}\right),
\partialλ | |
\partialb |
=
\pmc | |
{\rmgap |
(A)}
with similar formulas for and . From this it follows that the calculation is well-conditioned if the eigenvalues are isolated.
Eigenvectors can be found by exploiting the Cayley–Hamilton theorem. If are the eigenvalues, then, so the columns of are annihilated by and vice versa. Assuming neither matrix is zero, the columns of each must include eigenvectors for the other eigenvalue. (If either matrix is zero, then is a multiple of the identity and any non-zero vector is an eigenvector.)
For example, suppose
A=\begin{bmatrix}4&3\ -2&-3\end{bmatrix},
then and, so the characteristic equation is
0=λ2-λ-6=(λ-3)(λ+2),
and the eigenvalues are 3 and -2. Now,
A-3I=\begin{bmatrix}1&3\ -2&-6\end{bmatrix}, A+2I=\begin{bmatrix}6&3\ -2&-1\end{bmatrix}.
In both matrices, the columns are multiples of each other, so either column can be used. Thus, can be taken as an eigenvector associated with the eigenvalue -2, and as an eigenvector associated with the eigenvalue 3, as can be verified by multiplying them by .
The characteristic equation of a symmetric 3×3 matrix is:
\det\left(\alphaI-A\right)=\alpha3-\alpha2{\rmtr}(A)-\alpha
1 | |
2 |
\left({\rmtr}(A2)-{\rmtr}2(A)\right)-\det(A)=0.
This equation may be solved using the methods of Cardano or Lagrange, but an affine change to will simplify the expression considerably, and lead directly to a trigonometric solution. If, then and have the same eigenvectors, and is an eigenvalue of if and only if is an eigenvalue of . Letting and , gives
\det\left(\betaI-B\right)=\beta3-3\beta-\det(B)=0.
The substitution and some simplification using the identity reduces the equation to . Thus
\beta=2{\cos}\left(
1 | |
3 |
{\arccos}\left(\det(B)/2\right)+
2k\pi | |
3 |
\right), k=0,1,2.
If is complex or is greater than 2 in absolute value, the arccosine should be taken along the same branch for all three values of . This issue doesn't arise when is real and symmetric, resulting in a simple algorithm:
p1 = A(1,2)^2 + A(1,3)^2 + A(2,3)^2if (p1
% In exact arithmetic for a symmetric matrix -1 <= r <= 1 % but computation error can leave it slightly outside this range. if (r <= -1) phi = pi / 3 elseif (r >= 1) phi = 0 else phi = acos(r) / 3 end
% the eigenvalues satisfy eig3 <= eig2 <= eig1 eig1 = q + 2 * p * cos(phi) eig3 = q + 2 * p * cos(phi + (2*pi/3)) eig2 = 3 * q - eig1 - eig3 % since trace(A) = eig1 + eig2 + eig3end
Once again, the eigenvectors of can be obtained by recourse to the Cayley–Hamilton theorem. If are distinct eigenvalues of, then . Thus the columns of the product of any two of these matrices will contain an eigenvector for the third eigenvalue. However, if, then and . Thus the generalized eigenspace of is spanned by the columns of while the ordinary eigenspace is spanned by the columns of . The ordinary eigenspace of is spanned by the columns of .
For example, let
A=\begin{bmatrix}3&2&6\ 2&2&5\ -2&-1&-4\end{bmatrix}.
The characteristic equation is
0=λ3-λ2-λ+1=(λ-1)2(λ+1),
with eigenvalues 1 (of multiplicity 2) and -1. Calculating,
A-I=\begin{bmatrix}2&2&6\ 2&1&5\ -2&-1&-5\end{bmatrix}, A+I=\begin{bmatrix}4&2&6\ 2&3&5\ -2&-1&-3\end{bmatrix}
and
(A-I)2=\begin{bmatrix}-4&0&-8\ -4&0&-8\ 4&0&8\end{bmatrix}, (A-I)(A+I)=\begin{bmatrix}0&4&4\ 0&2&2\ 0&-2&-2\end{bmatrix}
Thus is an eigenvector for −1, and is an eigenvector for 1. and are both generalized eigenvectors associated with 1, either one of which could be combined with and to form a basis of generalized eigenvectors of . Once found, the eigenvectors can be normalized if needed.
If a 3×3 matrix
A
λ
A
A-λI
A-λI
λ
If
A-λI
λ
v
A-λI
u
v
v x u
(v x u) x v
v
λ
This does not work when
A