Davidson works when doubles folding in ADC(2) #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement a modified Davidson procedure for doubles-folding. It solves pseudo-eigenvalue problem ωi ui = A(ωi) ui, where A(ωi) is an effective ADC matrix which depends on the eigenvalue ωi. The modified procedure is based on the implementation stated in the paper ( J. Chem. Phys. 158, 124121 (2023)).
The algorithm consists of state-specific macro and micro iterations and further DIIS acceleration. Micro-iterations use Davidson iterations to diagonalize the effective matrix Aeff(ωi) with the fixed eigenvalue ωi, giving a new eigenvalue ω'i. After convergence, a new macro-iteration begins with the effective matrix Aeff(ω'i) . This process continues until the eigenvectors meet a threshold (default=1e-3), after which DIIS further converges the individual roots.
NB: This procedure only works for single excitations.
Changes:
New functions named
“davidson_folded_DIIS“
and“eigsh_folded”
are added, which implements the main procedure of the modified Davidson method. It consists of loops for macro iterations, in which thedavidson_iterations
are performed as micro iterations, and loops for DIIS iterations.Changes in function
“davidson_iterations”
:ω0i - ω1i > ωn-1i - ωni , where ω0i is the initial guess of ωi and ωni is the Ritz value of the current micro iteration.
Add new Class
DIIS
to implement diis acceleration.There are two new Classes: Class
FoldedDavidsonState
inherits from ClassDavidsonState
and contains more properties about theDavidsonState
in doubles-folding case; ClassDIIS
is used when performing extrapolation on the corrected vector.Add new properties for Class
DavidsonState
: “folded” is the flag to distinguish normal or modified davidson procedures when running“davidson_iterations”
, and “DIIS_iter” sums the total number of performed DIIS iterations for all required states.In the function
“default_print”
, there are new identifiers for the folding case.In the file “AdcMatrix.py”, the matrix-vector product of the folded ADC matrix with singles component is defined in the new Class
AdcMatrixFolded
.Workflow - two options of guesses vector in doubles-folding case:
guesses_fold = “adc1”
, which takes adc1 results (excitation_vector and excitation_energy_uncorrected) as initial guess vectors and guess eigenvalues.Or obtaining guess vectors by inspecting the diagonal matrix elements as default.
Testing:
test_davidson_folded.py: testing davidson_folded_DIIS in two cases of given guesses and taking guesses as adc1 results.
test_workflow.py: I added two tests for new parameters “fold”, “guesses_fold” and “omegas”.