Lanczos Method
The Lanczos algorithm is an iterative method for finding a subset of eigenvalues and eigenvectors of large sparse matrices. This implementation is a block variant of the standard algorithm, i.e., instead of iterating with single vectors it iterates with blocks of vectors (the standard algorithm can of course be recovered by using blockvectors with block size one).
Additionally, it implements the so-called thick restart variant: when the algorithm has extended the Lanczos basis to the maximum allowed size (as given by the user) it restarts the method using the information contained in the current basis.
Reorthogonalization
Full reorthogonalization is performed at each Lanczos step using a pluggable
strategy, passed as the second template parameter of trl::BlockLanczos
(default: trl::ModifiedGS). Custom strategies must satisfy the
trl::ReorthogonalizationStrategy concept (see Overview of the concepts).
-
struct ModifiedGS
Modified Gram-Schmidt reorthogonalization.
For each basis vector \( v_j \) in turn, projects out its component from \( v \) and updates \( v \) immediately before moving to \( v_{j+1} \).
API Reference
-
template<Eigenproblem EVP, class Reorth = ModifiedGS>
class BlockLanczos Block Lanczos eigensolver with thick restart.
Computes a subset of eigenvalues and eigenvectors of the eigenproblem defined by
EVPusing a restarted block Krylov iteration.- Template Parameters:
EVP – Eigenproblem type satisfying the trl::Eigenproblem concept.
Reorth – Reorthogonalization strategy. Must satisfy trl::ReorthogonalizationStrategy. Defaults to trl::ModifiedGS.
Public Functions
-
inline EigensolverResult solve()
Solves the eigenvalue problem using thick-restart Lanczos.
-
inline auto initial_block()
Get the initial block V_0 for initialization.
The user must initialize this block before calling solve().
-
inline auto &get_basis()
Return the current Lanczos vectors.
-
inline auto &get_T()
Return the block tridiagonal matrix T.
-
inline auto &get_B()
Return the B matrix containing beta values.
-
inline unsigned int get_nconv() const
Return the number of converged eigenvalues.
-
inline unsigned int extend(unsigned int k, unsigned int m)
Extend the Lanczos basis from a step-k block factorisation to a step-m block factorisation.
Note
The parameters k and m are counted in blocks.
- Returns:
The number of operator applications (i.e. the number of calls to evp->apply)