-
Notifications
You must be signed in to change notification settings - Fork 434
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
Fixes to SCF_TYPE + SCF_SUBTYPE + SCREENING Combinations #3060
base: master
Are you sure you want to change the base?
Fixes to SCF_TYPE + SCF_SUBTYPE + SCREENING Combinations #3060
Conversation
7842220
to
9162453
Compare
psi4/src/psi4/lib3index/dfhelper.cc
Outdated
if (rank) eri[rank] = std::shared_ptr<TwoBodyAOInt>(eri.front()->clone()); | ||
if (rank) { | ||
eri[rank] = std::shared_ptr<TwoBodyAOInt>(eri.front()->clone()); | ||
if (!eri[rank]->initialized()) eri[rank]->initialize_sieve(); |
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.
Does clone
clone the sieve as well? Should one instead first just make sure eri.front()
has been initialized()
?
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.
It should, but I will double check. If it does, your suggestion would be a better implementation than what I did here.
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.
Yeah, it does copy the sieve as well. So I have changed all initialization instances where a clone is involved, to what you suggested!
@@ -68,7 +68,7 @@ LinK::LinK(std::shared_ptr<BasisSet> primary, Options& options) : SplitJK(primar | |||
lr_symmetric_ = true; | |||
|
|||
// set up LinK integral tolerance | |||
if (options["LINK_INTS_TOLERANCE"].has_changed()) { | |||
if (options["LINK_INTS_TOLERANCE"].has_changed() && options.get_str("SCREENING") != "NONE") { | |||
linK_ints_cutoff_ = options.get_double("LINK_INTS_TOLERANCE"); |
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.
what does the cutoff default to?
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.
It defaults to 1e-12 if any SCREENING
other than NONE
is selected; and 0.0 if SCREENING = NONE
.
|
||
/// handle composite methods | ||
} else if (is_composite) { | ||
auto jk = std::make_shared<CompositeJK>(primary, auxiliary, options); | ||
|
||
if (options["INTS_TOLERANCE"].has_changed()) jk->set_cutoff(options.get_double("INTS_TOLERANCE")); |
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 remove this?
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 has been moved into CompositeJK::common_init()
to better account for behavior when SCREENING=NONE
.
c5835b3
to
f9d513d
Compare
f9d513d
to
6d401ef
Compare
9a97a83
to
a4ec5d0
Compare
a4ec5d0
to
8bf8248
Compare
8bf8248
to
4d375d4
Compare
4d375d4
to
8dde823
Compare
Description
This PR changes the code to fix the majority of combinations of
SCF_TYPE
/SCF_SUBTYPE
/SCREENING
keywords which were previously broken.It was discovered that there were a lot of combinations of
SCF_TYPE
,SCF_SUBTYPE
, andSCREENING
keywords (e.g.,SCF_TYPE = {CompositeJK}
withSCREENING = NONE
) that would break upon use, either with an exception or with a hard error such as a segfault. PR #2978 added testing to detect these broken combinations. This PR actually fixes the broken combinations detected through the added test.The most notable change as a result of fixing these issues is the handling of how certain variables within the
TwoBodyAOInt
class are initialized. To enable universal support of JK builds withSCREENING = NONE
, an option has been added to manually call theTwoBodyAOInt::create_sieve_pair_info()
function via the new wrapper functionTwoBodyAOInt::initialize_sieve()
. Multiple JK builds rely on values of variables initialized viacreate_sieve_pair_info()
, andinitialize_sieve()
is now used to initialize the required variables ifSCREENING = NONE
is set. In this way,SCREENING = NONE
can exist with the benefits it provides, while still working with all JK builds. Also, changes are made to ensure that no screening actually occurs in JK builds whenSCREENING
is set toNONE
.In line with the above, some tests have been expanded.
test_comprehensive_jk_screening.py
has been changed to account for theSCF_TYPE
/SCF_SUBTYPE
/SCREENING
combinations that were fixed.test_erisieve.py
has been updated to more thoroughly testSCREENING=NONE
.It is worth noting that, unfortunately,
TwoBodyAOInt::initialize_sieve()
must be defined per integral engine, and so the fixes of this PR only work with Libint2. The issues this PR tries to fix, still persist if Simint is used instead.User API & Changelog headlines
Dev notes & details
TwoBodyAOInt
,initialize_sieve
, which allows for manual initialization of screening variables viacreate_sieve_pair_info()
needed for JK builds.SCF_TYPE
,SCF_SUBTYPE
, andSCREENING
which were broken.test_comprehensive_jk_screening.py
andtest_erisieve.py
test to account for the previously-described fixes.Questions
-[] Should we keep the
initialize_sieve
name? I named it as such, because it is basically a light wrapper to manually callcreate_sieve_pair_info
. But the name of "sieve" might be objectionable.Checklist
Status