>> help Herm_band_Lanczos Hermitian band Lanczos method ----------------------------------------------------------------------------- Notes: 1) The band Lanczos method simplifies when A is Hermitian, i.e., A = A^H (= A'), and the blocks of right and left starting vectors are complex conjugate of each other, i.e., L = conj(R). In this case, the right and left Lanczos vectors are complex conjugate of each other: w_k = conj(v_k) for all k. The Hermitian band Lanczos method exploits this fact and generates only the right Lanczos vectors. As a result, the computational costs and the storage requirements of the function "Herm_band_Lanczos" are only roughly half of those of the function "band_Lanczos". 2) The matrices A and R are allowed to be complex. The matrix A is assumed to be Hermitian. 3) The orthogonalizations performed in the algorithm are with respect to the Euclidean inner product (w,v) = w^H v (= w' * v), where w^H (= w') denotes the complex conjugate transpose of w. 4) This algorithm explicitly enforces only the minimum possible amount of orthogonalization. Moreover, only the entries below and on the diagonal of the Hermitian Lanczos matrix T are computed directly via inner products and norms of candidate vectors and previously deflated vectors. ----------------------------------------------------------------------------- Usage: result = Herm_band_Lanczos(A,R,nmax) result = Herm_band_Lanczos(A,R,nmax,sflag) result = Herm_band_Lanczos(A,R,nmax,sflag,tol) result = Herm_band_Lanczos(A,R,nmax,sflag,tol,n,result) where is an Hermitian matrix, or, result = Herm_band_Lanczos(@(x) afun(x,...),R,nmax) result = Herm_band_Lanczos(@(x) afun(x,...),R,nmax,sflag) result = Herm_band_Lanczos(@(x) afun(x,...),R,nmax,sflag,tol) result = Herm_band_Lanczos(@(x) afun(x,...),R,nmax,sflag, ... tol,n,result) where "afun" is a function such that y = afun(x,...) computes the matrix-vector product y = A x (= A * x) with A ----------------------------------------------------------------------------- Required inputs: A = an Hermitian matrix or an (anonymous) function that computes matrix-vector products with A R = matrix the m columns of which are the starting vectors nmax = maximum number of Lanczos vectors to be generated It is assumed that A is an Hermitian matrix and that A and R have the same number of rows; these assumptions are checked when the input A is a matrix, but not when A is a function. ----------------------------------------------------------------------------- Optional inputs: sflag = an integer that controls the storage of the Lanczos vectors: sflag = 0 means that only the vectors needed for the orthogonalization are stored; a nonzero value of sflag means that all vectors are stored tol = a structure that contains tolerances and parameters for the deflation procedure n = a nonnegative integer; n > 0 means that a previous call to the function "Herm_band_Lanczos" has generated n Lanczos vectors and that the current call to "Herm_band_Lanczos" resumes the iteration at step n+1; n = 0 means that the band Hermitian Lanczos method is started from scratch result = the output structure of the previous call to "Herm_band_Lanczos" if n > 0; if n = 0, this input is ignored If sflag is not provided as an input, sflag = 0 is used. If "tol" is provided as an input, it needs to contain tol.defl_tol = unscaled deflation tolerance and values of the following two flags: tol.defl_flag = 0 (use unscaled deflation tolerance) 1 (use scaled deflation tolerance) 2 (use scaled deflation tolerance only for the starting block R) 3 (use scaled deflation tolerance except for the starting block R) tol.normA_flag = 1 (an estimate for the norm of A is generated within the algorithm) 2 (an estimate for the norm of A is provided as tol.normA) If tol.normA_flag = 2, then an estimate for the norm of A needs to be provided as tol.normA If "tol" is not provided as an input, the following default values are used: tol.defl_tol = sqrt(eps) (eps = machine precision) tol.defl_flag = 1 tol.normA_flag = 1 If n is not provided as an input, n = 0 is used. If n > 0, the input "result" needs to be provided. It is assumed, but not checked, that "result" is the output structure of a previous call to the function "Herm_band_Lanczos" (applied to the same matrices A and R). In this case, the inputs "sflag" and "tol" are ignored and tol = result.tol and sflag = result.sflag are used instead. ----------------------------------------------------------------------------- On return, "result" is a structure the fields of which include the following quantities: result.n = number of Lanczos vectors that were generated result.V = matrix V the columns of which are the stored Lanczos vectors; if sflag = 0, V has at most m+1 columns and these columns are the Lanczos vectors that are needed for orthogonalization; if sflag is nonzero, V contains the first n Lanczos vectors result.Vh_defl = matrix Vh_defl the columns of which are the candidate vectors for the next mc Lanczos vectors and the m-mc deflated vectors result.T = the n x n matrix T that represents the orthogonal projection of the matrix A onto the subspace spanned by the columns of V; A, V, and T are connected via the relation V' * A * V = T result.rho = the matrix rho that contains the coefficients used to turn the starting vectors (in R) into the first Lanczos vectors; R, V, and rho are connected via the relation V' * R = rho ----------------------------------------------------------------------------- This routine can be run in incremental fashion. Example 1: result = Herm_band_Lanczos(A,R,nmax0,sflag,tol) n = result.n result = Herm_band_Lanczos(A,R,nmax,sflag,tol,n,result) The first call to the function "Herm_band_Lanczos" runs the Hermitian band Lanczos method from scratch and generates n Lanczos vectors. The second call to the function of "Herm_band_Lanczos" resumes the iteration at step n+1. Example 2 (Hermitian band Lanczos method, run one step at a time): result = Herm_band_Lanczos(A,R,1,sflag,tol,0,[]) for n = 1 : nmax - 1, result = Herm_band_Lanczos(A,R,n+1,[],[],result.n,result) end This will run the Hermitian band Lanczos method for nmax steps. ----------------------------------------------------------------------------- BANDITS: a Matlab Package of Band Krylov Subspace Iterations Copyright (c) 2018-2019 Roland W. Freund See LICENSE.txt for license -----------------------------------------------------------------------------