evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
218 stars 96 forks source link

test solid harmonic ordering runtime switchable #271

Closed loriab closed 7 months ago

loriab commented 10 months ago

~currently atop #270~

closes #225 closes #230

~Downstream testing (still using sss, not ss)~

Downstream testing (now ss-based; mostly dev1 -> dev2; Oct 30)

loriab commented 8 months ago

This is rebased and updated and ready for consideration, I think. I'm glad to make any changes.

loriab commented 8 months ago

I've updated the testing of downstream packaging and psi4 usage with the revised component names. Links are in the last section of the PR frontmatter. I might add a script for the generation of cmake components for the patch (I've been doing it by hand), but that can be a separate PR if this is otherwise in good shape.

evaleev commented 8 months ago

@loriab thank you, this looks great!!! The only thing I would consider changing make the encoding of angular momenta and derivatives into non-eri components more systematic and future-proof by replacing multipole_l -> multipole_ll_dD ... i.e. all compute types can have derivatives, and for all operator set types we can have arbitrary number of centers, e.g. 4-center (1-e) overlaps are useful, although those one can get via the eri route by tweaking the core integrals. Still, would be useful to keep things systematic. What do you think?

loriab commented 8 months ago

Great! I'm all for systematizing and future-proofing the components, but I may not be following the extent of what you're proposing. Were you thinking of <operator>_[<hh>|<HH>|<hhl>|<hhL>|<hhhh>]_d<D> for each operator in https://github.com/evaleev/libint/wiki/using-modern-CPlusPlus-API#create-an-integral-engine ? E.g., eri_* get renamed to coulomb_ and g12_ to cgtg_ (plus getting 2,3,4-center components)?

On one hand, this (a) would make the connection between build configuration arguments and integrals classes provided much clearer, (b) I don't see any limitation on the length of CMake lists, (c) in future, they're all substituted into the l2-config.cmake, so there's no added complexity https://github.com/loriab/libint/blob/new-cmake-2023-take2-b/cmake/libint2-config.cmake.in#L166-L168, and (d) it's especially useful in the libint2::supports function.

On the other hand, for a max-am-eri=5,4,3 (a) there's about 100 components for eri, so that's going to be excessive multiplied by all the operators and (b) there's a lot of redundancy (e.g., --enable-g12 provides cgtg, cgtg_x_coulomb, delcgtg2).

Am I thinking about this right? I don't prefer to have them diverge, but it might be that your proposal is right for l2::supports but not for the cmake components role.

loriab commented 8 months ago

Ok, I'm still not clear on your plan for the non-eri components. But since components aren't being used at all at the moment, perhaps rolling out eri now for a trial and revisiting the full set of non-eri later is ok? To that end, I made some edits so that the present components are consistent with the future expansion.

Does that seem good, or do you want me to alias the operators in l2::supplies (e.g., user queries for yukawa_hh_d0, and fn looks up eri_hh_d0)?

I've added a little generation script for the components. Input is crude, but I didn't want it too fancy since it'll be fed by cmake later on.

I also tweaked some shorderings comments in engine.h

evaleev commented 8 months ago
  • multipole gets 2-center and deriv, so now multipole_hh_dD
  • onebody gets 2-center, so now onebody_hh_dD
  • g12 gets 4-center, so now g12_hhhh_dD

Does that seem good, or do you want me to alias the operators in l2::supplies (e.g., user queries for yukawa_hh_d0, and fn looks up eri_hh_d0)?

probably too much ... this functionality is for experts, who presumably will read the dox. Enough to state in the dox that eri implies general Boys function-based evaluation of integrals over distance-dependent 2-particle interactions and can be used to compute Yukawa, Slater, erf-attenuated Coulomb, etc.

I've added a little generation script for the components. Input is crude, but I didn't want it too fancy since it'll be fed by cmake later on. I also tweaked some shorderings comments in engine.h

Great, thank you!

I'll have one final lookover, but this is good to go in my opinion.

evaleev commented 7 months ago

~weird, the merge master, even though the branch built fine: https://github.com/evaleev/libint/commit/10ca429217977bc2baac78fdaf3ac8d4f8aa05d9~ nvm, code in https://github.com/evaleev/libint/pull/279 needs to be skipped (or updated) if Gaussian solid harmonic ordering is used