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
Least Squares Tensor Hypercontraction (LS-THC) for ERIs (Part 1) #3157
base: master
Are you sure you want to change the base?
Conversation
Pinging @loriab once again, requesting review |
|
||
// Parrish 2012, Equation 30 | ||
int nremoved = 0; | ||
SharedMatrix S_Qq_inv = S_Qq->pseudoinverse(options_.get_double("LS_THC_S_EPSILON"), nremoved); |
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.
FYI: I've run 10 water molecules 240 AO basis, based on test_thc_eri.py
, and it seems
Matrix->pseudoinverse
bloats memory, more than I would expected.
--------------------------------------------
Least-Squares Tensor Hypercontraction
by Andy Jiang
doi: 10.1063/1.4768233
--------------------------------------------
Detailed LS-THC thresholds and cutoffs:
LS_THC_SPHERICAL_POINTS = 38
LS_THC_RADIAL_POINTS = 8
LS_THC_BASIS_TOLERANCE = 1.000e-12
LS_THC_WEIGHTS_TOLERANCE = 1.000e-12
LS_THC_S_EPSILON = 1.000e-10
Using DF? Yes
Tensor Hypercontraction Complete!
Number of Grid Points (Rank) : 6623 (220 per atom)
Memory Required to Store Exact Integrals : 3.116 [GiB]
Memory Required to Store DF Integrals : 0.181 [GiB]
Memory Required in LS-THC factored form : 0.339 [GiB]
THC completed:
Z_PQ.shape=(6623, 6623)
x1.shape=(6623, 240)
Filename: thc_eri.py
mprof (a rough idea of process memory), after 100s
mark in mprof memory is due to 3-idx AO and einsums.
memray flamegraph (.tar.gz), seems to point into Matrix.pseudoinverse
and subsequent svd.
I know it's a Part 1, nevertheless I wanted to share what I found.
Very good job anyway on adding THC into the Psi4 stack! Can't wait to try it out more, for prototyping!
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.
@PhillCli Thank you for your tests and for going above and beyond! I will definitely look into improving the memory footprint! One possible solution is to use truncated SVD for the pseudoinverse (algorithm available in @jturney 's Einsums). I will look into this further once einsums is fully merged with Psi4.
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 think I can consider myself happy with this! Looking forward to seeing this in action for different methods!
Description
In this PR, we implement a pilot version of least squares tensor hypercontraction (LS-THC)... factoring 4-index ERIs (O(N^4)) into two-index quantities (i.e.$(mn|rs) = x_{m}^{P}x_{n}^{P}Z^{PQ}x_{r}^{Q}x_{s}^{Q}$ ). In the LS-THC formulation, $P$ and $Q$ are derived from grid points, and
This is based off of the work of Parrish et al. (2012)
These quantities can be constructed integral-direct and non-iteratively. No four or even three-index quantities are stored, thereby allowing for the future development of efficient, low-memory quantum chemistry algorithms in Psi.
This is a PR in a series of planned PRs that will involve:
1.) LS-THC-JK (integral-direct SCF without recomputing ERIs every iteration and faster K construction)
2.) LS-THC-MP2
3.) Local grid implementation of LS-THC to allow for use in local correlation methods (DLPNO-MP2, DLPNO-CCSD/(T))
User API & Changelog headlines
Dev notes & details
Questions
Checklist
Status