Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e25bf1b
Add icenter property to contraction base class
leila-pujal Nov 1, 2023
ad03ab1
Add libcint bindings
msricher Nov 1, 2023
22ddbcc
Make use of icenter attr for libcint binding
msricher Nov 2, 2023
f390b4d
Debugging WIP
msricher Nov 3, 2023
c8e0c56
Expose all attrs (center,charge) required for cint bindings
msricher Nov 6, 2023
5baf381
Get iodata atnums for each shell atomic charge
leila-pujal Nov 7, 2023
b70c61b
Fix CBasis interface; take in at[nums|coords]
msricher Nov 7, 2023
7271c24
Clean up interface (remove _charge), bindings
msricher Nov 9, 2023
d08794b
Follow convention(?) of using elem symbs vs nums
msricher Nov 9, 2023
246aaea
Add proper cache for bound LibCINT functions
msricher Nov 9, 2023
887bff2
Make gbasis-libcint tests match gbasis conventions
msricher Nov 9, 2023
c512db3
Normalize coeffs for LibCInt CBasis binding
msricher Nov 13, 2023
dbe41c2
Add consistency tests for ovlp; UGBS seems to work
msricher Nov 15, 2023
94cee1b
Add icenter property to contraction base class
leila-pujal Nov 1, 2023
7e997b2
Add libcint bindings
msricher Nov 1, 2023
00631b1
Make use of icenter attr for libcint binding
msricher Nov 2, 2023
4df164f
Debugging WIP
msricher Nov 3, 2023
a1de345
Expose all attrs (center,charge) required for cint bindings
msricher Nov 6, 2023
b7dc430
Fix CBasis interface; take in at[nums|coords]
msricher Nov 7, 2023
29992d2
Clean up interface (remove _charge), bindings
msricher Nov 9, 2023
ae999bf
Add proper cache for bound LibCINT functions
msricher Nov 9, 2023
3dd865c
Make gbasis-libcint tests match gbasis conventions
msricher Nov 9, 2023
c56ee16
Normalize coeffs for LibCInt CBasis binding
msricher Nov 13, 2023
c82b730
Add consistency tests for ovlp; UGBS seems to work
msricher Nov 15, 2023
a1492de
Working tests for most basic case, all integrals
msricher Nov 20, 2023
2ca8779
Translate libcint ERI to phys. notation by default
msricher Nov 20, 2023
a57bfa4
Get multiple atomic centers working
msricher Nov 20, 2023
3a6f69b
Seg. contractions run w/o crash; numbers still bad
msricher Nov 22, 2023
9453135
Seg-Contr sort of works; need fixed normalization?
msricher Nov 22, 2023
08be42e
Clean up code; segmented contractions still broken
msricher Nov 22, 2023
08adfc5
Add build script and setup for pkg-local LibCInt
msricher Nov 23, 2023
d0b6b78
Add spher coords,not all work/fix paramtrzed tests
msricher Nov 23, 2023
97698fe
Add function for reordering spherical components
msricher Nov 27, 2023
63eebb9
Add reordering functionality; s, p and d work.
msricher Nov 28, 2023
e91f675
Add cint->gbasis {sph,cart} ordering conventions
msricher Nov 29, 2023
220dd14
Improve build script (cleanup, CMake flags)
msricher Nov 29, 2023
ca735d6
Fix ordering conventions (in C, use PY,PZ,PX)
msricher Dec 1, 2023
2b95248
Fix crash, add sph normalization (still no cart)
msricher Dec 3, 2023
8b120ad
Use new Libcint3 interface; WIP
msricher Dec 3, 2023
6c0b0d0
improve binds (indicate where nullptr can be used)
msricher Dec 3, 2023
820c7d0
Clean up cint3 binds, use regex to assign fn sigs
msricher Dec 4, 2023
8f1775c
Fix ERI ordering. Now ordering is good
msricher Dec 4, 2023
ae15ff8
Add grad/hess/etc capability & fns to Cbasis
msricher Dec 4, 2023
63f2975
Allow arbitrary shape for integral return vals
msricher Dec 5, 2023
fde2e6e
Add more integrals with various origin components
msricher Dec 5, 2023
7fbff96
Add working point charge integrals
msricher Dec 7, 2023
c182af4
Add facilities for auto-generating integrals
msricher Dec 7, 2023
d87fa93
Add cmplx ints incl. momentum (has bad ordering)
msricher Dec 8, 2023
019c62a
Add more integrals
msricher Dec 10, 2023
b487dba
Change grad/hess shape based on libcint docs
msricher Dec 10, 2023
32b1211
Add 2-electron repulsion Hessian
msricher Dec 11, 2023
207d0b8
Make use of allocated CINTOptimizer w/ contextmgr
msricher Dec 11, 2023
1699a9c
Add optimizer for custom point-charge impl.
msricher Dec 11, 2023
e8882eb
Add cartesian normalization
msricher Dec 12, 2023
51b4c9d
Partially fix cart. normaliztion (still some fail)
msricher Dec 12, 2023
96b5af7
Fix momentum integral, complex arrays, slicing
msricher Dec 13, 2023
d84b271
CLean up normalization and point charge fn
msricher Dec 14, 2023
182a27f
Clean up ints, add libcint documentation to readme
msricher Dec 14, 2023
62c3cc5
Fix readme formatting
msricher Dec 14, 2023
7ae851c
Add proper multi-cmpnt normalization of cart ints
msricher Dec 19, 2023
bf2490d
Add more integrals, cleanup auto-gen script
msricher Dec 20, 2023
15ecb37
Add draft impl of moment integral
msricher Dec 20, 2023
fcac2bb
Fix libcint install script for old cmake versions
msricher Jan 10, 2024
d905b4b
Add specific tag to libcint clone
msricher Jan 10, 2024
2a32a1d
Add working moment integral function
msricher Jan 10, 2024
9ddef1e
Add shell offsets by atom for nuclear grads
msricher Jan 11, 2024
7a0ff41
Use x86-optimized qcint by default
msricher Jan 11, 2024
30305f5
Clean up CBasis attr names and add class doc.
msricher Jan 15, 2024
00d4248
Include changes introduced in #140
leila-pujal Jan 15, 2024
f10f3df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 15, 2024
cca6345
Add C library to pyproject data_files
msricher Jan 15, 2024
94d685a
Add NotImplementedError to ang. mom. fn (#149)
msricher Jan 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,7 @@ venv.bak/

# PyCharm
.idea/

# Libcint
gbasis/integrals/lib/
gbasis/integrals/include/
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ git clone https://github.com/theochem/gbasis.git
cd gbasis
pip install --user -e .[dev,iodata]
```
To use `gbasis.integrals.libcint`, the user must run the following script to build
and install `libcint` into the `gbasis/integrals` directory,
```bash
tools/install_libcint.sh
```
This script depends on the following packages:
* CMake
* Git
* Python 3
* a C compiler (gcc or clang are recommended)
* a Common Lisp interpreter (sbcl or clisp are recommended)
By default, the x86-optimized `qcint` package is used for `libcint`.
If this doesn't work on your computer, then run the script with the environment
variable `USE_LIBCINT=1` to use the regular `libcint` package:
```bash
USE_LIBCINT=1 tools/install_libcint.sh
```

Note that `iodata` must be installed separately. `cython` is a dependency of `iodata`.

To test the installation,
Expand Down
2 changes: 1 addition & 1 deletion docs/notes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ \subsubsection{Gradient of density}
with respect to atomic orbitals,
\begin{lstlisting}[xleftmargin=-25pt]
from gbasis.evals.density import evaluate_density_gradient

output = evaluate_density_gradient(one_dm, basis, grid_3d, deriv_type="direct")
\end{lstlisting}
\item To evaluate the gradient of the density using density matrix expressed
Expand Down
48 changes: 42 additions & 6 deletions gbasis/contractions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Data class for contractions of Gaussian-type primitives."""
from gbasis.utils import factorial2
from numbers import Integral
import numpy as np
from gbasis.utils import factorial2


class GeneralizedContractionShell:
Expand Down Expand Up @@ -83,8 +84,6 @@ class GeneralizedContractionShell:
Tuple of magnetic quantum numbers of the contractions that specifies the ordering after
transforming the contractions from the Cartesian to spherical coordinate system.
Property of `GeneralizedContractionShell`.
charge : float
Charge at the center of the Gaussian primitives.
exps : np.ndarray(K,)
Exponents of the primitives, :math:`\{\alpha_i\}_{i=1}^K`.
coeffs : np.ndarray(K, M)
Expand Down Expand Up @@ -113,10 +112,11 @@ class GeneralizedContractionShell:
assign_norm_contr(self)
Assign normalization constants for the contractions.


"""

def __init__(self, angmom, coord, coeffs, exps, coord_type, tol=1e-15, ovr_screen=False):
def __init__(
self, angmom, coord, coeffs, exps, coord_type, icenter=None, tol=1e-15, ovr_screen=False
):
r"""Initialize a GeneralizedContractionShell instance.

Parameters
Expand All @@ -139,11 +139,12 @@ def __init__(self, angmom, coord, coeffs, exps, coord_type, tol=1e-15, ovr_scree
coord_type : str
Coordinate type of the contraction. Options include "cartesian" or "c" and
"spherical" or "p".
icenter : np.int64 or None (optional)
Index for the atomic center for the contraction
ovr_tol : float
Tolerance used in overlap screening.
ovr_screen : boolean
Flag used for activating overlap screening.

"""
self.angmom = angmom
self.coord = coord
Expand All @@ -153,6 +154,41 @@ def __init__(self, angmom, coord, coeffs, exps, coord_type, tol=1e-15, ovr_scree
self.ovr_screen = ovr_screen
self.assign_norm_cont()
self.coord_type = coord_type
self.icenter = icenter

@property
def icenter(self):
"""Atom center index for the contractions.

Returns
-------
icenter : int or None
Index for the corresponding atom center of the contractions.

"""
return self._icenter

@icenter.setter
def icenter(self, icenter):
"""Atom center index for the contractions.

Parameters
----------
icenter : int or None
Index for the corresponding atom center of the contractions.

Raises
------
TypeError
If `center` is not an `Integral` or `None` type.

"""
if isinstance(icenter, Integral):
self._icenter = int(icenter)
elif icenter is None:
self._icenter = None
else:
raise TypeError(f"Center should be of `numbers.Integral` type. Got {type(icenter)}")

@property
def coord(self):
Expand Down
Loading