Skip to main content

17  The Lanczos Algorithm

When \(\bA\) is real symmetric, the Arnoldi process of the referenced section simplifies in two ways. First, the projected matrix \(\bH_k=\bV_k^T\bA\bV_k\) is symmetric as well as Hessenberg, so it is tridiagonal. Each new basis vector then needs to be orthogonalized only against the two preceding ones, and the cost per step no longer grows with \(k\). Second, the Rayleigh quotient characterization of the referenced result applies to the projected matrix. The characterization shows that the extreme Ritz values are the best estimates of the extreme eigenvalues available from the Krylov subspace.

We first derive the three-term recurrence that defines the Lanczos algorithm (Lanczos 1950). We then show that the extreme Ritz values move monotonically toward the extreme eigenvalues and that they are never worse than the power-iteration estimate obtained with the same number of products. A numerical example compares the two methods. The section ends with the loss of orthogonality that occurs in floating-point arithmetic.

17.1 The Three-Term Recurrence

NoteTheorem: Tridiagonal Projection

Let \(\bA\in\fR^{n\times n}\) be symmetric, and suppose the Arnoldi iteration (the referenced result) completes \(k\) steps. Then \(\bH_k\) is symmetric tridiagonal. Writing \(\alpha_j=h_{jj}\) and \(\beta_j=h_{j+1,j}\), we have \[ \begin{align} \bH_k=\bT_k=\begin{pmatrix} \alpha_1 & \beta_1 & & \\ \beta_1 & \alpha_2 & \ddots & \\ & \ddots & \ddots & \beta_{k-1} \\ & & \beta_{k-1} & \alpha_k \end{pmatrix}, \end{align} \] and the Arnoldi coefficients satisfy \(h_{ij}=0\) for \(i<j-1\) and \(h_{j-1,j}=\beta_{j-1}\).

The Arnoldi matrix has two structural properties.

  1. Since \(\bH_k=\bV_k^T\bA\bV_k\) and \(\bA^T=\bA\), \[ \begin{align} \bH_k^T=(\bV_k^T\bA\bV_k)^T =\bV_k^T\bA^T\bV_k=\bH_k. \end{align} \] Thus \(h_{ij}=h_{ji}\) for every pair of indices.

  2. Arnoldi constructs an upper Hessenberg matrix, so \(h_{ij}=0\) whenever \(i>j+1\).

  3. If \(i<j-1\), then \(j>i+1\). The Hessenberg property applied to entry \((j,i)\) gives \(h_{ji}=0\). Symmetry gives \(h_{ij}=h_{ji}=0\). Hence only the main diagonal and its two immediate neighbors can be nonzero.

  4. The diagonal is \(\alpha_j=h_{jj}\). Arnoldi defines \(h_{j+1,j}=\beta_j\). Symmetry makes \(h_{j,j+1}=\beta_j\) as well. These are exactly the displayed tridiagonal entries, and \(h_{j-1,j}=\beta_{j-1}\).

WarningExercise

Use symmetry directly to explain why \(\bv_i^T\bA\bv_j=0\) for \(i<j-1\): move \(\bA\) to \(\bv_i\) and locate \(\bA\bv_i\) in the earlier Krylov subspace. This gives a second explanation of why the recurrence needs only two previous directions in exact arithmetic.

In the Arnoldi iteration, the coefficient \(h_{ij}\) is the component of \(\bA\bv_j\) along \(\bv_i\). the referenced result shows that these components vanish for \(i<j-1\) in exact arithmetic, so the inner loop of Step 2 reduces to two subtractions. The coefficient for \(i=j-1\) is already known from the previous step. Substituting these facts into the referenced result gives the Lanczos iteration.

NoteDefinition: The Lanczos Iteration

Let \(\bA\in\fR^{n\times n}\) be symmetric and let \(\bv_1\) be a unit vector. Set \(\bv_0=\bzero\) and \(\beta_0=0\). For \(j=1,2,...,k\):

  1. Compute \(\bw=\bA\bv_j-\beta_{j-1}\bv_{j-1}\).

  2. Compute \(\alpha_j=\bv_j^T\bw\) and update \(\bw\leftarrow\bw-\alpha_j\bv_j\).

  3. Compute \(\beta_j=\|\bw\|_2\).

  4. If \(\beta_j=0\), stop. Otherwise, set \(\bv_{j+1}=\bw/\beta_j\).

