Template Function blockLanczos¶
Defined in File Lanczos.hpp
Function Documentation¶
-
template<typename TYPE, typename HilbertField>
bool blockLanczos(TYPE &H, vector<vector<HilbertField>> &phi, vector<matrix<HilbertField>> &A, vector<matrix<HilbertField>> &B, int &M0, bool verb = false)¶ Implementation of the block Lanczos method.
Block Lanczos method. Builds a block-tridiagonal projection of H onto the Krylov subspace generated by the starting block phi.
The block three-term recurrence is: H Q_j = Q_{j-1} B_{j-1}^H + Q_j A_j + Q_{j+1} B_j
where A_j are p×p Hermitian diagonal blocks and B_j are p×p upper-triangular off-diagonal blocks obtained from the QR factorisation of the residual at each step. The block-tridiagonal projected Hamiltonian thus has diagonal blocks A[j] and off-diagonal blocks B[j] (with B[j]^H above the diagonal and B[j] below).
Works for both real (HilbertField=double) and complex (HilbertField=Complex) matrices.
The matrix H is accessed only through H.mult_add(x, y): y += H*x, matching bandLanczos().
Deflation is triggered when a diagonal element of B_j falls below accur_deflation.
Convergence is assessed every p steps by tracking the lowest eigenvalue of the accumulated block-tridiagonal matrix; accur_band_lanczos and max_iter_BL are used.
- Parameters:
H – Object with a mult_add(x, y) method: y += H*x
phi – Starting block of p vectors (each of size dim). Orthonormalized internally; the vectors are not modified on output.
A – Diagonal blocks A[j] (p×p Hermitian matrices, allocated and filled on output).
B – Off-diagonal QR blocks B[j] (p×p upper-triangular matrices, output).
M0 – Maximum number of block Lanczos steps on input; actual number on output.
verb – Verbose flag.
- Returns:
true if the lowest eigenvalue converged within M0 steps, false otherwise.