-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fundamental changes to GaussianBasis: working with different backends #10
Conversation
Sync to main
…nding on how the basis set object is constructed. By default, basis sets proper for Libcint are created, but ACSint will be the fall back strategy for when the code cant find a specific dispatch.
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.
Assuming you will fix the CI failures, this looks good. Nate has done more with GaussianBasis and so he will probably have more to say than I do.
These changes won't have a drastic effect on the SALC code. I have no concerns! |
Codecov Report
@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 80.67% 80.92% +0.25%
==========================================
Files 14 16 +2
Lines 1164 1499 +335
==========================================
+ Hits 939 1213 +274
- Misses 225 286 +61
Continue to review full report at Codecov.
|
Not a fan of the lapse in CodeCov... |
I will fix it |
As Yall know we have two ways to compute integrals:
Using the fast and efficient C library
libcint
Using the nice and slow Julia code now named
acsint
To make it easier to work with different backends and open up the possibility of adding new ones in the future I modified the basis set and basis functions objects.
Basis Functions
Basis functions now can be two types
CartesianShell
SphericalShell
The fundamental difference being, as you guessed, how angular momentum is treated.
These two concrete types are a subtype of
BasisFunction
. The default isSphericallShell
. If you do something likeA
SphericalShell
is created. To create a cartesian, use the keyword argumentspherical=false
.Another important change is a new field for the
BasisFunction
object calledatom
. That means that now the basis function objects are attached to an atom, not floating around with no center like before. This removes the necessity of having a list of lists representing basis set... which leads us to...BasisSet
There are mainly two changes to the basis set object
the
basis
field is now just a flat array (Vector
) of basis functions. The mapping to atoms is less important now that the fieldatom
has been introduced toBasisFunction
.Those
lc_atm
,lc_env
fields that were specific tolibcint
are now removed. Instead, there is a newstruct
calledIntLib
that will determine which backend is used. So now we haveNotice that all information relevant to
libcint
is saved into this newstruct
, meaning that if we decide to work withACSint
(like Henry and I are) we don't need to worry about those objects. This is important because the data here must be very stype stable otherwise we get those bloody segfaults from a C-call.BasisSet
objects now have the following type signature:So you can define a general (fall-back) function
and a specific one
that will use
libcint
.Integral backends
Standard function call
I create a standard syntax to call integrals. Using overlap as an example you can make the following function calls on a
BasisSet
objectThis last function call is the most basic one and, in general, is the one the will select the backend library based on the
BasisSet
type signature. For example, for the ERI we havewhat now
Since this may affect yall's projects, I want you to look through it before we merge. Leave and questions here and Slack me if needed. Make sure you understand how to get your integrals under this system and also how would you go about coding up a new integral call!