NoteCorollary: The Lanczos Relation

After \(k\) steps of the Lanczos iteration without breakdown, the matrix \(\bV_k=(\bv_1\ \cdots\ \bv_k)\) has orthonormal columns spanning \(\mathcal{K}_k(\bA,\bv_1)\), and \[ \begin{align} \bA\bV_k=\bV_k\bT_k+\beta_k\bv_{k+1}\be_k^T, \qquad \bT_k=\bV_k^T\bA\bV_k. \end{align} \]

Compare one Lanczos step with the corresponding Arnoldi column equation. For a symmetric matrix, the preceding theorem makes that equation \[ \begin{align} \bA\bv_j=\beta_{j-1}\bv_{j-1}+\alpha_j\bv_j+\beta_j\bv_{j+1}. \end{align} \] Every earlier coefficient is zero in exact arithmetic. Subtracting the first two terms from \(\bA\bv_j\), then normalizing the remainder, is exactly the Lanczos recurrence. Thus, from the same starting vector and positive normalization by a norm, the two processes generate the same basis vectors until termination.

The Arnoldi theorem consequently supplies orthonormality and the Krylov span. To see the matrix identity directly, place the first \(k\) three-term equations side by side. The first \(k\) components form \(\bV_k\bT_k\). The only term outside these columns comes from the last equation, giving \[ \begin{align} \bA\bV_k=\bV_k\bT_k+\beta_k\bv_{k+1}\be_k^T. \end{align} \] Multiplication by \(\bV_k^T\) makes the last term vanish and gives \(\bV_k^T\bA\bV_k=\bT_k\). The use of exact arithmetic matters: omitted coefficients may become nonzero under rounding.

WarningExercise

Carry out two steps of the Lanczos iteration by hand for \(\bA=\operatorname{diag}(4,2,1)\) and \(\bv_1=(1,1,1)^T/\sqrt{3}\). Write down \(\alpha_1\), \(\beta_1\), \(\alpha_2\), and \(\bT_2\), and compute \(\beta_2\).

TipRemark

(Lanczos cost) In exact arithmetic, each step requires one product with \(\bA\) and \(O(n)\) further operations, independent of \(k\). Reorthogonalization in floating-point arithmetic adds work and may require storing the earlier vectors. If only eigenvalues are wanted, the iteration needs to keep just \(\bv_{j-1}\), \(\bv_j\), and the scalars \(\alpha_j,\beta_j\). If Ritz vectors are also wanted, we either store \(\bV_k\) or run the recurrence a second time to form \(\bV_k\bs\).

17.2 Rayleigh–Ritz Approximation

The Ritz pairs of the referenced result are now the eigenpairs of the symmetric tridiagonal matrix \(\bT_k\), so the Ritz values are real. the referenced result gives their residuals as \(\beta_k|s_k|\). Symmetry also lets us say how good the Ritz values are. Throughout, let \(\lambda_1\leq\cdots\leq\lambda_n\) be the eigenvalues of \(\bA\) and let \(\theta_1^{(k)}\leq\cdots\leq\theta_k^{(k)}\) be the eigenvalues of \(\bT_k\).

NoteTheorem: Rayleigh–Ritz Optimality

Let \(R(\bx)=\bx^T\bA\bx/\bx^T\bx\). The extreme Ritz values are the extreme values of the Rayleigh quotient over the Krylov subspace, \[ \begin{align} \theta_k^{(k)}=\max_{\bx\in\mathcal{K}_k,\,\bx\neq\bzero}R(\bx), \qquad \theta_1^{(k)}=\min_{\bx\in\mathcal{K}_k,\,\bx\neq\bzero}R(\bx). \end{align} \] Consequently, \(\lambda_1\leq\theta_1^{(k)}\) and \(\theta_k^{(k)}\leq\lambda_n\).

