-
Notifications
You must be signed in to change notification settings - Fork 438
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
dfocc: canonical uhf df/cd ccsd/(t)/(at) E/G #2739
Conversation
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.
Very initial comments for today:
@@ -374,7 +374,24 @@ Starting in v1.4, MP2.5 and MP3 default to the density-fit algorithm. Set |globa | |||
|
|||
Publications resulting from the use of the non-OO CC codes should cite the following publications: | |||
|
|||
* **REMP** [Behnle:2019:REMP]_, [Behnle:2022:OREMP] | |||
* **MP2** [Bozkaya:2011:omp2]_, [Bozkaya:2013:omp2grad]_, and [Bozkaya:2014:dfomp2grad]_ |
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 would much rather we separate out the DF and the non-DF implementations. A paper using conventional OMP2 has no business citing the DF-OMP2 paper. That'll just confuse people following citations.
@@ -1043,6 +1055,12 @@ def select_ccsd_at_(name, **kwargs): | |||
if mtd_type == 'CONV': | |||
if module in ['', 'MRCC'] and which("dmrcc", return_bool=True): | |||
func = run_mrcc | |||
elif mtd_type == "DF": | |||
if module in ["OCC"]: # SOON "", |
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.
As in, soon this will be ["OCC", ""]? Why?
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 is the "semi-disabling". By not having ["", "OCC"]
, the naive input set reference uhf; set cc_type df; energy("a-ccsd(t)")
won't run and you won't be maddened by worse-than-conventional-CC scaling. However, if you're determined to try the code, it is accessible by adding a set qc_module occ
.
SharedTensor2d K, T, U, Tau; | ||
|
||
// OO block | ||
// F_mi = (1-\delta_{mi}) f_mi |
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.
Why is the definition of the F
intermediate changing? What other parts of the code have to change, even in the restricted case, in order for the restricted code to give the same results as before?
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 bet it's preparation for frozen virtual and fno. @bozkaya ?
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.
Looking at this again, this term is zero for canonical orbitals. Presumably, this term is in the full equations but was neglected previously.
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.
The chunk for today. Includes a new question for the original code authors.
@@ -47,6 +47,7 @@ markers = | |||
dfccsd-grad | |||
dfccsd-t-grad | |||
dfccsd | |||
dfccsdt-grad |
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 change exposes an inconsistency in pytest.ini
:
Just two lines above, dfccsd-t-grad
is defined, but dfccsdt
is also defined. Let's be consistent about which we pick. I prefer dfccsd-t
. For good measure, let's have dfccsdat
be synchronized as to hyphen-or-not, 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.
The markers are definitely a mess, mostly because they're a mirror of CTest markers that are also haphazard. A difference is that ctest -L
matches partial markers but pytest -m
requires full match. If we do try to reform markers, there's also https://github.com/psi4/psi4/blob/master/psi4/driver/p4util/exceptions.py#L490-L496 as standard transformation. The test names in stdsuite use this.
psi4/src/psi4/dfocc/ccd_W_intr.cc
Outdated
W.reset(); | ||
Tau.reset(); | ||
T2new->write_anti_symm(psio_, PSIF_DFOCC_AMPS); | ||
T2new.reset(); |
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.
T2new.reset(); |
Shared pointers are cleared immediately upon leaving scope: this serves no purpose.
// F(m,i) += (1-kronDelta(m,i)) f(m,i) | ||
for(int m=0; m<naoccB; ++m) { | ||
for(int i=0; i<naoccB; ++i) { | ||
int mi = (m * naoccB) + i; |
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.
int mi = (m * naoccB) + i; |
// F(A,E) = (1-kronDelta(A,E)) f(A,E) | ||
for(int a=0; a<navirA; ++a) { | ||
for(int e=0; e<navirA; ++e) { | ||
int ae = (a * navirA) + e; |
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.
int ae = (a * navirA) + e; |
SharedTensor2d Tau, T; | ||
|
||
// F(M,I) OO Alpha Block | ||
// F(M,I) = (1-kronDelta(M,I)) f(M,I) + \sum_(E) 0.5*t(I,E)*f(M,E) + \sum_(Q) tQ*b(Q,MI) + \sum_(Q,E) Tau"(Q,IE)*b(Q,ME) |
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.
Make this file consistent on delta
vs kronDelta
, and on whether the overall F is defined before each piece is. This is inconsistent between the restricted and unrestricted parts, at present.
// F(a,e) = (1-kronDelta(a,e)) f(a,e) | ||
for(int a=0; a<navirB; ++a) { | ||
for(int e=0; e<navirB; ++e) { | ||
int ae = (a * navirB) + e; |
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.
int ae = (a * navirB) + e; |
SharedTensor2d T2, Tau, T2new; | ||
|
||
// W_MNIJ Alpha Block | ||
// W_MNIJ = <MN||IJ> + \sum_(EF) T(IJ,EF) * <MN|EF> |
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.
Once again, the new code includes a comment defining the quantity in full, but the older restricted code includes a comment describing each line. (In other words, where is the restricted code's counterpart to l. 165? I can find its counterpart to 166.)
@bozkaya, how much of this is deliberate? Is this a new code style that you're introducing, but not wanting to change all the code right away?
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.
The major sticking point here is that I need to know the source for all these references.
SharedTensor2d K, T, U, Tau; | ||
|
||
// OO block | ||
// F_mi = (1-\delta_{mi}) f_mi |
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.
Looking at this again, this term is zero for canonical orbitals. Presumably, this term is in the full equations but was neglected previously.
// DIIS | ||
SharedTensor2d RAA, LAA, RBB, LBB, RAB, LAB, LA, LB; | ||
|
||
// RAA |
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.
Remove the extra indent.
@@ -0,0 +1,31 @@ | |||
#! DF-CCSD cc-pVDZ gradient for the NH molecule. | |||
|
|||
ref = psi4.Matrix.from_list([ #TEST |
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 need sources for all these references.
…) E, cd-ccsd E, cd-ccsd(t) E, cd-a-ccsd(t) E
… update docs tables.
Co-authored-by: Jonathon Misiewicz <[email protected]>
Description
Finally, the first of @bozkaya's new methods. These are the canonical (non-orbital-optimized, non-FNO) CC methods with UHF reference by density-fitting and Cholesky decomposition. Gradients available for the most popular methods.
This is PR No. 5 in the mega-dfocc-remp series.
User API & Changelog headlines
set qc_module occ
) until further optimized)set qc_module occ
) until further optimized)set qc_module occ
) until further optimized)set qc_module occ
) until further optimized)Dev notes & details
new
passREVISED 25 Oct
Checklist
Status