Skip to content

Conversation

davpoolechem
Copy link
Contributor

@davpoolechem davpoolechem commented Apr 28, 2023

Description

This PR is something of an independent project, although it is also a precursor of the continuation of #2695, as agreed upon by discussion there.

This PR completely eliminates the ERISieve class, and replaces all of its old functionalities with that of TwoBodyAOInt. ERISieve is a class in libmints that does many of the same things as TwoBodyAOInt. The amount of features that ERISieve has, that TwoBodyAOInt doesn't, is minimal. It's really just absolute redundancy. Currently, ERISieve only finds use within the PKJK class and its subalgorithms.

As mentioned, this PR eliminates ERISieve and replaces it with TwoBodyAOInt in all of the former's previous use cases. Any previously-utilized functionality that was present in ERISieve and not in TwoBodyAOInt (a couple functions determining basis function significance) were added to TwoBodyAOInt. Furthermore, any adjustments needed to support TwoBodyAOInt within the PKJK code were made.

With all of this, ERISieve was also ripped out of the code entirely. Maybe it could go into the attic.

User API & Changelog headlines

  • The core.ERISieve class has been removed, along with its associated functions core.ERISieve.build and core.ERISieve.shell_significant. The removed functionalities, specifically shell_significant, can be accessed via the construction of a TwoBodyAOInt object.

Dev notes & details

  • The ERISieve class in libmints has been removed from Psi4 and replaced with TwoBodyAOInt.
  • Functionalities in ERISieve that were not in TwoBodyAOInt and were required in the code, were added to TwoBodyAOInt.
  • The PKJK files have been adjusted as necessary to support the use of TwoBodyAOInt.

TODO

  • Remove ERISieve from all other external plugins (currently focusing on v2rdm_casscf).

Questions

  • I guess ERISieve can go into the attic now?

Checklist

Status

  • Ready for review
  • Ready for merge

Copy link
Contributor

@TiborGY TiborGY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a formality in this case, but marking arguments that are not modified in the function const is good practice.

@davpoolechem
Copy link
Contributor Author

davpoolechem commented Apr 28, 2023

Ah, so it seems I made a mistake in my assumptions. The failed CI tells me this:

/home/runner/work/psi4/psi4/objdir/external/downstream/v2rdm_casscf/v2rdm_casscf_external-prefix/src/v2rdm_casscf_external/threeindexintegrals.cc:33:10: fatal error: psi4/libmints/sieve.h: No such file or directory #include <psi4/libmints/sieve.h>

It seems that PKJK is, in fact, not the only place that uses ERISieve. This v2rdm_casscf plugin does, as well.

@loriab
Copy link
Member

loriab commented Apr 28, 2023

v2rdm strikes again! :-)

fwiw, the original author (DePrince) isn't dedicated to preserving the plugin, but it's handy for catching things that may affect downstream users. Right now we're pulling from https://github.com/loriab/v2rdm_casscf/tree/v2rdm8, so if you want to PR a switchout of ERISeive to there for post-1.8, that'd be fine. In any case, it might be worth getting in a deprecation warning now for v1.8 on ERISeive.

@davpoolechem
Copy link
Contributor Author

davpoolechem commented Apr 28, 2023

v2rdm strikes again! :-)

fwiw, the original author (DePrince) isn't dedicated to preserving the plugin, but it's handy for catching things that may affect downstream users. Right now we're pulling from https://github.com/loriab/v2rdm_casscf/tree/v2rdm8, so if you want to PR a switchout of ERISeive to there for post-1.8, that'd be fine. In any case, it might be worth getting in a deprecation warning now for v1.8 on ERISeive.

Thank you for the heads-up on this! I'll work on getting rid of ERISieve there, as well, and deprecate ERISieve here for 1.8. With this PR being connected to v2rdm_casscf, it'd probably be wise to make this PR post-1.8.

@loriab loriab added this to the Psi4 1.9 milestone Apr 28, 2023
@davpoolechem davpoolechem mentioned this pull request Apr 28, 2023
11 tasks
@davpoolechem
Copy link
Contributor Author

I just put up #2935 to deprecate ERISieve. That one should go in before this one.

@davpoolechem
Copy link
Contributor Author

I officially opened up a PR for v2rdm_casscf, at loriab/v2rdm_casscf#5, which removes ERISieve from v2rdm_casscf and replaces it with TwoBodyAOInt. Once that is added in, we can progress with this PR, as that is the current bottleneck preventing this PR from passing CI testing. Ideally, there's no fun surprises after that.

@davpoolechem
Copy link
Contributor Author

davpoolechem commented May 25, 2023

All right, the necessary v2rdm_casscf changes have been made and incorporated into this PR. So, the review process can proceed!

category=FutureWarning,
stacklevel=2)

return core.ERISieve(orbital_basis, cutoff, do_csam)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could raise an UpgradeHelper build-48s/src/lib/libint/library-prefix/src/library-build/src/configuration.cc saying how to replace this instead of deleting completely. that is, instead of warning and continuing, it stops with advice. up to you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helps if I send a link to the code rather than a path on my local machine :-)

raise UpgradeHelper(key.upper(), key.upper()[:-2], 1.6, " Note the Debye -> a.u. units change.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a pretty good idea! I will give it a look.

Copy link
Contributor Author

@davpoolechem davpoolechem May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I do have a version of the code that raises an UpgradeHelper for calling core.ERISieve.build instead of deleting ERISieve completely, at https://github.com/davpoolechem/psi4/tree/dpoole34/erisieve-upgrade-helper. That is probably better from an API maintenance approach than simply deleting ERISieve, but we would probably want to close down this PR and push the other branch instead if we wanted the UpgradeHelper approach. Which is totally fine by me, to be honest!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, new PR is fine. or you could push your alternate branch to this PR's remote branch and continue here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking a new PR would be easier, so I will likely do that.

@davpoolechem davpoolechem mentioned this pull request May 31, 2023
9 tasks
@davpoolechem
Copy link
Contributor Author

Closing this one up in favor of #2974.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants