ArticleslgStudy

computer science

Lanczos algorithm

Lanczos algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lanczos algorithm rather than just read about it. In short: The Lanczos algorithm is an iterative method devised by Cornelius Lanczos that is an adaptation of power methods to find the m "most useful" (tending towards extreme highest/lowest) eigenvalues and eigenvectors of an n×n Hermitian matrix, where m is often but not necessarily much smaller than n. Although computationally efficient in principle, the method as initially formulated was not useful, due to its numerical i…

Key takeaways

  • Lanczos algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lanczos algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lanczos algorithm from memory before moving on to harder problems.

Reference excerpt

The Lanczos algorithm is an iterative method devised by Cornelius Lanczos that is an adaptation of power methods to find the m "most useful" (tending towards extreme highest/lowest) eigenvalues and eigenvectors of an n×n Hermitian matrix, where m is often but not necessarily much smaller than n. Although computationally efficient in principle, the method as initially formulated was not useful, due to its numerical instability. In 1970, Ojalvo and Newman showed how to make the method numerically stable and applied it to the solution of very large engineering structures subjected to dynamic loading. This was achieved using a method for purifying the Lanczos vectors (i.e. by repeatedly reorthogonalizing each newly generated vector with all previously generated ones) to any degree of accuracy, which when not performed, produced a series of vectors that were highly contaminated by those associated with the lowest natural frequencies. In their original work, these authors also suggested how to select a starting vector (i.e. use a random-number generator to select each element of the starting vector) and suggested an empirically determined method for determining m, the reduced number of vectors (i.e. it should be selected to be approximately 1.5 times the number of accurate eigenvalues desired). Soon thereafter their work was followed by Paige, who also provided an error analysis. In 1988, Ojalvo produced a more detailed history of this algorithm and an efficient eigenvalue error test.

The algorithm Input a Hermitian matrix A of size n×n, and optionally a number of iterations m (as default, let m=n). Strictly speaking, the algorithm does not need access to the explicit matrix, but only a function v↦Av that computes the product of the matrix by an arbitrary vector. This function is called at most m times. Output an n×m matrix V with orthonormal columns and a tridiagonal real symmetric matrix T=V∗AV of size m×m. If m=n, then V is unitary, and A=VTV∗. Warning The Lanczos iteration is prone to numerical instability. When executed in non-exact arithmetic, additional measures (as outlined in later sections) should be taken to ensure validity of the results. Let v1∈ℂn be an arbitrary vector with Euclidean norm 1. Abbreviated initial iteration step: Let w1′=Av1. Let α1=v1∗w1′. Let w1=w1′−α1v1. For j=2,…,m do: Let βj=‖wj−1‖ (also Euclidean norm). If βj≠0, then let vj=wj−1/βj, else pick as vj an arbitrary vector with Euclidean norm 1 that is orthogonal to all of v1,…,vj−1. Let wj′=Avj−βjvj−1. Let αj=vj∗wj′. Let wj=wj′−αjvj. Let V be the matrix with columns v1,…,vm. Let T=(α1β20β2α2β3β3α3⋱⋱⋱βm−1βm−1αm−1βm0βmαm). Note Avj=βj+1vj+1+αjvj+βjvj−1 for 2<j<m. There are in principle four ways to write the iteration procedure. Paige and other works show that the above order of operations is the most numerically stable. In practice the initial vector v1 may be taken as another argument of the procedure, with βj=0 and indicators of numerical imprecision being included as additional loop termination conditions. Not counting the matrix–vector multiplication, each iteration does O(n) arithmetical operations. The matrix–vector multiplication can be done in O(dn) arithmetical operations where d is the average number of nonzero elements in a row. The total complexity is thus O(dmn), or O(dn2) if m=n; the Lanczos algorithm can be very fast for sparse matrices. Schemes for improving numerical stability are typically judged against this high performance. The vectors vj are called Lanczos vectors. The vector wj′ is not used after wj is computed, and the vector wj is not used after vj+1 is computed. Hence one may use the same storage for all three. Likewise, if only the tridiagonal matrix T is sought, then the raw iteration does not need vj−1 after having computed wj, although some schemes for improving the numerical stability would need it later on. Sometimes the subsequent Lanczos vectors are recomputed from v1 when needed.

Application to the eigenproblem The Lanczos algorithm is most often brought up in the context of finding the eigenvalues and eigenvectors of a matrix, but whereas an ordinary diagonalization of a matrix would make eigenvectors and eigenvalues apparent from inspection, the same is not true for the tridiagonalization performed by the Lanczos algorithm; nontrivial additional steps are needed to compute even a single eigenvalue or eigenvector. Nonetheless, applying the Lanczos algorithm is often a significant step forward in computing the eigendecomposition. If λ is an eigenvalue of T, and x its eigenvector (Tx=λx), then y=Vx is a corresponding eigenvector of A with the same eigenvalue: Ay=AVx=VTV∗Vx=VTIx=VTx=V(λx)=λVx=λy. Thus the Lanczos algorithm transforms the eigendecomposition problem for A into the eigendecomposition problem for T.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Lanczos algorithm

Start with the simplest possible case. Write down what Lanczos algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lanczos algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lanczos algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lanczos algorithm

In research
Lanczos algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lanczos algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lanczos algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Numerical linear algebra, so understanding it makes those chapters shorter.
In everyday life
Look for Lanczos algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Lanczos algorithm” →

How to study Lanczos algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lanczos algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lanczos algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lanczos algorithm in simple terms?

The Lanczos algorithm is an iterative method devised by Cornelius Lanczos that is an adaptation of power methods to find the m "most useful" (tending towards extreme highest/lowest) eigenvalues and eigenvectors of an n×n Hermitian matrix, where m is often but not necessarily much smaller than n. Al…

Why does Lanczos algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lanczos algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lanczos algorithm.

Tags

  • Numerical linear algebra

Keep exploring