-
Notifications
You must be signed in to change notification settings - Fork 475
CompositeJK Part 1.5: DFJLinK/DFJCOSK IncFock Standardization #2792
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
Conversation
|
Something that has been brought to my attention that I should clarify and haven't - the bells and whistles that DFJLinK used to have with its IncFock formalism are still there; this PR does not remove those. Rather, this PR updates DFJLinK's IncFock to be as close to DFJCOSK's IncFock as possible while keeping the bells and whistles. This is also where my first question comes from - would it be good to fully standardize the two by changing DFJCOSK's IncFock in this PR, as well? |
eefaa36 to
a004ba6
Compare
loriab
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm after some whitespace tidying for clarity. Would it be useful to add a check to existing tests of each of the JK classes that can use incfock along the lines of compare(1, variable("SCF ITERATIONS") < 15.0, "incfock efficient")?
Thanks; whitespace issues cleaned up! Regarding the test you suggest, I do think that is a good idea. In principle, if we wanted to measure IncFock efficiency in a test, it might be better measured using a difference in SCF iteration counts between IncFock and corresponding non-IncFock runs, rather than using a raw SCF iteration count for the IncFock run. But none of the tests, as far as I am aware, have both IncFock and non-IncFock runs for the same SCF method executed simultaneously. Your suggested method works with the current tests, and it should still work quite well for testing IncFock efficiency since it will catch any cases where IncFock causes serious convergence issues. I will implement it! |
|
Also, based on your comment, I just took a look at the SCF iteration counts for linK-1, and it seems IncFock now leads to a higher SCF iteration count then it should. I didn't think I touched the DFJLinK bells and whistles, but maybe I accidentally did somewhere along the way. Let me resolve this before merging in this PR. |
|
All right, bug fixed, and IncFock tests added! The new IncFock efficiency tests compare against an SCF ITERATIONS value of x+3, where x is the number of SCF iterations observed in the corresponding non-IncFock run (which also matches the iteration count seen in each output.ref file). I can reduce the 3 component down to something else if desired. |
|
|
||
| void DFJLinK::incfock_setup() { | ||
|
|
||
| // The prev_D_ao_ condition is used to handle stability analysis case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the stability analysis case get checked? I don't know right off if it was attached to any tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just finished checking this, using the linK-1 test as my test case. Using STABILITY_ANALYSIS=CHECK with RHF and ROHF references, the stability analysis runs to completion. However, for STABILITY_ANALYSIS=CHECK with a UHF reference, the calculation segfaults after the SCF iterations converge. As it were, this issue seems to exist with DFJLinK in the base version of Psi4 at the moment, as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking. I think UHF is what @JonathonMisiewicz has moved py-side recently. We can trap the combination if there's not a clean fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that some save_jk flags are needed by the Py-side Davidson tech, and that wasn't properly documented. Based on what David says, that seems unrelated to this PR.
3393728 to
c75c415
Compare
Co-authored-by: Lori A. Burns <[email protected]>
Co-authored-by: Lori A. Burns <[email protected]>
Co-authored-by: Lori A. Burns <[email protected]>
Co-authored-by: Lori A. Burns <[email protected]>
c75c415 to
7a4ff91
Compare
JonathonMisiewicz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving merge rights to @loriab.
Description
This PR is a rather important update to the DFJLinK JK subclass, counting both as the continuation of the CompositeJK development started in #2762 and the first PR in the new incremental Fock build standardization seen in #2682.
To describe the problem, as of now, different integral-direct JK algorithms use different implementations of the incremental Fock build formalism. DirectJK and DFJLinK use the same incremental Fock build formalism, while DFJCOSK uses its own methodology. This introduces two problems:
This PR addresses both of the above issues by changing DFJLinK to use the same incremental Fock formalism as DFJCOSK. Using the DFJCOSK incremental Fock formalism is preferred because DFJCOSK stores fewer matrices in the DFJCOSK class for incremental Fock usage, reducing memory requirements from a practical perspective, and lowering the amount of state contained in DFJLinK from a code design perspective. In standardizing the DFJLinK and DFJCOSK incremental Fock processes, the next CompositeJK PR will be smoother, and CompositeJK development can continue parallel to the developments discussed in #2682. Additionally, this PR serves as a first step the to decomposition of #2682 as discussed in that PR's comments, allowing for the full standardization of IncFock among integral-direct JK subclasses.
For reviewers, since this PR is the bottleneck for two different routes of JK development (CompositeJK and IncFock standardization), it should be considered the highest-priority JK development PR to merge into Psi4 at the moment.
User API & Changelog headlines
N/A
Dev notes & details
Questions
Checklist
Status