We compare two Rayleigh quotients by writing the same vector in two coordinate systems.

  1. Since the columns of \(\bV_k\) are an orthonormal basis of \(\mathcal K_k\), each \(\bx\in\mathcal K_k\) has a unique representation \(\bx=\bV_k\by\). It is nonzero precisely when \(\by\neq\bzero\), because \(\|\bV_k\by\|_2=\|\by\|_2\).

  2. Direct substitution gives \[ \begin{align} \bx^T\bx&=\by^T\bV_k^T\bV_k\by=\by^T\by,\\ \bx^T\bA\bx&=\by^T(\bV_k^T\bA\bV_k)\by=\by^T\bT_k\by. \end{align} \] Hence \(R(\bx)=\by^T\bT_k\by/(\by^T\by)\).

  3. Expand \(\by\) in an orthonormal eigenbasis of the symmetric matrix \(\bT_k\). Its quotient is a weighted average of the Ritz values. Its minimum is \(\theta_1^{(k)}\) and maximum is \(\theta_k^{(k)}\), attained at the corresponding eigenvectors. The parametrization in the first step ranges over the whole Krylov space, so these are exactly the extrema claimed there.

  4. The Rayleigh quotient of \(\bA\) is between \(\lambda_1\) and \(\lambda_n\) on every nonzero vector. Restricting the vectors to a subspace cannot move the minimum below \(\lambda_1\) or the maximum above \(\lambda_n\). Thus \(\lambda_1\leq\theta_1^{(k)}\) and \(\theta_k^{(k)}\leq\lambda_n\).

NoteCorollary: Monotone Convergence of the Extreme Ritz Values

The Ritz values at consecutive steps interlace, \[ \begin{align} \theta_i^{(k+1)}\leq\theta_i^{(k)}\leq\theta_{i+1}^{(k+1)}, \qquad i=1,...,k. \end{align} \] In particular, \(\theta_k^{(k)}\) is nondecreasing and bounded above by \(\lambda_n\), and \(\theta_1^{(k)}\) is nonincreasing and bounded below by \(\lambda_1\). They reach the extreme eigenvalues represented in the starting vector when the corresponding invariant Krylov subspace is exhausted. Reaching \(\lambda_n\) or \(\lambda_1\) requires a nonzero starting component in its eigenspace.

WarningExercise

Apply Cauchy interlacing to \(\bT_k\) as a principal submatrix of \(\bT_{k+1}\). Deduce monotonicity of the two extreme Ritz values. Does monotonicity alone show that their limits are the extreme eigenvalues of \(\bA\)? Examine a starting vector orthogonal to an extreme eigenspace.

WarningExercise

For \(\bT_2\) from the previous exercise, compute both Ritz values and their residuals using the referenced result. Verify the interlacing inequalities of the referenced result between the Ritz value \(\theta_1^{(1)}=\alpha_1\), the two eigenvalues of \(\bT_2\), and the eigenvalues of \(\bA\).

NoteCorollary: Lanczos Improves on Power Iteration

Let \(\bA\) be symmetric positive definite, and let \(\lambda^{(k-1)}\) be the Rayleigh quotient estimate of the referenced result after \(k-1\) power steps from \(\bv^{(0)}=\bv_1\). Both \(\lambda^{(k-1)}\) and \(\theta_k^{(k)}\) require \(k\) products with \(\bA\), and \[ \begin{align} \lambda^{(k-1)}\leq\theta_k^{(k)}\leq\lambda_n. \end{align} \]

After \(k-1\) normalized power steps, the vector \(\bv^{(k-1)}\) is a nonzero scalar multiple of \(\bA^{k-1}\bv_1\). This follows by induction, since normalizing after each multiplication changes only a scalar factor. Therefore it belongs to \(\mathcal K_k\).

The Rayleigh–Ritz theorem maximizes the Rayleigh quotient over every nonzero vector in this space. The power iterate is one candidate, so \[ \begin{align} \lambda^{(k-1)}=R(\bv^{(k-1)}) \leq\max_{\bx\in\mathcal K_k\setminus\{\bzero\}}R(\bx) =\theta_k^{(k)}\leq\lambda_n. \end{align} \] Each comparison concerns the same initial vector and the same matrix.

For the product count, \(k-1\) multiplications form the power iterate. Computing its Rayleigh quotient requires one more product with \(\bA\). Thus the quoted power estimate uses \(k\) products. Lanczos uses one product in each of \(k\) steps and obtains \(\bT_k\) from those products. Its largest eigenvalue needs no further product with \(\bA\).

Positive definiteness ensures all eigenvalues are positive. Hence the eigenvalue of largest magnitude targeted by power iteration is the largest algebraic eigenvalue \(\lambda_n\), the same endpoint being estimated by the largest Ritz value.

