Davidson solver

Main structure

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.

source
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.

source
ElemCo.DavidsonSolver.do_refreshMethod
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.

source
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.

source
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.

source
ElemCo.DavidsonSolver.perform!Method
perform!(dav::Davidson)

Perform Davidson diagonalization of effective Hamiltonian matrix.

Store the eigenvalues and eigenvectors in the Davidson object.

source
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.

source

Internal functions

ElemCo.DavidsonSolver.custom_dotFunction
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.

source
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.

source
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.

source
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.

source