Davidson solver
ElemCo.DavidsonSolver — Module
Davidson solver moduleMain structure
ElemCo.DavidsonSolver.Davidson — Type
Davidson object
Exported functions
ElemCo.DavidsonSolver.add_product_vector! — Function
add_product_vector!(dav::Davidson, prods, state=0, customdots=())Add a product vector for state to Davidson object and update effective Hamiltonian matrix.
customdots() is a Tuple of custom dot-product functions for each tensor in the product vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0.
ElemCo.DavidsonSolver.add_trial_vector! — Function
add_trial_vector!(dav::Davidson, tvecs, state=0, customdots=())Add a trial vector for state to Davidson object and update effective overlap and Hamiltonian matrix.
Note: the trial vector will be normalized and either orthogonalized to the existing trial vectors, or the effective overlap matrix will be updated (in non-hermitian case). customdots is a Tuple of custom dot-product functions for each tensor in the trial vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0.
ElemCo.DavidsonSolver.do_refresh — Method
do_refresh(dav::Davidson, nstates=dav.nstates)Check if Davidson object needs to be refreshed.
The Davidson object needs to be refreshed if the total number of trial vectors after the new iteration will exceed the maximum number of trial vectors times the number of states.
ElemCo.DavidsonSolver.get_current_trial_vector! — Function
get_current_trial_vector!(dav::Davidson, tvecs, state=0)Copy the current trial vector from Davidson object to tvecs. If state > 0, check if the trial vector is for that state.
ElemCo.DavidsonSolver.get_eigenvector! — Method
get_eigenvector!(dav::Davidson, vecs, state)Get eigenvector for state from Davidson object and store it in vecs.
The eigenvector is loaded from the corresponding file.
ElemCo.DavidsonSolver.get_eigenvector — Method
get_eigenvector(dav::Davidson, state)Get eigenvector for state from Davidson object.
The eigenvector is loaded from the corresponding file.
ElemCo.DavidsonSolver.get_residual! — Method
get_residual!(dav::Davidson, vecs, state)Calculate residual for state and store it in vecs.
The residual is calculated as res = H * eigvec - eigval * eigvec. The eigenvector is loaded from the corresponding file.
ElemCo.DavidsonSolver.perform! — Method
perform!(dav::Davidson)Perform Davidson diagonalization of effective Hamiltonian matrix.
Store the eigenvalues and eigenvectors in the Davidson object.
ElemCo.DavidsonSolver.refresh! — Function
refresh!(dav::Davidson, evec, custom_dots=())Refresh Davidson object by resetting the effective Hamiltonian and overlap matrices and adding the eigenvectors as trial vectors.
Internal functions
ElemCo.DavidsonSolver.combine! — Method
combine!(dav::Davidson, outvec, vecfiles, coeffs)Combine vectors from files with coefficients.
outvec is the output vector.
ElemCo.DavidsonSolver.combine — Method
combine(dav::Davidson, vecfiles, coeffs)Combine vectors from files with coefficients.
ElemCo.DavidsonSolver.custom_dot — Function
custom_dot(customdots, tens, vecs, state=0)Compute dot product of vectors using custom dot-product functions customdots::Tuple.
customdots is a Tuple of custom dot-product functions for each tensor in the product vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0. If customdots is empty, the standard dot product is used. vecs are reshaped to the shape of tensors tens.
ElemCo.DavidsonSolver.dav_normalize! — Method
dav_normalize!(vecs, state, customdots)Normalize vectors.
ElemCo.DavidsonSolver.diagonalize — Method
diagonalize(dav::Davidson)Diagonalize effective Hamiltonian matrix.
ElemCo.DavidsonSolver.loadprods — Method
loadprods(dav::Davidson, ipos)Load product vectors from file at position ipos as Vector{Vector{Float64}}.
ElemCo.DavidsonSolver.loadtvecs — Method
loadtvecs(dav::Davidson, ipos)Load trial vectors from file at position ipos as Vector{Vector{Float64}}.
ElemCo.DavidsonSolver.loadvecs — Method
loadvecs(file)Load vectors from file as Vector{Vector{Float64}}.
ElemCo.DavidsonSolver.orthogonalize! — Function
orthogonalize!(dav::Davidson, vecs, state, customdots=())Orthogonalize vectors to trial vectors.
ElemCo.DavidsonSolver.saveeigvecs — Method
saveeigvecs(dav::Davidson, vecs, state)Save eigenvectors to file for state.
ElemCo.DavidsonSolver.saveprods — Method
saveprods(dav::Davidson, vecs)Save vectors to next file.
ElemCo.DavidsonSolver.savetvecs — Method
savetvecs(dav::Davidson, vecs, state)Save trial vectors to next file and store state index.
ElemCo.DavidsonSolver.update_Heff! — Function
update_Heff!(dav::Davidson, prods, state, customdots=())Update effective Hamiltonian matrix.
prods are product vectors (for one state) for the current iteration of Davidson algorithm (stored at dav.nDim+1 position). customdots is a Tuple of custom dot-product functions for each tensor in the product vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0.
ElemCo.DavidsonSolver.update_Heff_dagger! — Function
update_Heff_dagger!(dav::Davidson, tvecs, state, customdots=())Update effective Hamiltonian matrix (transpose, for non-hermitian problems).
tvecs are trial vectors (for one state) for the current iteration of Davidson algorithm (stored at dav.nDimTrial+1 position). customdots is a Tuple of custom dot-product functions for each tensor in the product and trial vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0.
ElemCo.DavidsonSolver.update_Seff! — Function
update_Seff!(dav::Davidson, tvecs, state, customdots=())Update effective overlap matrix.
tvecs are trial vectors (for one state) for the current iteration of Davidson algorithm (stored at dav.nDimTrial+1 position). customdots is a Tuple of custom dot-product functions for each tensor in the trial vector of the form f(tvec, prod, state) or f(tvec, prod) for state=0.
ElemCo.DavidsonSolver.use_overlap — Method
use_overlap(dav::Davidson)Check if smat is used.