Skip to content

Commit

Permalink
Fix bug in g1e_grids.c and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Sep 28, 2023
1 parent 6f80d41 commit 6c876c6
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
cd ${{ github.workspace }}/testsuite
pip install numpy mpmath
pip install numpy mpmath pyscf
python test_rys_roots.py
- name: Unittest
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -35,4 +35,8 @@ jobs:
python test_cart2sph.py
python test_c2s.py
python test_cint4c1e.py
python test_int1e.py
python test_int1e_grids.py
python test_int2c2e.py
python test_int3c1e.py
#python test_int2e.py
4 changes: 2 additions & 2 deletions src/g1e_grids.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ FINT CINTg0_1e_grids(double *g, double cutoff,
for (i = 0; i < rorder; i++) {
u[ig+GRID_BLKSIZE*i] = ubuf[i] / (ubuf[i] + 1) * tau2;
w[ig+GRID_BLKSIZE*i] = wbuf[i] * fac1;
u[ig+GRID_BLKSIZE*(i+rorder)] = ubuf[i] / (ubuf[i] + 1) * tau_theta;
w[ig+GRID_BLKSIZE*(i+rorder)] = wbuf[i] * fac_theta;
u[ig+GRID_BLKSIZE*(i+rorder)] = ubuf[i+rorder] / (ubuf[i+rorder] + 1) * tau_theta;
w[ig+GRID_BLKSIZE*(i+rorder)] = wbuf[i+rorder] * fac_theta;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test_3c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))

_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

PTR_LIGHT_SPEED = 0
PTR_COMMON_ORIG = 1
Expand Down
5 changes: 2 additions & 3 deletions testsuite/test_cart2sph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../scripts')))
import cart2sph

_cint = np.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
#_cint = np.ctypeslib.load_library(
# 'libcint', os.path.abspath(os.path.join(__file__, '../../../qcint/build')))
_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

pauli = np.array([[[0., 1.],
[1., 0.]], # x
Expand Down
3 changes: 2 additions & 1 deletion testsuite/test_cint.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)


PTR_EXPCUTOFF = 0
Expand Down
5 changes: 2 additions & 3 deletions testsuite/test_int1e_grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library(
'libcint', os.path.abspath(os.path.join(__file__, '../../build')))

_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

PTR_EXPCUTOFF = 0
PTR_COMMON_ORIG = 1
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test_int2c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
#_cint4 = ctypes.cdll.LoadLibrary('libcint.so.4')
_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

from pyscf import gto, lib

Expand Down
3 changes: 2 additions & 1 deletion testsuite/test_int2e_f12_etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

from pyscf import gto, lib

Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_int3c1e.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run(intor, comp=1, suffix='_sph', thr=1e-7):
intor2 = 'c%s%s'%(intor,suffix)
print(intor)
fn1 = getattr(_cint, intor3)
fn2 = getattr(_cint4, intor2)
#fn2 = getattr(_cint4, intor2)
cintopt = make_cintopt(mol._atm, mol._bas, mol._env, intor)
#cintopt = lib.c_null_ptr()
args = (mol._atm.ctypes.data_as(ctypes.c_void_p), ctypes.c_int(mol.natm),
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test_int3c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import ctypes
import numpy

_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
#_cint4 = ctypes.cdll.LoadLibrary('libcint.so.4')
_cint = ctypes.CDLL(os.path.abspath(os.path.join(__file__, '../../build/libcint.so')),
mode=os.RTLD_GLOBAL|os.RTLD_NOW)

from pyscf import gto, lib

Expand Down

0 comments on commit 6c876c6

Please sign in to comment.