Computing Eigenvalues and Singular Values
Computing Eigenvalues and Singular Values with Orthogonal Factorizations
Large matrices often contain far more information than is needed for a particular computation. For example, a matrix may be millions by millions, yet a problem may require only a few of its eigenvalues or singular values. Numerical linear algebra develops algorithms that preserve the important mathematical quantities while transforming the matrix into a much easier form.
Two central ideas are:
- Similarity transformations preserve eigenvalues.
- Orthogonal transformations on the left and right preserve singular values.
The QR factorization provides the foundation for both types of algorithms.
Eigenvalues and Similarity Transformations
An eigenvalue λ of a matrix A is a number for which there is a nonzero vector v satisfying
Av=λv.The vector v is an eigenvector. Eigenvalues describe directions in which a matrix acts by simple scaling rather than by changing the direction of a vector.
When computing eigenvalues numerically, the goal is not necessarily to find a closed-form formula. Instead, the goal is to transform the matrix into a form whose eigenvalues are easy to read while making sure that the eigenvalues do not change during the transformation.
Two matrices A and B are similar if there is an invertible matrix S such that
B=S−1AS.Similar matrices have exactly the same eigenvalues. This makes similarity transformations the natural tool for eigenvalue algorithms.
A similarity transformation changes the representation of a matrix without changing its eigenvalues.
Think About It
If two matrices represent the same linear transformation in different bases, why should their eigenvalues remain the same?
The QR Factorization
The QR factorization writes a matrix A as
A=QR,where:
- Q is orthogonal, so QTQ=I,
- R is upper triangular.
The columns of Q form an orthonormal basis. The columns of the original matrix A may not be perpendicular, so a process such as Gram–Schmidt is used to replace them with orthogonal, normalized directions. The upper-triangular matrix R records how the original columns are expressed in terms of this new orthonormal basis.
Suppose the initial matrix is called A0. Its QR factorization is
A0=Q0R0.The QR method then reverses the order of the factors:
A1=R0Q0.The factorization is repeated:
A1=Q1R1,A2=R1Q1,and so on.
The surprising fact is that every matrix in this sequence has the same eigenvalues.
Why the QR Iteration Preserves Eigenvalues
Starting from
A0=Q0R0,multiply on the left by Q0T. Since Q0T=Q0−1,
Q0TA0=R0.Therefore,
A1=R0Q0=Q0TA0Q0.This has the form
A1=Q0−1A0Q0,so A1 is similar to A0. Consequently, A1 and A0 have the same eigenvalues. The same argument applies at every iteration.
The QR method therefore separates the problem into two tasks:
- Use QR factorization to create a new matrix.
- Reverse the factors to obtain a similar matrix with the same eigenvalues.
Why the Diagonal Eventually Reveals the Eigenvalues
For many matrices, repeated QR iterations cause entries below the main diagonal to become smaller and smaller. The matrix gradually approaches an upper-triangular form:
Ak≈λ100∗λ20∗∗λ3.The eigenvalues of a triangular matrix are its diagonal entries. Since every Ak has the same eigenvalues as A0, the diagonal entries of the nearly triangular matrix provide approximations to the eigenvalues of the original matrix.
The entries below the diagonal may not become exactly zero in finite arithmetic, but once they are sufficiently small, the diagonal entries become accurate eigenvalue approximations.
This behavior is the key numerical phenomenon behind the QR algorithm. It is not simply a matter of solving a characteristic polynomial directly. Instead, the matrix is repeatedly transformed into a form in which the eigenvalues become visible.
A Small 2×2 Illustration
In a suitable 2×2 example involving cosθ and sinθ, one QR step can transform an off-diagonal entry involving sinθ into one involving
sin3θ.A later step produces approximately
sin9θ,and the next produces approximately
sin27θ.Thus, an off-diagonal quantity is raised successively to the powers 3, 9, and 27. When its magnitude is less than 1, it approaches zero extremely rapidly. This behavior is called cubic convergence in the example.
The exact convergence behavior depends on the matrix, but the example illustrates why QR iteration can be remarkably effective.
The QR method preserves eigenvalues through similarity while driving the matrix toward a form whose diagonal displays those eigenvalues.
Shifted QR Iteration
The basic QR method can be made much faster by introducing a shift. A shift is a scalar multiple of the identity matrix, written as
sI.Instead of factoring Ak directly, the shifted method factors
Ak−sI=QkRk.It then reverses the factors and adds the shift back:
Ak+1=RkQk+sI.The shift changes the location of the eigenvalues temporarily, but it does not change the eigenvectors.
If
A0v=λv,then
(A0−sI)v=A0v−sIv=λv−sv=(λ−s)v.Therefore:
- The eigenvectors remain the same.
- Every eigenvalue changes from λ to λ−s.
If the shift s is chosen close to an eigenvalue, that eigenvalue of Ak−sI becomes close to zero. This often accelerates the QR iteration and causes the corresponding part of the matrix to converge rapidly.
Why the Shifted Method Still Preserves Eigenvalues
Assume
Ak−sI=QkRk.Then
Rk=QkT(Ak−sI).The new matrix is
Ak+1=RkQk+sI.Substituting the expression for Rk gives
Ak+1=QkT(Ak−sI)Qk+sI.Expanding the shifted term,
Ak+1=QkTAkQk−sQkTQk+sI.Because Qk is orthogonal,
QkTQk=I.Thus,
Ak+1=QkTAkQk−sI+sI=QkTAkQk.The shift cancels out. The resulting matrix is still similar to Ak, so the eigenvalues are preserved.
A shift changes the temporary matrix being factored, but the shift is canceled after the factors are reversed and the shift is restored.
Think About It
Why would making one eigenvalue close to zero in the shifted matrix help the iteration converge more quickly?
Making QR Factorization Less Expensive
The main computational cost in the QR method is the QR factorization itself. Reversing the factors is comparatively inexpensive. Therefore, numerical algorithms try to transform the original matrix into a form containing many zeros before beginning repeated QR iterations.
The most useful general form is upper Hessenberg form.
An upper Hessenberg matrix has zeros below the first subdiagonal. Its pattern looks like
∗∗00∗∗∗0∗∗∗∗∗∗∗∗.It is almost upper triangular, but it retains one additional nonzero diagonal below the main diagonal.
A matrix can be reduced to upper Hessenberg form using orthogonal similarity transformations. Because these are similarity transformations, the eigenvalues remain unchanged.
The advantage is that the zeros in the Hessenberg structure remain in place during QR iteration. The algorithm therefore avoids operating on the entire dense matrix at every step. The number of nonzero entries and the amount of arithmetic are substantially reduced.
The complete practical strategy for a general matrix is therefore:
- Reduce the matrix to upper Hessenberg form using orthogonal similarity transformations.
- Apply shifted QR iterations to the Hessenberg matrix.
- Read the eigenvalues from the resulting diagonal or diagonal blocks.
The Special Advantage of Symmetric Matrices
A matrix A is symmetric if
AT=A.Symmetric matrices receive special treatment because orthogonal transformations preserve symmetry. If a symmetric matrix is transformed by
A1=QTAQ,then
A1T=(QTAQ)T=QTATQ=QTAQ=A1.Thus, A1 is also symmetric.
Now combine symmetry with upper Hessenberg structure. An upper Hessenberg matrix has zeros below the first subdiagonal. Symmetry forces the corresponding entries above the first superdiagonal to be zero as well. The matrix therefore has nonzero entries only on:
- the main diagonal,
- the diagonal immediately above it,
- the diagonal immediately below it.
Such a matrix is called tridiagonal:
∗∗00∗∗∗00∗∗∗00∗∗.For a symmetric matrix, the entries above and below the main diagonal are mirror images. Therefore, only about two sets of n numbers need to be stored rather than roughly n2 entries.
The symmetric eigenvalue algorithm becomes:
- Reduce the symmetric matrix to symmetric tridiagonal form.
- Apply QR iteration with shifts while maintaining the tridiagonal structure.
- Extract the eigenvalues from the converged diagonal.
This is much faster than applying the general dense QR method.
A symmetric Hessenberg matrix is tridiagonal, so symmetry reduces the eigenvalue computation to a much more efficient problem.
Think About It
Why does symmetry turn an upper Hessenberg matrix into a tridiagonal matrix rather than leaving the entire upper Hessenberg pattern intact?
Why Direct Characteristic-Polynomial Methods Are Not Used
The eigenvalues of an n×n matrix are roots of the characteristic equation
det(A−λI)=0.Although this equation is mathematically correct, directly computing the determinant and solving the resulting polynomial is a poor numerical strategy.
There are several reasons:
- Determinant computation is unnecessarily slow for this purpose.
- The determinant compresses information from many matrix entries into a small number of polynomial coefficients.
- The polynomial coefficients can be extremely sensitive to small numerical errors.
- Finding the roots of a high-degree polynomial can be ill-conditioned.
A major mathematical result associated with Abel states that, in general, polynomial equations of degree 5 or higher do not have solutions expressible by a simple formula using radicals. Consequently, one cannot expect a universal closed-form formula for the eigenvalues of a general matrix of size 5×5 or larger.
This does not mean that eigenvalues cannot be computed. It means that they are generally obtained through numerical iteration rather than through a simple finite symbolic formula.
The QR method can approximate eigenvalues to a desired tolerance. In contrast to a symbolic formula, it may require many small computational steps, but it provides accurate numerical answers. The overall work for dense problems is on the order of
n3operations, which is practical for matrices of moderate and large size.
Singular Values
The singular values of a matrix A are the nonnegative diagonal entries in its singular value decomposition, or SVD:
A=UΣVT,where U and V are orthogonal and Σ is diagonal with nonnegative entries.
The singular values measure how strongly the matrix stretches different orthogonal directions. Unlike eigenvalues, singular values are defined for rectangular matrices as well as square matrices, and they are always real and nonnegative.
The singular values are related to the eigenvalues of ATA. If σi is a singular value, then
σi2is an eigenvalue of ATA. Equivalently,
σi=λi(ATA).However, a numerical algorithm should not normally form ATA explicitly.
Why ATA Should Not Be Formed Directly
Although forming ATA gives a theoretical route to the singular values, it can be numerically undesirable. Multiplying a matrix by its transpose can worsen conditioning and can magnify the effects of rounding errors.
A better method transforms A directly using orthogonal matrices. Orthogonal transformations are numerically stable because they preserve lengths and do not magnify errors in the same way that arbitrary transformations can.
What Transformations Preserve Singular Values?
For eigenvalues, similarity transformations have the form
S−1AS.For singular values, the corresponding freedom is greater. A matrix can be multiplied on the left and right by different orthogonal matrices without changing its singular values.
Suppose
A=UΣVT.Let Q1 and Q2 be orthogonal matrices. Then
Q1AQ2T=Q1UΣVTQ2T.Because products of orthogonal matrices are orthogonal, both
Q1Uand
Q2Vare orthogonal. Therefore,
Q1AQ2T=(Q1U)Σ(Q2V)T.The middle diagonal matrix Σ has not changed. Hence the singular values are unchanged.
Left and right multiplication by independent orthogonal matrices preserves the singular values.
This is more flexible than similarity because the orthogonal matrix on the left does not have to be related to the one on the right.
Think About It
Why does changing the orthogonal factors in an SVD leave the singular values unchanged as long as the diagonal matrix Σ stays the same?
Bidiagonal Reduction for the SVD
The additional freedom available for singular values allows a general matrix to be reduced further than a general eigenvalue problem.
Using orthogonal transformations on the left and right, a matrix can be reduced to bidiagonal form. A bidiagonal matrix has nonzero entries only on the main diagonal and one neighboring diagonal, for example:
B=∗000∗∗000∗∗000∗∗.The reduction can be written conceptually as
B=Q1AQ2T,where Q1 and Q2 are orthogonal. Since these transformations preserve singular values, A and B have the same singular values.
The numerical SVD algorithm therefore has two main stages:
- Reduce A to bidiagonal form using orthogonal transformations.
- Apply an iterative method, related in spirit to QR iteration, to the bidiagonal matrix.
The bidiagonal structure makes each later step very fast because most entries are already zero.
The Connection Between Bidiagonal and Tridiagonal Matrices
If B is bidiagonal, then BTB is symmetric tridiagonal. The zero pattern explains this relationship.
For example, each column of B overlaps with only nearby columns. When BT multiplies B, entries far from the main diagonal receive no contributions and become zero. Thus,
BTBhas the pattern
∗∗00∗∗∗00∗∗∗00∗∗.This matches the structure used in symmetric eigenvalue algorithms. In that sense:
- Symmetric eigenvalue computation reduces a matrix to tridiagonal form.
- Singular value computation reduces a matrix to bidiagonal form.
- The square of the singular values corresponds to the eigenvalues of a symmetric tridiagonal matrix associated with the bidiagonal matrix.
The direct bidiagonal approach avoids explicitly forming ATA while retaining the same underlying mathematical relationship.
When Matrices Become Extremely Large: Krylov Methods
The dense QR and SVD algorithms are highly successful for matrices of moderate size, but they become too expensive when the matrix is extremely large. If a matrix has size one million by one million, storing and processing all of its entries may be impossible.
A different strategy is to work in a much smaller subspace. This is the central idea behind Krylov methods.
Start with a vector b and repeatedly multiply by A:
b,Ab,A2b,A3b,…The resulting vectors span a Krylov subspace. After generating, for example, 100 such vectors, the subspace has the form
K100(A,b)=span{b,Ab,A2b,…,A99b}.These vectors may not be orthogonal, so Gram–Schmidt-type procedures are used to create a stable orthonormal basis for the subspace.
A vector in this subspace can be written approximately as
v≈c1b+c2Ab+c3A2b+⋯+c100A99b.The approximation ignores components outside the chosen subspace.
Restricting the Large Matrix
Although A may have one million rows and columns, its action can be studied on the 100-dimensional Krylov subspace. The large eigenvalue problem is then replaced by a much smaller problem involving a 100×100 matrix.
The smaller matrix describes how A acts on the selected subspace. Its eigenvalues provide approximations to some eigenvalues of the original matrix, provided the relevant eigenvectors are well represented inside the Krylov subspace.
This method is especially valuable when:
- The original matrix is sparse.
- Matrix-vector multiplication by A is relatively inexpensive.
- Only a small number of eigenvalues or singular values are needed.
- The full matrix is too large for dense QR methods.
The method does not automatically guarantee that the smallest 100 eigenvalues, or any particular set of eigenvalues, will be captured. Its success depends on how well the chosen starting vector and generated subspace represent the desired eigenvectors.
Krylov methods replace a huge matrix problem with a smaller projected problem built from repeated matrix-vector multiplication.
Think About It
Why might repeated multiplication by A reveal important eigenvector directions even though the entire matrix is never converted to a dense factorization?
How the Methods Fit Together
The main algorithms differ in the quantities they preserve and the forms to which they reduce matrices.
| Problem | Preserved quantity | Initial reduction | Iterative stage |
|---|---|---|---|
| General eigenvalues | Eigenvalues under similarity | Upper Hessenberg form | Shifted QR iteration |
| Symmetric eigenvalues | Eigenvalues under orthogonal similarity | Tridiagonal form | Shifted QR iteration |
| Singular values | Singular values under left/right orthogonal transformations | Bidiagonal form | QR-like iteration |
| Extremely large sparse eigenvalue problem | Approximate eigenvalues in a subspace | Krylov subspace | Small projected eigenvalue problem |
The key computational principle is to create zeros before beginning the iterative work. These zeros reduce the cost of QR factorization and remain useful throughout later iterations.
Comprehensive Review
The QR method begins with a factorization
Ak=QkRkand forms the next matrix as
Ak+1=RkQk.Because
Ak+1=QkTAkQk,the new matrix is similar to the old one and therefore has the same eigenvalues. Repetition generally causes entries below the main diagonal to shrink, so the eigenvalues eventually appear on the diagonal.
A shifted QR step factors
Ak−sI=QkRkand forms
Ak+1=RkQk+sI.The shift moves the temporary eigenvalues by −s, while adding it back restores similarity to the original matrix. A well-chosen shift can greatly accelerate convergence.
For efficiency, a general matrix is first reduced to upper Hessenberg form. A symmetric matrix remains symmetric under orthogonal similarity transformations, so symmetric Hessenberg form becomes tridiagonal. This makes symmetric eigenvalue computations especially efficient.
Singular values are the diagonal entries in
A=UΣVT.They are the square roots of the eigenvalues of ATA, but numerical algorithms avoid explicitly forming ATA. Instead, independent orthogonal transformations on the left and right reduce A to bidiagonal form without changing its singular values.
Finally, when a matrix is too large for dense QR or SVD algorithms, Krylov methods generate a smaller subspace from
b,Ab,A2b,…and solve a reduced eigenvalue problem there. Across all these methods, the central strategy is to preserve the desired spectral information while transforming the matrix into a sparse, structured form that can be processed efficiently.

Ask anything
We've read this whole study set, so questions about it get the best answers.