-
Notifications
You must be signed in to change notification settings - Fork 467
Global diagonalizer cleanup #2642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
TiborGY
wants to merge
70
commits into
psi4:master
Choose a base branch
from
TiborGY:move_ael
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 tasks
This was referenced Aug 10, 2022
…does not actually get used by anything in Psi4
…lize() overload from libmints
…otice. Mark C_DSYEV and C_DSPEV as PSI_API to provide at least some level of replacement.
…sq_rsp(...), also allows error handling
… add check for diagonalizer failure
…EV was successful
…bute.cc, file_build.cc, idx_error.cc, idx_permute.cc and resort_tei.cc
…mmented out for unknown reasons
3 tasks
4 tasks
…f one more fn from Tensor2d
13 tasks
This was referenced Aug 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This veritable scattercannon of a PR needs to be reworked into multiple PRs. Not for merging as is
This PR is a superset of #2637 and breaking it up will commence after that one is merged.
Todos
Deletions
ael.cc
(Approximate Excitation Level, never called and not PSI_API) (merged Remove unused approximate excitation level (AEL) code #2672)Wabei_RHF_FT2_a.cc
(never called and not PSI_API) (merged Remove unused Wabei_RHF_FT2_a function and file #2677)occ
:Array2d::diagonalize
,Array2d::davidson
,Array2d::cdsyev
,Array2d::cdgesv
,Array2d::lineq_flin
,Array2d::lineq_pople
,SymBlockMatrix::davidson
,SymBlockMatrix::diagonalize
,SymBlockMatrix::cdsyev
,SymBlockMatrix::cdgesv
,SymBlockMatrix::lineq_flin
,SymBlockMatrix::lineq_pople
(never called and not PSI_API) (merged Remove unused diagonalizers and linear solvers from occwave::Array2d and occwave::SymBlockMatrix #2679)dfocc
:Array2d::diagonalize, Array2d::davidson, Array2d::cdsyev, Array2d::cdgesv, Array2d::lineq_flin, Array2d::lineq_pople
andTensor2d::davidson, Tensor2d::cdsyev, Tensor2d::cdgesv, Tensor2d::lineq_flin, Tensor2d::lineq_pople
(PR Remove unused diagonalizers and linear solvers from dfoccwave::Tensor2d and dfoccwave::Array2d #2684)libmints
:Matrix::diagonalize
(PR Remove unused and pointer-argumented overloads of Matrix::diagonalize #2693)extern FILE*
and unused#include
s frommcscf::SCF::energy
(PR Remove commented out code from mcscf #2678)New DSYEV wrappers, anti-
sq_rsp(...)
crusadesq_rsp(...)
with. The new wrappers have a much cleaner interface, and no longer require the allocation of an eigenvector array if the caller only needs eigenvalues. They also no longer swallow the return value of DSYEV, in fact their return value is marked as[[nodiscard]]
. In short, checking for diagonalization failure went from impossible to mandatory.sq_rsp(...)
calls inmcscf
(mcscf::SCF::energy
andmcscf::MatrixBase::diagonalize
) with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
calls indetci
(detci/h0block.cc
,detci/sem.cc
anddetci/sem_test.cc
) with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
call inlibmints/matrix.cc
(Matrix::diagonalize
) with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
calls inccenergy
(ccenergy/d1diag.cc
,ccenergy/d2diag.cc
andccenergy/new_d1diag.cc
) with new wrapper. Add checks for diagonalization failure. This allows the removal of the eigenvector array, and the code that allocates/deallocates it.sq_rsp(...)
calls in thelibqt
Davidson solver with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
call in the RHF and ROHF stability checks with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
calls inlibsapt_solver/sapt2.cc
with new wrapper. Add checks for diagonalization failure.sq_rsp(...)
call inpsi4/src/psi4/adc/diagonalize.cc
with new wrapper. Add check for diagonalization failure.sq_rsp(...)
call indfoccwave::Tensor2d::diagonalize
with new wrapper. Add check for diagonalization failure.dfocc
.dfoccwave::Tensor2d::diagonalize
used to take a "diagonalization cutoff" argument, which was passed down tosq_rsp(...)
. This used to be hardcoded to 1E-10, but went completely defunct whensq_rsp(...)
started using DSYEV internally (~forever ago), as LAPACK offers no such parameter to adjust and always diagonalizes down to ~machine precision.New sanity checks
mcscf::MatrixBase::diagonalize
dfoccwave::Tensor2d::diagonalize
libmints/matrix.cc
(Matrix::diagonalize
)libqt
Davidson solver used byadc/prepare_tensors.cc
libqt
Davidson solver as[[nodiscard]]
to force callers to check how many of the requested roots actually converged.Unrelated fixes
Changes to comments, formatting, etc.
adc/diagonalize.cc
andocc/dpd.h
occ/dpd.h
.Matrix::diagonalize
inlibmints/matrix.cc
API and deprecation
rsp(...)
andsq_rsp(...)
asPSI_DEPRECATED
. They are now no longer called anywhere from the C++ codebase, but these are marked asPSI_API
so immediate deletion would be very harsh.C_DSPEV(...)
andC_DSYEV(...)
asPSI_API
, to serve as a potential replacement for the lost functionality. Other LAPACK functions are alreadyPSI_API
, so this should not be any more burden Psi4-side.Archival
ael.cc
to psi4attic (merged Add AEL (approximate excitation level) code psi4attic#1)Wabei_RHF_FT2_a.cc
to psi4atticTODO
Matrix::diagonalize
to only take references, and rework all callers to only pass references, eliminating pointer arguments. May touch:dct/dct_memory.cc
,libmints/cdsalclist.cc
,libmints/molecule.cc
, ...adc/prepare_tensors.cc
is now the only remaining caller of the Davidson solver inlibqt
. It has exactly one call site, and the solver is notPSI_API
. Candidate for future cleanup.Questions
Checklist
Status