Adds tutorial for using Psi4's SADGuess class
Description
I added Self-Consistent-Field/RHF_libSADGuess.py, which uses Psi4's SADGuess class to produce a SAD Guess. This has been doable since my last PR to Psi4, which included the necessary python bindings. The file includes a toggle which allows one to compare the SAD and CORE guesses.
What are your new additions? Please provide a brief list.
-
New Features
- SAD Guesses
-
Changes
- Adds
Self-Consistent-Field/RHF_libSADGuess.py
- Adds
Any questions for the community?
- This is not a tutorial on how to implement a SAD Guess, merely how to use a Psi4 object. Is this desirable to Psi4numpy?
Status
- [x] Click when ready for review-and-merge
Codecov Report
Merging #36 into master will decrease coverage by
0.16%. The diff coverage is86.81%.
@@ Coverage Diff @@
## master #36 +/- ##
==========================================
- Coverage 94.81% 94.64% -0.17%
==========================================
Files 36 37 +1
Lines 4357 4448 +91
==========================================
+ Hits 4131 4210 +79
- Misses 226 238 +12
| Impacted Files | Coverage Δ | |
|---|---|---|
| Self-Consistent-Field/RHF_libSADGuess.py | 86.81% <86.81%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 4e1d82d...d2b690b. Read the comment docs.
Hmm, I think you will at least need to write out a SAD guess to compare it to. This should very simply however, build a NMO x NMO matrix, put the densities on the diagonal, and your done. You can use scf_e, scf_wfn = psi4.energy("SCF", molecule=atom_mol) to get the densities out of Psi4.
@schiebermc Would really love to get this in. Could you make the minor fixes required to do so?
@dgasmith would you like this comparison to be in a separate file from Self-Consistent-Field/RHF_libSADGuess.py? If not how would you prefer me to organize this?
I think it should be the same file, but instead of doing iterations/normal guesses I would just use the python based SAD machinery to do a comparison. The bulk of the code however, should be towards computing the SAD guess itself.
Basically what you want to do is the very simple:
D = np.zeros((nso, nso))
start = 0
for atom in molecule:
start
scf_e, scf_wfn = psi4.energy("SCF", molecule=atom)
sl = slice(start, start + scf_wfn.nso())
D[sl, sl]] = scf_wfn.Da()
Cocc = partial_cholesky(D)
...
The compare your density and Cocc vs the C++ SAD density. Thats all pseudocode, but should display the basic idea. The idea here is that we show how to compute SAD rather than just how to use the Psi4 python bindings.
Are you planning to work on this? The deadline has technically passed for submissions.
Sorry, I probably will not get to it.