The polynomial form of the referenced result explains the size of the improvement. Every vector in \(\mathcal{K}_k\) is \(p(\bA)\bv_1\) for some \(p\in\mathcal{P}_{k-1}\). Expanding \(\bv_1=\sum_i c_i\bq_i\) in the eigenvectors of \(\bA\) gives \[ \begin{align} \theta_k^{(k)}=\max_{p\in\mathcal{P}_{k-1}}R(p(\bA)\bv_1) =\max_{p\in\mathcal{P}_{k-1}}\frac{\sum_{i=1}^n\lambda_i\,p(\lambda_i)^2c_i^2}{\sum_{i=1}^n p(\lambda_i)^2c_i^2}. \end{align} \] The quotient is close to \(\lambda_n\) when \(p\) is large at \(\lambda_n\) and small on the rest of the spectrum. Power iteration is restricted to \(p(t)=t^{k-1}\), which separates \(\lambda_n\) from \(\lambda_{n-1}\) only by the factor \((\lambda_{n-1}/\lambda_n)^{k-1}\). Lanczos implicitly selects the best polynomial. A shifted Chebyshev polynomial, which is bounded by one on \([\lambda_1,\lambda_{n-1}]\) and grows rapidly outside it, gives the following bound.

TipRemark

(Kaniel–Paige bound) Assume \(\lambda_n>\lambda_{n-1}>\lambda_1\) and \(\bv_1^T\bq_n\neq0\). Let \(\phi\in[0,\pi/2)\) be the acute angle between \(\bv_1\) and the eigenvector \(\bq_n\), let \(\gamma=(\lambda_n-\lambda_{n-1})/(\lambda_{n-1}-\lambda_1)\), and let \(T_m(x)=\cosh(m\operatorname{arccosh}x)\) for \(x\geq1\). Then \[ \begin{align} 0\leq\lambda_n-\theta_k^{(k)}\leq(\lambda_n-\lambda_1)\left(\frac{\tan\phi}{T_{k-1}(1+2\gamma)}\right)^2. \end{align} \] A proof is given by Golub and Van Loan (Golub and Van Loan 2013). Since \(T_m(1+2\gamma)\) grows roughly like \((1+2\sqrt{\gamma})^m\) when \(\gamma\) is small, the error decreases geometrically at a rate set by the square root of the relative gap. A square root of the same kind appears in the conjugate gradient bound of the referenced result. The analogous bound for \(\theta_1^{(k)}\) follows by applying the result to \(-\bA\). Interior eigenvalues admit weaker bounds and converge more slowly, because no low-degree polynomial can be large at an interior point and small on both sides of it.

NoteExample

(Lanczos and power iteration on a model spectrum) Let \(\bA=\operatorname{diag}(1,2,...,100)\) and \(\bv_1=(1,...,1)^T/10\). We run Lanczos with full reorthogonalization, so that the computed Ritz values agree with exact arithmetic to rounding level, and compare the error in the largest Ritz value with the error in the power-iteration estimate after the same number of products.

The relative gap is \(\gamma=1/98\), and the power-iteration ratio is \(\lambda_{99}/\lambda_{100}=0.99\). After 40 products the power-iteration estimate still has an absolute error of about \(0.82\), whereas the largest Ritz value is correct to about eight significant digits. The bound is valid but conservative at every step. By the symmetry of this spectrum about \(50.5\) and of the starting vector, the error in \(\theta_1^{(k)}\) is the same as the error in \(\theta_k^{(k)}\).

At \(k=40\) the residual of the referenced result for the largest Ritz pair is \(3.7\times10^{-3}\), about four orders of magnitude larger than the eigenvalue error. the referenced result explains the difference. The corollary bounds the distance from the Ritz value to the nearest eigenvalue by the squared residual divided by the distance \(\delta\) from the Ritz value to the other eigenvalues. Here \(\delta\) is about one, and the bound \(1.4\times10^{-5}\) is consistent with the observed error.

TipRemark

(Lanczos and conjugate gradients) The conjugate gradient method of the referenced section builds the same Krylov subspace \(\mathcal{K}_k(\bA,\br^{(0)})\) for a symmetric positive definite system. Its residuals are multiples of the Lanczos vectors started from \(\bv_1=\br^{(0)}/\|\br^{(0)}\|_2\), and its coefficients determine the entries of \(\bT_k\). the referenced section derives this correspondence and uses it to estimate the extreme eigenvalues during a CG solve.

17.3 Loss of Orthogonality and Ghost Eigenvalues

the referenced result relies on the exact orthogonality of \(\bv_{j+1}\) to \(\bv_1,...,\bv_{j-2}\). The Lanczos iteration never enforces this orthogonality explicitly, so rounding errors are free to destroy it.

TipRemark

(Paige’s analysis) In floating-point arithmetic, the computed Lanczos vectors gradually lose mutual orthogonality. Paige showed that the loss is not random (Paige 1976). Let \((\theta_i,\tilde{\bu}_i)\) be a Ritz pair computed from \(\bT_k\), and let \(u\) denote the unit roundoff. Paige’s analysis gives \[ \begin{align} \beta_k|s_{k,i}|\,|\tilde{\bu}_i^T\bv_{k+1}|\ \text{has a rounding-error scale of order }u\|\bA\|_2. \end{align} \] The denominator is the residual of the referenced result. This relation describes a rounding-level scale rather than an equality or a universal estimate for each run. The new Lanczos vector can therefore acquire a component along \(\tilde{\bu}_i\) precisely as that Ritz pair converges, and orthogonality is lost in the directions of converged Ritz vectors. Once orthogonality to a converged Ritz vector is lost, the iteration begins to approximate the same eigenvalue again and produces repeated copies of it, known as ghost eigenvalues. The number of such copies and the steps at which they appear depend on rounding and implementation. The experiment below asks you to observe their appearance rather than predict a fixed count.

TipRemark

(Remedies for ghost eigenvalues) Practical implementations use one of three strategies.

  1. Full reorthogonalization. We orthogonalize each new vector against all previous Lanczos vectors. This restores the behavior of exact arithmetic at the Arnoldi cost of \(O(k^2n)\) operations and \(O(kn)\) storage.

  2. Selective reorthogonalization. We orthogonalize only against converged Ritz vectors, and only when Paige’s analysis indicates that orthogonality to them has been lost. The cost is proportional to the number of converged Ritz vectors.

  3. Cullum–Willoughby identification. We run the iteration without reorthogonalization and discard spurious Ritz values afterward by comparing the eigenvalues of \(\bT_k\) with those of the matrix obtained by deleting its first row and column.

17.4 Further Exercises

WarningExercise

Using the referenced result, show that \(\theta_{k-1}^{(k)}=\max_{S}\min_{\bx\in S,\,\bx\neq\bzero}R(\bx)\), where \(S\) ranges over two-dimensional subspaces of \(\mathcal{K}_k\). Conclude that \(\theta_{k-1}^{(k)}\leq\lambda_{n-1}\).

WarningExercise

Let \(\bA\) be symmetric positive definite. Show that the power-iteration estimate satisfies \(\lambda_n-\lambda^{(k-1)}\leq(\lambda_n-\lambda_1)\tan^2\phi\,(\lambda_{n-1}/\lambda_n)^{2(k-1)}\), where \(\phi\) is the angle between \(\bv_1\) and \(\bq_n\). Compare the rate with the Kaniel–Paige bound when \(\gamma\) is small.

WarningExercise

Implement the referenced result with an option for full reorthogonalization. Reproduce the table in the example above, and plot all Ritz values against \(k\) for \(k\leq200\) with and without reorthogonalization. Identify the steps at which ghost copies of \(\lambda_{100}\) appear, and relate them to the step at which the largest Ritz value converged.

WarningExercise

Repeat the previous computation with \(\bA=\operatorname{diag}(1,2,...,99,110)\). Explain, using the polynomial characterization, why the largest Ritz value now converges much faster while the convergence of \(\theta_1^{(k)}\) is essentially unchanged.

NoteFurther reading

Horn and Johnson are a reference for the matrix structure behind the spectral results (Horn and Johnson 2012). The computational treatment in Golub and Van Loan includes symmetric eigensolvers and the SVD (Golub and Van Loan 2013). The original Lanczos and Golub–Kahan papers show how two algorithms in these chapters first appeared (Lanczos 1950; Golub and Kahan 1965).