sunqm / libcint Goto Github PK
View Code? Open in Web Editor NEWgeneral GTO integrals for quantum chemistry
Home Page: wiki.sunqm.net/libcint
License: Apache License 2.0
general GTO integrals for quantum chemistry
Home Page: wiki.sunqm.net/libcint
License: Apache License 2.0
In the past one could call cint functions from C++ by writing:
extern "C" {
#include "cint.h"
}
but due to the introduction of 'complex' into the header file (C99, but not C++) this now generates an error with -std=c++11
option to g++, eg.:
cint.h:131:44: error: expected ',' or '...' before '*' token
void CINTc2s_ket_spinor_sf1(double complex *gspa, double complex *gspb, double *gcart,
Of course it's perfectly reasonable to say C++ is unsupported and close this; I only mention because it did once work before no problem from C++.
See pyscf/pyscf#685
I had to cease using ENABLE_EXAMPLE=1
in Travis CI because I couldn't get CMake to detect Fortran properly. I assumed QUICK_TEST=1
would still let me run make test
. That turns out not to be the case.
Can you make it so that I can run tests without a Fortran compiler? That will allow me to finish my pull request with Travis CI support 😄
jrhammon-mac01:build jrhammon$ rm -rf * && cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_FLAGS="-O3 -qopenmp -xCORE-AVX2" -DCMAKE_CXX_FLAGS="-O3 -qopenmp -xCORE-AVX2" -DCMAKE_Fortran_COMPILER=false -DQUICK_TEST=1 && make && make test
-- The C compiler identification is Intel 17.0.0.20160720
-- The CXX compiler identification is Intel 17.0.0.20160720
-- Check for working C compiler: /opt/intel/compilers_and_libraries_2017.0.102/mac/bin/intel64/icc
-- Check for working C compiler: /opt/intel/compilers_and_libraries_2017.0.102/mac/bin/intel64/icc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/intel/compilers_and_libraries_2017.0.102/mac/bin/intel64/icpc
-- Check for working CXX compiler: /opt/intel/compilers_and_libraries_2017.0.102/mac/bin/intel64/icpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find QUADMATH (missing: QUADMATH_INCLUDE_DIR QUADMATH_LIBRARY)
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- A library with BLAS API found.
-- Looking for expl
-- Looking for expl - found
-- Looking for sqrtl
-- Looking for sqrtl - found
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
cint
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_Fortran_COMPILER
-- Build files have been written to: /Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/build
Scanning dependencies of target cint
[ 3%] Building C object CMakeFiles/cint.dir/src/c2f.c.o
[ 6%] Building C object CMakeFiles/cint.dir/src/cart2sph.c.o
[ 9%] Building C object CMakeFiles/cint.dir/src/cint1e.c.o
[ 12%] Building C object CMakeFiles/cint.dir/src/cint2e.c.o
[ 16%] Building C object CMakeFiles/cint.dir/src/cint_bas.c.o
[ 19%] Building C object CMakeFiles/cint.dir/src/fblas.c.o
[ 22%] Building C object CMakeFiles/cint.dir/src/g1e.c.o
[ 25%] Building C object CMakeFiles/cint.dir/src/g2e.c.o
[ 29%] Building C object CMakeFiles/cint.dir/src/misc.c.o
[ 32%] Building C object CMakeFiles/cint.dir/src/optimizer.c.o
[ 35%] Building C object CMakeFiles/cint.dir/src/rys_roots.c.o
[ 38%] Building C object CMakeFiles/cint.dir/src/cint2c2e.c.o
[ 41%] Building C object CMakeFiles/cint.dir/src/g2c2e.c.o
[ 45%] Building C object CMakeFiles/cint.dir/src/cint3c2e.c.o
[ 48%] Building C object CMakeFiles/cint.dir/src/g3c2e.c.o
[ 51%] Building C object CMakeFiles/cint.dir/src/optimizer_3c2e.c.o
[ 54%] Building C object CMakeFiles/cint.dir/src/cint3c1e.c.o
[ 58%] Building C object CMakeFiles/cint.dir/src/g3c1e.c.o
[ 61%] Building C object CMakeFiles/cint.dir/src/breit.c.o
[ 64%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor1.c.o
[ 67%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor2.c.o
[ 70%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor3.c.o
[ 74%] Building C object CMakeFiles/cint.dir/src/autocode/grad1.c.o
[ 77%] Building C object CMakeFiles/cint.dir/src/autocode/grad2.c.o
[ 80%] Building C object CMakeFiles/cint.dir/src/autocode/grad3.c.o
[ 83%] Building C object CMakeFiles/cint.dir/src/autocode/auto_hess.c.o
[ 87%] Building C object CMakeFiles/cint.dir/src/autocode/auto_3c2e.c.o
[ 90%] Building C object CMakeFiles/cint.dir/src/autocode/auto_3c1e.c.o
[ 93%] Building C object CMakeFiles/cint.dir/src/autocode/gaunt1.c.o
[ 96%] Building C object CMakeFiles/cint.dir/src/autocode/breit1.c.o
[100%] Linking C shared library libcint.dylib
[100%] Built target cint
make: *** No rule to make target `test'. Stop.
I'm trying to use Libcint with PySCF as an interface to calculate the following integral:
Is it possible to use the Libcint integral generator to do this? If so, what would I need to alter to enable these calculations? Otherwise, could you point me toward the subroutines that I would need to alter in order to accomplish this?
Hi,
the tests for libcint-4.1.2 fail on Fedora. The problem is simply that pytest
can't find the library in the build directory, since the library path is hardcoded in the tests in 4.1.2. Undoing this change solves the issue, i.e.
--- libcint-4.1.2/testsuite/test_3c2e.py.libpath 2021-04-11 07:02:05.000000000 +0000
+++ libcint-4.1.2/testsuite/test_3c2e.py 2021-04-11 21:44:12.774055892 +0000
@@ -13,7 +13,7 @@ import os
import ctypes
import numpy
-_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
+_cint = numpy.ctypeslib.load_library('libcint', '.')
PTR_LIGHT_SPEED = 0
diff -up libcint-4.1.2/testsuite/test_cint.py.libpath libcint-4.1.2/testsuite/test_cint.py
--- libcint-4.1.2/testsuite/test_cint.py.libpath 2021-04-11 07:02:05.000000000 +0000
+++ libcint-4.1.2/testsuite/test_cint.py 2021-04-11 21:49:01.184935829 +0000
@@ -13,7 +13,7 @@ import os
import ctypes
import numpy
-_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
+_cint = numpy.ctypeslib.load_library('libcint','.')
PTR_COMMON_ORIG = 1
Hey, I am trying to running this repo on my mac, and I running with brew-installed gcc-9 openblas & openmp, it is compiled normally but I run text and get such errors:
libomp 8.0.0 / gcc 9.1.0 / openblas 0.3.6_1
$ make test ARGS=-V
Running tests...
UpdateCTestConfiguration from :/Users/cjingtao/Downloads/libcint-3.0.15/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/Users/cjingtao/Downloads/libcint-3.0.15/build/DartConfiguration.tcl
Test project /Users/cjingtao/Downloads/libcint-3.0.15/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
Start 1: cinttest
1: Test command: /usr/bin/python "/Users/cjingtao/Downloads/libcint-3.0.15/testsuite/test_cint.py"
1: Test timeout computed to be: 10000000
1: pass: cint1e_ovlp_sph
1: pass: cint1e_nuc_sph
1: pass: cint1e_kin_sph
1: pass: cint1e_ia01p_sph
1: pass: cint1e_cg_irxp_sph
1: pass: cint1e_giao_irjxp_sph
1: pass: cint1e_igkin_sph
1: pass: cint1e_igovlp_sph
1: pass: cint1e_ignuc_sph
1: pass: cint1e_ipovlp_sph
1: pass: cint1e_ipkin_sph
1: pass: cint1e_ipnuc_sph
1: pass: cint1e_iprinv_sph
1: pass: cint1e_prinvxp_sph
1: pass: cint1e_z_sph
1: pass: cint1e_zz_sph
1: pass: cint1e_r_sph
1: pass: cint1e_rr_sph
1: pass: cint1e_r2_sph
1: pass: cint1e_ovlp
1: pass: cint1e_nuc
1: pass: cint1e_gnuc
1: pass: cint1e_srsr
1: pass: cint1e_sr
1: pass: cint1e_srsp
1: pass: cint1e_spsp
1: pass: cint1e_sp
1: pass: cint1e_spspsp
1: pass: cint1e_spnuc
1: pass: cint1e_spnucsp
1: pass: cint1e_srnucsr
1: pass: cint1e_cg_sa10sa01
1: pass: cint1e_cg_sa10sp
1: pass: cint1e_cg_sa10nucsp
1: pass: cint1e_giao_sa10sa01
1: pass: cint1e_giao_sa10sp
1: pass: cint1e_giao_sa10nucsp
1: pass: cint1e_govlp
1: pass: cint1e_sa01sp
1: pass: cint1e_spgsp
1: pass: cint1e_spgnucsp
1: pass: cint1e_spgsa01
1: pass: cint1e_ipovlp
1: pass: cint1e_ipkin
1: pass: cint1e_ipnuc
1: pass: cint1e_iprinv
1: pass: cint1e_ipspnucsp
1: pass: cint1e_ipsprinvsp
1: pass: cint2e_sph
1: pass: cint2e_ip1_sph
1: pass: cint2e_ip1_sph
1: pass: cint2e_p1vxp1_sph
1: pass: cint2e
1: pass: cint2e_spsp1
1: * FAIL: cint2e_spsp1spsp2 . err: 0.186581252142787 / 1391716.87687
1: pass: cint2e_srsr1
1: * FAIL: cint2e_srsr1srsr2 . err: 0.1161914421245456 / 860883.628827
1: pass: cint2e_cg_sa10sp1
1: pass: cint2e_cg_sa10sp1spsp2
1: pass: cint2e_giao_sa10sp1
1: * FAIL: cint2e_giao_sa10sp1spsp2 . err: 0.1128864532802254 / 918284.946469
1: pass: cint2e_g1
1: pass: cint2e_spgsp1
1: pass: cint2e_g1spsp2
1: pass: cint2e_spgsp1spsp2
1: pass: cint2e_ip1
1: pass: cint2e_ipspsp1
1: pass: cint2e_ip1spsp2
1: pass: cint2e_ipspsp1spsp2
1: pass: cint2e_spsp1 / cint2e
1: pass: cint2e_spsp1spsp2 / cint2e
1: pass: cint2e_spsp1spsp2 / cint2e_spsp1
1: pass: cint2e_spgsp1 / cint2e_g1
1: pass: cint2e_g1spsp2 / cint2e_g1
1: pass: cint2e_spgsp1spsp2 / cint2e_g1
1: pass: cint2e_ipspsp1 / cint2e_ip1
1: pass: cint2e_ip1spsp2 / cint2e_ip1
1: pass: cint2e_ipspsp1spsp2 / cint2e_ip1
1/2 Test #1: cinttest ......................... Passed 90.12 sec
test 2
Start 2: cint3c2etest
2: Test command: /usr/bin/python "/Users/cjingtao/Downloads/libcint-3.0.15/testsuite/test_3c2e.py"
2: Test timeout computed to be: 10000000
2: pass: cint3c2e_sph
2: pass: cint3c2e_ip1_sph
2: pass: cint3c2e_ip2_sph
2: Traceback (most recent call last):
2: File "/Users/cjingtao/Downloads/libcint-3.0.15/testsuite/test_3c2e.py", line 312, in <module>
2: test_int3c2e_spinor(*f)
2: File "/Users/cjingtao/Downloads/libcint-3.0.15/testsuite/test_3c2e.py", line 233, in test_int3c2e_spinor
2: intor = getattr(_cint, name)
2: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
2: func = self.__getitem__(name)
2: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
2: func = self._FuncPtr((name_or_ordinal, self))
2: AttributeError: dlsym(0x7f98b1f38670, cint3c2e_spinor): symbol not found
2/2 Test #2: cint3c2etest .....................***Failed 0.23 sec
50% tests passed, 1 tests failed out of 2
Total Test time (real) = 90.36 sec
The following tests FAILED:
2 - cint3c2etest (Failed)
Errors while running CTest
make: *** [test] Error 8
Is there any advice to work around it?
Hi Qiming,
In http://sunqm.net/pyscf/gto.html#module-pyscf.gto.moleintor you describe that you have the operators:
“cint1e_z_sph” spheric ( | z | )
“cint1e_zz_sph” spheric ( | z z | )
In principle, as atoms move away from the origin along the z-axis, the values (i|z|i) should (roughly) change in magnitude proportional to the shift along the z-axis. Yet the diagonal values ( i | z | i ) cint obtains are the same for all centers | i ) :
In AO for the H-chain
BOHR = 0.52917721092
separation = 2.0
num_atoms = 12
z_co = BOHR*separation*np.arange(0.0,num_atoms-0.5,1.0)
z_co = z_co - np.average(z_co)
print "z_co =",z_co
mol = gto.Mole()
mol.atom = []
for zco in z_co:
mol.atom.append(('H', (0, 0, zco)))
mol.basis = 'sto-3g'
mol.symmetry = 1
mol.charge = 0
mol.spin = 0 #2*S; multiplicity-1
mol.build()
cint gets for (|z|):
[[ 6.26596548e-16 -4.62777691e-01 -1.96265900e-01 -3.75938850e-02
-3.85043869e-03 -2.15980014e-04 -6.23600664e-06 -9.00599343e-08
-6.49351112e-10 -2.34589262e-12 -4.26003046e-15 -3.89781041e-18]
[ 4.62777691e-01 0.00000000e+00 -4.62777691e-01 -1.96265900e-01
-3.75938850e-02 -3.85043869e-03 -2.15980014e-04 -6.23600664e-06
-9.00599343e-08 -6.49351112e-10 -2.34589262e-12 -4.26003046e-15]
[ 1.96265900e-01 4.62777691e-01 -9.00445191e-17 -4.62777691e-01
-1.96265900e-01 -3.75938850e-02 -3.85043869e-03 -2.15980014e-04
-6.23600664e-06 -9.00599343e-08 -6.49351112e-10 -2.34589262e-12]
[ 3.75938850e-02 1.96265900e-01 4.62777691e-01 3.35579166e-17
-4.62777691e-01 -1.96265900e-01 -3.75938850e-02 -3.85043869e-03
-2.15980014e-04 -6.23600664e-06 -9.00599343e-08 -6.49351112e-10]
[ 3.85043869e-03 3.75938850e-02 1.96265900e-01 4.62777691e-01
-2.73560224e-17 -4.62777691e-01 -1.96265900e-01 -3.75938850e-02
-3.85043869e-03 -2.15980014e-04 -6.23600664e-06 -9.00599343e-08]
[ 2.15980014e-04 3.85043869e-03 3.75938850e-02 1.96265900e-01
4.62777691e-01 0.00000000e+00 -4.62777691e-01 -1.96265900e-01
-3.75938850e-02 -3.85043869e-03 -2.15980014e-04 -6.23600664e-06]
[ 6.23600664e-06 2.15980014e-04 3.85043869e-03 3.75938850e-02
1.96265900e-01 4.62777691e-01 0.00000000e+00 -4.62777691e-01
-1.96265900e-01 -3.75938850e-02 -3.85043869e-03 -2.15980014e-04]
[ 9.00599343e-08 6.23600664e-06 2.15980014e-04 3.85043869e-03
3.75938850e-02 1.96265900e-01 4.62777691e-01 2.73560224e-17
-4.62777691e-01 -1.96265900e-01 -3.75938850e-02 -3.85043869e-03]
[ 6.49351112e-10 9.00599343e-08 6.23600664e-06 2.15980014e-04
3.85043869e-03 3.75938850e-02 1.96265900e-01 4.62777691e-01
-3.35579166e-17 -4.62777691e-01 -1.96265900e-01 -3.75938850e-02]
[ 2.34589262e-12 6.49351112e-10 9.00599343e-08 6.23600664e-06
2.15980014e-04 3.85043869e-03 3.75938850e-02 1.96265900e-01
4.62777691e-01 -4.44226650e-16 -4.62777691e-01 -1.96265900e-01]
[ 4.26003046e-15 2.34589262e-12 6.49351112e-10 9.00599343e-08
6.23600664e-06 2.15980014e-04 3.85043869e-03 3.75938850e-02
1.96265900e-01 4.62777691e-01 0.00000000e+00 -4.62777691e-01]
[ 3.89781041e-18 4.26003046e-15 2.34589262e-12 6.49351112e-10
9.00599343e-08 6.23600664e-06 2.15980014e-04 3.85043869e-03
3.75938850e-02 1.96265900e-01 4.62777691e-01 -6.26596548e-16]]
and for (|zz|):
[[ 6.49524230e-01 9.30064857e-01 5.61017715e-01 1.38267394e-01
1.71577527e-02 1.14834023e-03 3.89739177e-05 6.49494289e-07
5.31499604e-09 2.14989495e-11 4.32310263e-14 4.34005444e-17]
[ 9.30064857e-01 6.49524230e-01 9.30064857e-01 5.61017715e-01
1.38267394e-01 1.71577527e-02 1.14834023e-03 3.89739177e-05
6.49494289e-07 5.31499604e-09 2.14989495e-11 4.32310263e-14]
[ 5.61017715e-01 9.30064857e-01 6.49524230e-01 9.30064857e-01
5.61017715e-01 1.38267394e-01 1.71577527e-02 1.14834023e-03
3.89739177e-05 6.49494289e-07 5.31499604e-09 2.14989495e-11]
[ 1.38267394e-01 5.61017715e-01 9.30064857e-01 6.49524230e-01
9.30064857e-01 5.61017715e-01 1.38267394e-01 1.71577527e-02
1.14834023e-03 3.89739177e-05 6.49494289e-07 5.31499604e-09]
[ 1.71577527e-02 1.38267394e-01 5.61017715e-01 9.30064857e-01
6.49524230e-01 9.30064857e-01 5.61017715e-01 1.38267394e-01
1.71577527e-02 1.14834023e-03 3.89739177e-05 6.49494289e-07]
[ 1.14834023e-03 1.71577527e-02 1.38267394e-01 5.61017715e-01
9.30064857e-01 6.49524230e-01 9.30064857e-01 5.61017715e-01
1.38267394e-01 1.71577527e-02 1.14834023e-03 3.89739177e-05]
[ 3.89739177e-05 1.14834023e-03 1.71577527e-02 1.38267394e-01
5.61017715e-01 9.30064857e-01 6.49524230e-01 9.30064857e-01
5.61017715e-01 1.38267394e-01 1.71577527e-02 1.14834023e-03]
[ 6.49494289e-07 3.89739177e-05 1.14834023e-03 1.71577527e-02
1.38267394e-01 5.61017715e-01 9.30064857e-01 6.49524230e-01
9.30064857e-01 5.61017715e-01 1.38267394e-01 1.71577527e-02]
[ 5.31499604e-09 6.49494289e-07 3.89739177e-05 1.14834023e-03
1.71577527e-02 1.38267394e-01 5.61017715e-01 9.30064857e-01
6.49524230e-01 9.30064857e-01 5.61017715e-01 1.38267394e-01]
[ 2.14989495e-11 5.31499604e-09 6.49494289e-07 3.89739177e-05
1.14834023e-03 1.71577527e-02 1.38267394e-01 5.61017715e-01
9.30064857e-01 6.49524230e-01 9.30064857e-01 5.61017715e-01]
[ 4.32310263e-14 2.14989495e-11 5.31499604e-09 6.49494289e-07
3.89739177e-05 1.14834023e-03 1.71577527e-02 1.38267394e-01
5.61017715e-01 9.30064857e-01 6.49524230e-01 9.30064857e-01]
[ 4.34005444e-17 4.32310263e-14 2.14989495e-11 5.31499604e-09
6.49494289e-07 3.89739177e-05 1.14834023e-03 1.71577527e-02
1.38267394e-01 5.61017715e-01 9.30064857e-01 6.49524230e-01]]
while I get for (|z|) and (|zz|):
( 0 | z | 0 ) = -10.999999899787800572426
( 0 | z | 1 ) = -4.6277769121416882924791
( 0 | z | 2 ) = -0.88319654823480719940676
( 0 | z | 3 ) = -0.10025036004989190674408
( 0 | z | 4 ) = -0.00673826769913168314302121
( 0 | z | 5 ) = -0.000259176017145982943469529
( 0 | z | 6 ) = -5.19667220338388105880601e-06
( 0 | z | 7 ) = -5.14628196118686697135586e-08
( 0 | z | 8 ) = -2.43506666895108163200548e-10
( 0 | z | 9 ) = -5.21309471544019031202246e-13
( 0 | z | 10 ) = -4.2600304552972045679068e-16
( 0 | z | 11 ) = 2.24207754291970731347797e-44
( 1 | z | 0 ) = -4.6277769121416882924791
( 1 | z | 1 ) = -8.99999991800819998388761
( 1 | z | 2 ) = -3.70222152971335027871191
( 1 | z | 3 ) = -0.6869306486270722045262
( 1 | z | 4 ) = -0.0751877700374189439358474
( 1 | z | 5 ) = -0.00481304835652263032080844
( 1 | z | 6 ) = -0.000172784011430655322751407
( 1 | z | 7 ) = -3.11800332203032846587702e-06
( 1 | z | 8 ) = -2.57314098059343348567793e-08
( 1 | z | 9 ) = -8.1168888965036071633112e-11
( 1 | z | 10 ) = -2.40741243048404481631997e-35
( 1 | z | 11 ) = 4.2600304552972045679068e-16
( 2 | z | 0 ) = -0.88319654823480719940676
( 2 | z | 1 ) = -3.70222152971335027871191
( 2 | z | 2 ) = -6.99999993622859939534919
( 2 | z | 3 ) = -2.77666614728501315312315
( 2 | z | 4 ) = -0.490664749019337265156793
( 2 | z | 5 ) = -0.0501251800249459603109337
( 2 | z | 6 ) = -0.00288782901391357836595741
( 2 | z | 7 ) = -8.63920057153276613757034e-05
( 2 | z | 8 ) = -1.03933444067677608470626e-06
( 2 | z | 9 ) = -1.61558713389263217748322e-27
( 2 | z | 10 ) = 8.1168888965036071633112e-11
( 2 | z | 11 ) = 5.21309471544019031202246e-13
( 3 | z | 0 ) = -0.10025036004989190674408
( 3 | z | 1 ) = -0.6869306486270722045262
( 3 | z | 2 ) = -2.77666614728501315312315
( 3 | z | 3 ) = -4.99999995444900058316762
( 3 | z | 4 ) = -1.85111076485667558344517
( 3 | z | 5 ) = -0.294398849411602325787385
( 3 | z | 6 ) = -0.0250625900124729766860199
( 3 | z | 7 ) = -0.000962609671304526085845732
( 3 | z | 8 ) = 5.29395592033937711917702e-22
( 3 | z | 9 ) = 1.03933444067677608470626e-06
( 3 | z | 10 ) = 2.57314098059343348567793e-08
( 3 | z | 11 ) = 2.43506666895108163200548e-10
( 4 | z | 0 ) = -0.00673826769913168314302121
( 4 | z | 1 ) = -0.0751877700374189439358474
( 4 | z | 2 ) = -0.490664749019337265156793
( 4 | z | 3 ) = -1.85111076485667558344517
( 4 | z | 4 ) = -2.9999999726693999946292
( 4 | z | 5 ) = -0.925555382428338013767188
( 4 | z | 6 ) = -0.0981329498038674558069161
( 4 | z | 7 ) = 0
( 4 | z | 8 ) = 0.000962609671304526085845732
( 4 | z | 9 ) = 8.63920057153276613757034e-05
( 4 | z | 10 ) = 3.11800332203032846587702e-06
( 4 | z | 11 ) = 5.14628196118686697135586e-08
( 5 | z | 0 ) = -0.000259176017145982943469529
( 5 | z | 1 ) = -0.00481304835652263032080844
( 5 | z | 2 ) = -0.0501251800249459603109337
( 5 | z | 3 ) = -0.294398849411602325787385
( 5 | z | 4 ) = -0.925555382428338013767188
( 5 | z | 5 ) = -0.999999990889800072224602
( 5 | z | 6 ) = 1.66533453693773481063545e-16
( 5 | z | 7 ) = 0.0981329498038674141735527
( 5 | z | 8 ) = 0.0250625900124729766860199
( 5 | z | 9 ) = 0.00288782901391357836595741
( 5 | z | 10 ) = 0.000172784011430655322751407
( 5 | z | 11 ) = 5.19667220338388105880601e-06
( 6 | z | 0 ) = -5.19667220338388105880601e-06
( 6 | z | 1 ) = -0.000172784011430655322751407
( 6 | z | 2 ) = -0.00288782901391357836595741
( 6 | z | 3 ) = -0.0250625900124729766860199
( 6 | z | 4 ) = -0.0981329498038674558069161
( 6 | z | 5 ) = 1.66533453693773481063545e-16
( 6 | z | 6 ) = 0.999999990889800183246905
( 6 | z | 7 ) = 0.925555382428338013767188
( 6 | z | 8 ) = 0.294398849411602325787385
( 6 | z | 9 ) = 0.0501251800249459603109337
( 6 | z | 10 ) = 0.00481304835652263032080844
( 6 | z | 11 ) = 0.000259176017145982943469529
( 7 | z | 0 ) = -5.14628196118686697135586e-08
( 7 | z | 1 ) = -3.11800332203032846587702e-06
( 7 | z | 2 ) = -8.63920057153276613757034e-05
( 7 | z | 3 ) = -0.000962609671304526085845732
( 7 | z | 4 ) = 0
( 7 | z | 5 ) = 0.0981329498038674141735527
( 7 | z | 6 ) = 0.925555382428338013767188
( 7 | z | 7 ) = 2.9999999726693999946292
( 7 | z | 8 ) = 1.85111076485667558344517
( 7 | z | 9 ) = 0.490664749019337209645641
( 7 | z | 10 ) = 0.0751877700374189439358474
( 7 | z | 11 ) = 0.00673826769913168314302121
( 8 | z | 0 ) = -2.43506666895108163200548e-10
( 8 | z | 1 ) = -2.57314098059343348567793e-08
( 8 | z | 2 ) = -1.03933444067677608470626e-06
( 8 | z | 3 ) = 5.29395592033937711917702e-22
( 8 | z | 4 ) = 0.000962609671304526085845732
( 8 | z | 5 ) = 0.0250625900124729766860199
( 8 | z | 6 ) = 0.294398849411602325787385
( 8 | z | 7 ) = 1.85111076485667558344517
( 8 | z | 8 ) = 4.99999995444900058316762
( 8 | z | 9 ) = 2.77666614728501315312315
( 8 | z | 10 ) = 0.686930648627072093503898
( 8 | z | 11 ) = 0.10025036004989190674408
( 9 | z | 0 ) = -5.21309471544019031202246e-13
( 9 | z | 1 ) = -8.1168888965036071633112e-11
( 9 | z | 2 ) = -1.61558713389263217748322e-27
( 9 | z | 3 ) = 1.03933444067677608470626e-06
( 9 | z | 4 ) = 8.63920057153276613757034e-05
( 9 | z | 5 ) = 0.00288782901391357836595741
( 9 | z | 6 ) = 0.0501251800249459603109337
( 9 | z | 7 ) = 0.490664749019337209645641
( 9 | z | 8 ) = 2.77666614728501315312315
( 9 | z | 9 ) = 6.99999993622859939534919
( 9 | z | 10 ) = 3.70222152971335116689033
( 9 | z | 11 ) = 0.883196548234806977362155
( 10 | z | 0 ) = -4.2600304552972045679068e-16
( 10 | z | 1 ) = -2.40741243048404481631997e-35
( 10 | z | 2 ) = 8.1168888965036071633112e-11
( 10 | z | 3 ) = 2.57314098059343348567793e-08
( 10 | z | 4 ) = 3.11800332203032846587702e-06
( 10 | z | 5 ) = 0.000172784011430655322751407
( 10 | z | 6 ) = 0.00481304835652263032080844
( 10 | z | 7 ) = 0.0751877700374189439358474
( 10 | z | 8 ) = 0.686930648627072093503898
( 10 | z | 9 ) = 3.70222152971335116689033
( 10 | z | 10 ) = 8.99999991800819998388761
( 10 | z | 11 ) = 4.62777691214168918065752
( 11 | z | 0 ) = 2.24207754291970731347797e-44
( 11 | z | 1 ) = 4.2600304552972045679068e-16
( 11 | z | 2 ) = 5.21309471544019031202246e-13
( 11 | z | 3 ) = 2.43506666895108163200548e-10
( 11 | z | 4 ) = 5.14628196118686697135586e-08
( 11 | z | 5 ) = 5.19667220338388105880601e-06
( 11 | z | 6 ) = 0.000259176017145982943469529
( 11 | z | 7 ) = 0.00673826769913168314302121
( 11 | z | 8 ) = 0.10025036004989190674408
( 11 | z | 9 ) = 0.883196548234806977362155
( 11 | z | 10 ) = 4.62777691214168918065752
( 11 | z | 11 ) = 10.9999998997877987960692
( 0 | zz | 0 ) = 121.649523127889011675506
( 0 | zz | 1 ) = 46.7450562876230861775184
( 0 | zz | 2 ) = 8.11725485031002591540528
( 0 | zz | 3 ) = 0.827488619744636944020044
( 0 | zz | 4 ) = 0.0489238718814696965653255
( 0 | zz | 5 ) = 0.0016234962634028499758182
( 0 | zz | 6 ) = 2.75412388858752698185105e-05
( 0 | zz | 7 ) = 2.24926027105023354282833e-07
( 0 | zz | 8 ) = 8.50707142661713386724502e-10
( 0 | zz | 9 ) = 1.42853489023546726912321e-12
( 0 | zz | 10 ) = 1.0567248174665075907848e-15
( 0 | zz | 11 ) = 5.24629952257418176836086e-19
( 1 | zz | 0 ) = 46.7450562876230861775184
( 1 | zz | 1 ) = 81.6495234922970212210203
( 1 | zz | 2 ) = 30.0850594039130143642069
( 1 | zz | 3 ) = 4.97700045658626777367317
( 1 | zz | 4 ) = 0.47661235957001524266019
( 1 | zz | 5 ) = 0.0258212397701610626987723
( 1 | zz | 6 ) = 0.000759576206249573497586436
( 1 | zz | 7 ) = 1.09118878350468524632104e-05
( 1 | zz | 8 ) = 7.05375682694173319072669e-08
( 1 | zz | 9 ) = 2.01356030941424942906576e-10
( 1 | zz | 10 ) = 3.8591594714742920671872e-13
( 1 | zz | 11 ) = 1.0567248174665075907848e-15
( 2 | zz | 0 ) = 8.11725485031002591540528
( 2 | zz | 1 ) = 30.0850594039130143642069
( 2 | zz | 2 ) = 49.649523783823418909833
( 2 | zz | 3 ) = 17.1272840499162910532505
( 2 | zz | 4 ) = 2.62180966129344916737409
( 2 | zz | 5 ) = 0.225986459445285475799992
( 2 | zz | 6 ) = 0.010419485029288647059964
( 2 | zz | 7 ) = 0.00024122417195760755643727
( 2 | zz | 8 ) = 2.59721230963264463259326e-06
( 2 | zz | 9 ) = 1.90747486575486655024307e-08
( 2 | zz | 10 ) = 2.01356030941424942906576e-10
( 2 | zz | 11 ) = 1.42853489023546726912321e-12
( 3 | zz | 0 ) = 0.827488619744636944020044
( 3 | zz | 1 ) = 4.97700045658626777367317
( 3 | zz | 2 ) = 17.1272840499162910532505
( 3 | zz | 3 ) = 25.6495240024682154000857
( 3 | zz | 4 ) = 7.87173022563291091557858
( 3 | zz | 5 ) = 1.05168246443156965241883
( 3 | zz | 6 ) = 0.0756109193704475879282967
( 3 | zz | 7 ) = 0.0027186076588524366384747
( 3 | zz | 8 ) = 6.84401605269522336858629e-05
( 3 | zz | 9 ) = 2.59721230963264463259326e-06
( 3 | zz | 10 ) = 7.05375682694173319072669e-08
( 3 | zz | 11 ) = 8.50707142661713386724502e-10
( 4 | zz | 0 ) = 0.0489238718814696965653255
( 4 | zz | 1 ) = 0.47661235957001524266019
( 4 | zz | 2 ) = 2.62180966129344916737409
( 4 | zz | 3 ) = 7.87173022563291091557858
( 4 | zz | 4 ) = 9.64952414823141424449204
( 4 | zz | 5 ) = 2.31839793106288638568913
( 4 | zz | 6 ) = 0.266618866000630116985803
( 4 | zz | 7 ) = 0.02548573934550163108681
( 4 | zz | 8 ) = 0.0027186076588524366384747
( 4 | zz | 9 ) = 0.000241224171957607529332215
( 4 | zz | 10 ) = 1.09118878350468524632104e-05
( 4 | zz | 11 ) = 2.24926027105023354282833e-07
( 5 | zz | 0 ) = 0.0016234962634028499758182
( 5 | zz | 1 ) = 0.0258212397701610626987723
( 5 | zz | 2 ) = 0.225986459445285475799992
( 5 | zz | 3 ) = 1.05168246443156965241883
( 5 | zz | 4 ) = 2.31839793106288638568913
( 5 | zz | 5 ) = 1.64952422111301411078443
( 5 | zz | 6 ) = 0.467287166206210524688203
( 5 | zz | 7 ) = 0.266618866000630116985803
( 5 | zz | 8 ) = 0.0756109193704475879282967
( 5 | zz | 9 ) = 0.010419485029288647059964
( 5 | zz | 10 ) = 0.000759576206249573497586436
( 5 | zz | 11 ) = 2.75412388858752698185105e-05
( 6 | zz | 0 ) = 2.75412388858752698185105e-05
( 6 | zz | 1 ) = 0.000759576206249573497586436
( 6 | zz | 2 ) = 0.010419485029288647059964
( 6 | zz | 3 ) = 0.0756109193704475879282967
( 6 | zz | 4 ) = 0.266618866000630116985803
( 6 | zz | 5 ) = 0.467287166206210524688203
( 6 | zz | 6 ) = 1.64952422111301411078443
( 6 | zz | 7 ) = 2.31839793106288638568913
( 6 | zz | 8 ) = 1.05168246443156965241883
( 6 | zz | 9 ) = 0.225986459445285475799992
( 6 | zz | 10 ) = 0.0258212397701610626987723
( 6 | zz | 11 ) = 0.0016234962634028499758182
( 7 | zz | 0 ) = 2.24926027105023354282833e-07
( 7 | zz | 1 ) = 1.09118878350468524632104e-05
( 7 | zz | 2 ) = 0.00024122417195760755643727
( 7 | zz | 3 ) = 0.0027186076588524366384747
( 7 | zz | 4 ) = 0.02548573934550163108681
( 7 | zz | 5 ) = 0.266618866000630116985803
( 7 | zz | 6 ) = 2.31839793106288638568913
( 7 | zz | 7 ) = 9.64952414823141424449204
( 7 | zz | 8 ) = 7.87173022563291358011384
( 7 | zz | 9 ) = 2.62180966129344827919567
( 7 | zz | 10 ) = 0.47661235957001524266019
( 7 | zz | 11 ) = 0.0489238718814696965653255
( 8 | zz | 0 ) = 8.50707142661713386724502e-10
( 8 | zz | 1 ) = 7.05375682694173319072669e-08
( 8 | zz | 2 ) = 2.59721230963264463259326e-06
( 8 | zz | 3 ) = 6.84401605269522336858629e-05
( 8 | zz | 4 ) = 0.0027186076588524366384747
( 8 | zz | 5 ) = 0.0756109193704475879282967
( 8 | zz | 6 ) = 1.05168246443156965241883
( 8 | zz | 7 ) = 7.87173022563291358011384
( 8 | zz | 8 ) = 25.6495240024682154000857
( 8 | zz | 9 ) = 17.1272840499162910532505
( 8 | zz | 10 ) = 4.97700045658626688549475
( 8 | zz | 11 ) = 0.827488619744636832997742
( 9 | zz | 0 ) = 1.42853489023546726912321e-12
( 9 | zz | 1 ) = 2.01356030941424942906576e-10
( 9 | zz | 2 ) = 1.90747486575486655024307e-08
( 9 | zz | 3 ) = 2.59721230963264463259326e-06
( 9 | zz | 4 ) = 0.000241224171957607529332215
( 9 | zz | 5 ) = 0.010419485029288647059964
( 9 | zz | 6 ) = 0.225986459445285475799992
( 9 | zz | 7 ) = 2.62180966129344827919567
( 9 | zz | 8 ) = 17.1272840499162910532505
( 9 | zz | 9 ) = 49.649523783823418909833
( 9 | zz | 10 ) = 30.0850594039130143642069
( 9 | zz | 11 ) = 8.11725485031002591540528
( 10 | zz | 0 ) = 1.0567248174665075907848e-15
( 10 | zz | 1 ) = 3.8591594714742920671872e-13
( 10 | zz | 2 ) = 2.01356030941424942906576e-10
( 10 | zz | 3 ) = 7.05375682694173319072669e-08
( 10 | zz | 4 ) = 1.09118878350468524632104e-05
( 10 | zz | 5 ) = 0.000759576206249573497586436
( 10 | zz | 6 ) = 0.0258212397701610626987723
( 10 | zz | 7 ) = 0.47661235957001524266019
( 10 | zz | 8 ) = 4.97700045658626688549475
( 10 | zz | 9 ) = 30.0850594039130143642069
( 10 | zz | 10 ) = 81.6495234922970212210203
( 10 | zz | 11 ) = 46.7450562876231003883731
( 11 | zz | 0 ) = 5.24629952257418176836086e-19
( 11 | zz | 1 ) = 1.0567248174665075907848e-15
( 11 | zz | 2 ) = 1.42853489023546726912321e-12
( 11 | zz | 3 ) = 8.50707142661713386724502e-10
( 11 | zz | 4 ) = 2.24926027105023354282833e-07
( 11 | zz | 5 ) = 2.75412388858752698185105e-05
( 11 | zz | 6 ) = 0.0016234962634028499758182
( 11 | zz | 7 ) = 0.0489238718814696965653255
( 11 | zz | 8 ) = 0.827488619744636832997742
( 11 | zz | 9 ) = 8.11725485031002591540528
( 11 | zz | 10 ) = 46.7450562876231003883731
( 11 | zz | 11 ) = 121.649523127888983253797
What should I use to calculate the z-component of the dipole moment and the second cumulant of z?
Best regards,
Sebastian
Perhaps due to 6612db1, but now one gets on some systems:
error: unknown type name 'int64_t'
from c2f.h when building cint2e.c.o. This is because the include for stdint.h is inside I8 define in config.h:
#ifdef I8
#include <stdint.h>
#define FINT int64_t
#else
#define FINT int
#endif
but int64_t is now hard coded in c2f.h and used unconditionally. I guess on some systems stdint.h gets dragged in by other headers, but it's not always the case. The simple fix is to move the include for stdint.h up one line outside of the I8 conditional.
Hi,
I tried to install and compile the package in VSCode, but after I cmake stuffs, the make install reports.
make: *** No rule to make target 'install'. Stop.
Since the compilation was successful under linux environment, I want to confirm is this library designed for being used in windows?
I am trying to get the correct one- and two-electron integrals for some cartesian basis functions. But I cannot find any information on how libcint expects the coefficients to be scaled.
Currently I am rescaling my coefficients to include the normalization factor, so the contracted basis functions are directly normalized. After passing these to libcint I calculate the overlap (cint1e_ovlp_cart
).
For d functions I get for the self overlaps: 1.0000 0.3333 0.3333 1.0000 0.3333 1.0000
. 1.0
is fine, but there has to be something wrong with 0.3333
.
For s and p functions all the integrals look fine, if I divide the coefficients additionally by 0.282094791773878143
and 0.488602511902919921
(taken from pyscf's cart2sph
). But that is just trial and error based, and does not tell me how it should really work.
Could you elaborate how I am supposed to proceed from the normalized contractions?
Hi,
I failed to build this on openSUSE Tumbleweed.
openSUSE enforce this warning flag as error.
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c: In function 'int2c2e_ip1_spinor':
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c:387:1: error: control reaches end of non-void function [-Werror=return-type]
[ 20s] 387 | }
[ 20s] | ^
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c: In function 'int2c2e_ip2_spinor':
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c:464:1: error: control reaches end of non-void function [-Werror=return-type]
[ 20s] 464 | }
[ 20s] | ^
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c: In function 'int2c2e_ipip1_spinor':
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c:1289:1: error: control reaches end of non-void function [-Werror=return-type]
[ 20s] 1289 | }
[ 20s] | ^
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c: In function 'int2c2e_ip1ip2_spinor':
[ 20s] /home/abuild/rpmbuild/BUILD/libcint-4.4.1/src/autocode/int3c2e.c:1366:1: error: control reaches end of non-void function [-Werror=return-type]
[ 20s] 1366 | }
[ 20s] | ^
[ 20s] cc1: some warnings being treated as errors
[ 20s] make[2]: *** [CMakeFiles/cint.dir/build.make:555: CMakeFiles/cint.dir/src/autocode/int3c2e.c.o] Error 1
[ 20s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/libcint-4.4.1/build'
[ 20s] make[2]: *** Waiting for unfinished jobs....
$ python3.7 testsuite/test_cint.py
Traceback (most recent call last):
File "testsuite/test_cint.py", line 16, in <module>
_cint = numpy.ctypeslib.load_library('libcint', os.path.abspath(os.path.join(__file__, '../../build')))
File "/usr/local/lib/python3.7/site-packages/numpy/ctypeslib.py", line 157, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension
My build is in /usr/ports/science/libcint/work/.build/ as set by the FreeBSD ports framework.
In the documentation it is written that:
"Two electron integrals (value < 1e-15 are neglected) include"
is it possible to adjust this value at runtime?
Hi,
as it isn't mentioned in the README: It appears to me that one also has to supply the flag "-DCMAKE_C_FLAGS=-fopenmp" to cmake, otherwise linking time_c2h6 raises an error regarding the use of omp_get_wtime. Tested on
Best regards & thanks for your lib.
My understanding is that there are two components to this derivative: ⟨i|∇nuc|j⟩ and ⟨i|nuc|∇j⟩. If that's the case I have a few questions on libcint
usage:
For basis function not centered on the atom being displaced, how do I compute the ⟨i|∇nuc|j⟩ contribution only?
When computing gradients with cint1e_ipnuc_sph
is ⟨i|nuc|∇j⟩ the only term included?
Thank you!
Does libcint have integrals of 1/r12 derivatives or is it possible to add them using the integral generator? I know there is a nabla-rinv operator for 1-electron integrals, but as far as I can see there is no 2-electron equivalent.
@sunqm We are interested in using and implementing the Gaussian type geminal integrals below.
We would like to use these integrals to separate out long and short range Coulomb interaction.
These integrals have been widely used in previous F12 calculations, and we know that the they are implemented in the libint package by Ed Valeev.
We assume that this would be easy to implement in libcint. We are open to implementing these integrals ourselves, but it might be very little effort for you to implement them.
Is this something you would be interested in? Or, do you any suggestions for us to implement them?
I am trying to modernize the stda program by removing its old integral deck, replacing it by libcint, also allowing new types of integrals that were not available. This is working perfectly fine for the overlap, dipole moment, and <i|nabla|j> integrals for which I can reproduce values obtained by our integral deck (see https://github.com/grimme-lab/stda/blob/master/intslvm.f and https://github.com/grimme-lab/stda/blob/master/intpack.f90).
But I have some issues with i<k|(r-Rc)Xp|n> type of integrals while using exactly the same interface, just replacing the name of the subroutine by cint1e_cg_irxp_cart. Note that everything is done with cartesian basis functions and that I have well defined Rc in env.
For integrals on the same atom, few elements have the reverse sign while others are ok for this skew-symmetric matrix.
For <d| |d> integrals, <dyy| |dxy>, <dzz| |dxz>, and <dzz| |dyz> signs are swapped with their counterpart.
For <f| |f> integrals, I have the same issue with <fzzz| |fxxy>, <fyyy| |fxxz>, <fyyy| |fyyx>, <fzzz| |fyyx>, <fyyy| |fxzz>, <fzzz| |fxzz>, <fzzz| |fyzz>, <fyyz| |fxzz>, <fyyz| |fxyz>, <fxzz| |fxyz>, and <fyzz| |fxyz>. All others are ok.
In addition to this, for integrals between two different atoms, I obtained different values than with our integral deck for <s| |fxxx>, <s| |fyyy>, <s| |fzzz>, <p| |fxxx>, <p| |fyyy>, <p| |fzzz>, <dxx| |dxx>, <dyy| |dyy>, <dzz| |dzz>, and almost all <f| |f>. Note that for <dxx| |dxx>, <dyy| |dyy>, and <dzz| |dzz> the sign is also wrong.
Those are what I was able to identify with small models.
Here are some examples:
1° case
For H- with one set of d orbitals:
[Atoms] Angs
H 1 1 0.00000000 0.00000000 0.00000000
[GTO]
1 0
d 1 1.000000
2.06200000E+00 1.00000000E+00
-------------- 1 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 2 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 3 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 4 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 5 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 6 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 7 --------------magnetic_moment
old 0.00000 0.00000 -1.15470
new 0.00000 0.00000 -1.15470
-------------- 8 --------------magnetic_moment
old 0.00000 0.00000 1.15470
new 0.00000 0.00000 -1.15470
**********************
-------------- 9 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 10 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 11 --------------magnetic_moment
old 0.00000 1.15470 0.00000
new 0.00000 1.15470 0.00000
-------------- 12 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 13 --------------magnetic_moment
old 0.00000 -1.15470 0.00000
new 0.00000 1.15470 0.00000
**********************
-------------- 14 --------------magnetic_moment
old -1.00000 0.00000 0.00000
new -1.00000 0.00000 0.00000
-------------- 15 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 16 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 17 --------------magnetic_moment
old -1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
-------------- 18 --------------magnetic_moment
old 1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
**********************
-------------- 19 --------------magnetic_moment
old 0.00000 1.00000 0.00000
new 0.00000 1.00000 0.00000
-------------- 20 --------------magnetic_moment
old 0.00000 0.00000 -1.00000
new 0.00000 0.00000 -1.00000
-------------- 21 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
These are the upper triangle of the skew-symmetric matrix where d orbitals are ordered as dxx dyy dzz dxy dxz dyz. Thus, 8, 13, and 18 are <dyy| |dxy>, <dzz| |dxz>, and <dzz| |dyz>, respectively.
2° case
Same system with one set of f functions.
[Atoms] Angs
H 1 1 0.00000000 0.00000000 0.00000000
[GTO]
1 0
f 1 1.000000
1.39700000E+00 1.00000000E+00
-------------- 1 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 2 --------------magnetic_moment
old 0.00000 0.00000 -0.60000
new 0.00000 0.00000 -0.60000
-------------- 3 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 4 --------------magnetic_moment
old 0.00000 0.60000 0.00000
new 0.00000 0.60000 0.00000
-------------- 5 --------------magnetic_moment
old -0.60000 0.00000 0.00000
new -0.60000 0.00000 0.00000
-------------- 6 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 7 --------------magnetic_moment
old 0.00000 0.00000 -1.34164
new 0.00000 0.00000 -1.34164
-------------- 8 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 9 --------------magnetic_moment
old 0.44721 0.00000 0.00000
new -0.44721 0.00000 0.00000
**********************
-------------- 10 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 11 --------------magnetic_moment
old 0.00000 1.34164 0.00000
new 0.00000 1.34164 0.00000
-------------- 12 --------------magnetic_moment
old -0.44721 0.00000 0.00000
new 0.44721 0.00000 0.00000
**********************
-------------- 13 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 14 --------------magnetic_moment
old -1.00000 0.00000 0.00000
new -1.00000 0.00000 0.00000
-------------- 15 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 16 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 17 --------------magnetic_moment
old 0.00000 0.00000 1.34164
new 0.00000 0.00000 -1.34164
**********************
-------------- 18 --------------magnetic_moment
old 0.00000 -0.44721 0.00000
new 0.00000 0.44721 0.00000
**********************
-------------- 19 --------------magnetic_moment
old 0.00000 0.00000 -1.00000
new 0.00000 0.00000 -1.00000
-------------- 20 --------------magnetic_moment
old 0.00000 -0.33333 0.00000
new 0.00000 -0.33333 0.00000
-------------- 21 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 22 --------------magnetic_moment
old 0.00000 0.44721 0.00000
new 0.00000 0.44721 0.00000
-------------- 23 --------------magnetic_moment
old -1.34164 0.00000 0.00000
new -1.34164 0.00000 0.00000
-------------- 24 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 25 --------------magnetic_moment
old -0.33333 0.00000 0.00000
new -0.33333 0.00000 0.00000
-------------- 26 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 27 --------------magnetic_moment
old 0.00000 1.00000 0.00000
new 0.00000 1.00000 0.00000
-------------- 28 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 29 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 30 --------------magnetic_moment
old 0.00000 0.00000 0.44721
new 0.00000 0.00000 -0.44721
**********************
-------------- 31 --------------magnetic_moment
old 0.00000 -1.34164 0.00000
new 0.00000 1.34164 0.00000
**********************
-------------- 32 --------------magnetic_moment
old 0.00000 0.00000 0.33333
new 0.00000 0.00000 0.33333
-------------- 33 --------------magnetic_moment
old 0.00000 1.00000 0.00000
new 0.00000 1.00000 0.00000
-------------- 34 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 35 --------------magnetic_moment
old 0.00000 -0.33333 0.00000
new 0.00000 0.33333 0.00000
**********************
-------------- 36 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 37 --------------magnetic_moment
old 0.00000 0.00000 -0.44721
new 0.00000 0.00000 -0.44721
-------------- 38 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 39 --------------magnetic_moment
old 1.34164 0.00000 0.00000
new -1.34164 0.00000 0.00000
**********************
-------------- 40 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 41 --------------magnetic_moment
old 0.33333 0.00000 0.00000
new 0.33333 0.00000 0.00000
-------------- 42 --------------magnetic_moment
old 0.00000 0.00000 -0.33333
new 0.00000 0.00000 -0.33333
-------------- 43 --------------magnetic_moment
old -1.00000 0.00000 0.00000
new -1.00000 0.00000 0.00000
-------------- 44 --------------magnetic_moment
old 0.00000 0.00000 -1.00000
new 0.00000 0.00000 -1.00000
-------------- 45 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 46 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 47 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 48 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 49 --------------magnetic_moment
old 0.00000 1.15470 0.00000
new 0.00000 1.15470 0.00000
-------------- 50 --------------magnetic_moment
old 0.00000 0.00000 -1.15470
new 0.00000 0.00000 -1.15470
-------------- 51 --------------magnetic_moment
old -1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
-------------- 52 --------------magnetic_moment
old 0.00000 0.00000 1.15470
new 0.00000 0.00000 -1.15470
**********************
-------------- 53 --------------magnetic_moment
old 1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
**********************
-------------- 54 --------------magnetic_moment
old 0.00000 -1.15470 0.00000
new 0.00000 1.15470 0.00000
**********************
-------------- 55 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
The f functions are ordered as fxxx, fyyy, fzzz, fxxy, fxxz, fyyx, fyyz, fxzz, fyzz, and fxyz. As for the case above, the upper diagonal is printed and problematic elements are <fzzz| |fxxy>, <fyyy| |fxxz>, <fyyy| |fyyx>, <fzzz| |fyyx>, <fyyy| |fxzz>, <fzzz| |fxzz>, <fzzz| |fyzz>, <fyyz| |fxzz>, <fyyz| |fxyz>, <fxzz| |fxyz>, and <fyzz| |fxyz>.
3° case
For CH4 with s functions on H and one set of f functions for the carbon.
[Atoms] Angs
C 1 6 -0.00000000 0.00000000 0.00000000
H 2 1 -0.61776480 0.61776480 0.61776480
H 3 1 0.61776480 -0.61776480 0.61776480
H 4 1 0.61776480 0.61776480 -0.61776480
H 5 1 -0.61776480 -0.61776480 -0.61776480
[GTO]
1 0
f 1 1.000000
1.41900000E+00 1.00000000E+00
2 0
s 1 1.000000
7.97700000E-01 1.00000000E+00
3 0
s 1 1.000000
7.97700000E-01 1.00000000E+00
4 0
s 1 1.000000
7.97700000E-01 1.00000000E+00
5 0
s 1 1.000000
7.97700000E-01 1.00000000E+00
-------------- 1 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 2 --------------magnetic_moment
old 0.00000 0.00000 -0.60000
new 0.00000 0.00000 -0.60000
-------------- 3 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 4 --------------magnetic_moment
old 0.00000 0.60000 0.00000
new 0.00000 0.60000 0.00000
-------------- 5 --------------magnetic_moment
old -0.60000 0.00000 0.00000
new -0.60000 0.00000 0.00000
-------------- 6 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 7 --------------magnetic_moment
old 0.00000 0.00000 -1.34164
new 0.00000 0.00000 -1.34164
-------------- 8 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 9 --------------magnetic_moment
old 0.44721 0.00000 0.00000
new -0.44721 0.00000 0.00000
**********************
-------------- 10 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 11 --------------magnetic_moment
old 0.00000 1.34164 0.00000
new 0.00000 1.34164 0.00000
-------------- 12 --------------magnetic_moment
old -0.44721 0.00000 0.00000
new 0.44721 0.00000 0.00000
**********************
-------------- 13 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 14 --------------magnetic_moment
old -1.00000 0.00000 0.00000
new -1.00000 0.00000 0.00000
-------------- 15 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 16 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 17 --------------magnetic_moment
old 0.00000 0.00000 1.34164
new 0.00000 0.00000 -1.34164
**********************
-------------- 18 --------------magnetic_moment
old 0.00000 -0.44721 0.00000
new 0.00000 0.44721 0.00000
**********************
-------------- 19 --------------magnetic_moment
old 0.00000 0.00000 -1.00000
new 0.00000 0.00000 -1.00000
-------------- 20 --------------magnetic_moment
old 0.00000 -0.33333 0.00000
new 0.00000 -0.33333 0.00000
-------------- 21 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 22 --------------magnetic_moment
old 0.00000 0.44721 0.00000
new 0.00000 0.44721 0.00000
-------------- 23 --------------magnetic_moment
old -1.34164 0.00000 0.00000
new -1.34164 0.00000 0.00000
-------------- 24 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 25 --------------magnetic_moment
old -0.33333 0.00000 0.00000
new -0.33333 0.00000 0.00000
-------------- 26 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 27 --------------magnetic_moment
old 0.00000 1.00000 0.00000
new 0.00000 1.00000 0.00000
-------------- 28 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 29 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 30 --------------magnetic_moment
old 0.00000 0.00000 0.44721
new 0.00000 0.00000 -0.44721
**********************
-------------- 31 --------------magnetic_moment
old 0.00000 -1.34164 0.00000
new 0.00000 1.34164 0.00000
**********************
-------------- 32 --------------magnetic_moment
old 0.00000 0.00000 0.33333
new 0.00000 0.00000 0.33333
-------------- 33 --------------magnetic_moment
old 0.00000 1.00000 0.00000
new 0.00000 1.00000 0.00000
-------------- 34 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 35 --------------magnetic_moment
old 0.00000 -0.33333 0.00000
new 0.00000 0.33333 0.00000
**********************
-------------- 36 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 37 --------------magnetic_moment
old 0.00000 0.00000 -0.44721
new 0.00000 0.00000 -0.44721
-------------- 38 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 39 --------------magnetic_moment
old 1.34164 0.00000 0.00000
new -1.34164 0.00000 0.00000
**********************
-------------- 40 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 41 --------------magnetic_moment
old 0.33333 0.00000 0.00000
new 0.33333 0.00000 0.00000
-------------- 42 --------------magnetic_moment
old 0.00000 0.00000 -0.33333
new 0.00000 0.00000 -0.33333
-------------- 43 --------------magnetic_moment
old -1.00000 0.00000 0.00000
new -1.00000 0.00000 0.00000
-------------- 44 --------------magnetic_moment
old 0.00000 0.00000 -1.00000
new 0.00000 0.00000 -1.00000
-------------- 45 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 46 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 47 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 48 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 49 --------------magnetic_moment
old 0.00000 1.15470 0.00000
new 0.00000 1.15470 0.00000
-------------- 50 --------------magnetic_moment
old 0.00000 0.00000 -1.15470
new 0.00000 0.00000 -1.15470
-------------- 51 --------------magnetic_moment
old -1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
-------------- 52 --------------magnetic_moment
old 0.00000 0.00000 1.15470
new 0.00000 0.00000 -1.15470
**********************
-------------- 53 --------------magnetic_moment
old 1.15470 0.00000 0.00000
new -1.15470 0.00000 0.00000
**********************
-------------- 54 --------------magnetic_moment
old 0.00000 -1.15470 0.00000
new 0.00000 1.15470 0.00000
**********************
-------------- 55 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 56 --------------magnetic_moment
old 0.00000 0.21382 -0.21382
new 0.00000 0.20626 -0.20626
***********************
-------------- 57 --------------magnetic_moment
old -0.21382 0.00000 -0.21382
new -0.20626 -0.00000 -0.20626
***********************
-------------- 58 --------------magnetic_moment
old 0.21382 0.21382 0.00000
new 0.20626 0.20626 0.00000
***********************
-------------- 59 --------------magnetic_moment
old -0.15374 -0.13497 -0.01877
new -0.15374 -0.13497 -0.01877
-------------- 60 --------------magnetic_moment
old 0.15374 0.01877 0.13497
new 0.15374 0.01877 0.13497
-------------- 61 --------------magnetic_moment
old 0.13497 0.15374 -0.01877
new 0.13497 0.15374 -0.01877
-------------- 62 --------------magnetic_moment
old 0.01877 0.15374 -0.13497
new 0.01877 0.15374 -0.13497
-------------- 63 --------------magnetic_moment
old -0.13497 0.01877 -0.15374
new -0.13497 0.01877 -0.15374
-------------- 64 --------------magnetic_moment
old -0.01877 0.13497 -0.15374
new -0.01877 0.13497 -0.15374
-------------- 65 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new -0.00000 -0.00000 0.00000
-------------- 66 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 67 --------------magnetic_moment
old 0.00000 0.21382 0.21382
new 0.00000 0.20626 0.20626
***********************
-------------- 68 --------------magnetic_moment
old -0.21382 0.00000 0.21382
new -0.20626 -0.00000 0.20626
***********************
-------------- 69 --------------magnetic_moment
old -0.21382 -0.21382 0.00000
new -0.20626 -0.20626 0.00000
***********************
-------------- 70 --------------magnetic_moment
old -0.15374 -0.13497 0.01877
new -0.15374 -0.13497 0.01877
-------------- 71 --------------magnetic_moment
old -0.15374 -0.01877 0.13497
new -0.15374 -0.01877 0.13497
-------------- 72 --------------magnetic_moment
old 0.13497 0.15374 0.01877
new 0.13497 0.15374 0.01877
-------------- 73 --------------magnetic_moment
old -0.01877 -0.15374 -0.13497
new -0.01877 -0.15374 -0.13497
-------------- 74 --------------magnetic_moment
old -0.13497 0.01877 0.15374
new -0.13497 0.01877 0.15374
-------------- 75 --------------magnetic_moment
old -0.01877 0.13497 0.15374
new -0.01877 0.13497 0.15374
-------------- 76 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 77 --------------magnetic_moment
old -0.02810 -0.02810 0.00000
new -0.02810 -0.02810 0.00000
-------------- 78 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 79 --------------magnetic_moment
old 0.00000 -0.21382 -0.21382
new 0.00000 -0.20626 -0.20626
***********************
-------------- 80 --------------magnetic_moment
old 0.21382 0.00000 0.21382
new 0.20626 -0.00000 0.20626
***********************
-------------- 81 --------------magnetic_moment
old 0.21382 -0.21382 0.00000
new 0.20626 -0.20626 0.00000
***********************
-------------- 82 --------------magnetic_moment
old 0.15374 -0.13497 0.01877
new 0.15374 -0.13497 0.01877
-------------- 83 --------------magnetic_moment
old 0.15374 -0.01877 0.13497
new 0.15374 -0.01877 0.13497
-------------- 84 --------------magnetic_moment
old 0.13497 -0.15374 -0.01877
new 0.13497 -0.15374 -0.01877
-------------- 85 --------------magnetic_moment
old 0.01877 -0.15374 -0.13497
new 0.01877 -0.15374 -0.13497
-------------- 86 --------------magnetic_moment
old -0.13497 -0.01877 -0.15374
new -0.13497 -0.01877 -0.15374
-------------- 87 --------------magnetic_moment
old 0.01877 0.13497 0.15374
new 0.01877 0.13497 0.15374
-------------- 88 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 -0.00000 0.00000
-------------- 89 --------------magnetic_moment
old 0.02810 0.00000 0.02810
new 0.02810 0.00000 0.02810
-------------- 90 --------------magnetic_moment
old 0.00000 -0.02810 -0.02810
new 0.00000 -0.02810 -0.02810
-------------- 91 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
-------------- 92 --------------magnetic_moment
old 0.00000 -0.21382 0.21382
new 0.00000 -0.20626 0.20626
***********************
-------------- 93 --------------magnetic_moment
old 0.21382 0.00000 -0.21382
new 0.20626 -0.00000 -0.20626
***********************
-------------- 94 --------------magnetic_moment
old -0.21382 0.21382 0.00000
new -0.20626 0.20626 0.00000
***********************
-------------- 95 --------------magnetic_moment
old 0.15374 -0.13497 -0.01877
new 0.15374 -0.13497 -0.01877
-------------- 96 --------------magnetic_moment
old -0.15374 0.01877 0.13497
new -0.15374 0.01877 0.13497
-------------- 97 --------------magnetic_moment
old 0.13497 -0.15374 0.01877
new 0.13497 -0.15374 0.01877
-------------- 98 --------------magnetic_moment
old -0.01877 0.15374 -0.13497
new -0.01877 0.15374 -0.13497
-------------- 99 --------------magnetic_moment
old -0.13497 -0.01877 0.15374
new -0.13497 -0.01877 0.15374
-------------- 100 --------------magnetic_moment
old 0.01877 0.13497 -0.15374
new 0.01877 0.13497 -0.15374
-------------- 101 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new -0.00000 0.00000 0.00000
-------------- 102 --------------magnetic_moment
old 0.00000 0.02810 -0.02810
new 0.00000 0.02810 -0.02810
-------------- 103 --------------magnetic_moment
old -0.02810 0.00000 0.02810
new -0.02810 0.00000 0.02810
-------------- 104 --------------magnetic_moment
old 0.02810 -0.02810 0.00000
new 0.02810 -0.02810 0.00000
-------------- 105 --------------magnetic_moment
old 0.00000 0.00000 0.00000
new 0.00000 0.00000 0.00000
Same problem for f functions as above and in addition we have issues with <s| |fxxx>, <s| |fyyy>, and <s| |fzzz> integrals.
Other issues can be revealed in the same way. Can you help me with this?
Many thanks,
Marc
I'm unclear about how to properly set env[PTR_EXPCUTOFF]
to achieve the desired results in my code.
The README states:
Small integrals (< 1e-18 by default) are set to 0. If they are used in Schwarz inequality to estimate upper limit of an integral, the default integral cutoff might not be accurate enough. It can be adjusted by the parameter env[PTR_EXPCUTOFF] (since libcint 4.0). This parameter needs to be set to log(cutoff_threshold).
I read that to mean that, if I wanted to apply a Schwarz threshold of, say, 1.0e-14, I would need to set env[PTR_EXPCUTOFF] = log(1.0e-14) \approx -32.236
.
However, looking in the code, in cint_const.h
, I see:
#define EXPCUTOFF 60
#ifndef MIN_EXPCUTOFF
// ~ 1e-15
#define MIN_EXPCUTOFF 40
#endif
Then, in (for example) g2c2e.c
, these constants are used like
if (env[PTR_EXPCUTOFF] == 0) {
envs->expcutoff = EXPCUTOFF;
} else {
envs->expcutoff = MAX(MIN_EXPCUTOFF, env[PTR_EXPCUTOFF]);
}
If I'm reading this right, this means that the only meaningful setting of env[PTR_EXPCUTOFF]
that would change behaviour is one such that env[PTR_EXPCUTOFF] > MIN_EXPCUTOFF == 40
. That would imply a threshold of greater than 2.35+17
, which surely can't be right.
Should the setting perhaps be the absolute value of log(cutoff_threshold)
?
I am trying to use libcint to generate integrals to a Julia code, but the example provided seems to be broken.
When I run the script examples/julia_call.jl
I get
┌ Info: Input
│ atm =
│ 2×6 Array{Int32,2}:
│ 1 20 0 0 0 0
│ 1 23 0 0 0 0
│ bas =
│ 4×8 Array{Int32,2}:
│ 0 0 3 2 0 23 26 0
│ 0 1 1 1 0 32 33 0
│ 0 0 3 2 0 23 26 0
└ 0 1 1 1 0 32 33 0
┌ Info: ∇⟨i|nuc|j⟩ =
│ permutedims(buf, (3, 2, 1)) =
│ 2×3×3 Array{Float64,3}:
│ [:, :, 1] =
│ 6.01737e8 0.0 0.0
│ 3.76086e8 0.0 0.0
│
│ [:, :, 2] =
│ 3.76086e8 0.0 0.0
│ 0.0 0.0 7.88785e8
│
│ [:, :, 3] =
│ 0.0 0.0 6.01737e8
└ 0.0 0.0 4.92991e8
Whereas the python script examples/python_call.py
returns
[[[3.63502112 0. 0. ]
[0. 3.63502112 0. ]
[0. 0. 3.84044294]]
[[1.86699135 0. 0. ]
[0. 1.86699135 0. ]
[0. 0. 1.96369558]]]
The former is numerically unstable, but I am unable to find the problem yet.
Hi,
Is there a way to compute 3-centre 1-electron overlap integrals using libcint/qcint?
Is it the function int3c1e_sph
?
mkoehler-mobl1:build jrhammon$ make test
make: *** No rule to make target `test'. Stop.
mkoehler-mobl1:build jrhammon$ make test ARGS=-V
make: *** No rule to make target `test'. Stop.
mkoehler-mobl1:build jrhammon$ grep test Makefile
mkoehler-mobl1:build jrhammon$
Hi,
When I am computing short range coulomb integrals with PTR_RANGE_OMEGA = - 0.1 for example, I get the following error(s):
libcint::rys_roots negative value in sqrt for roots 2 (j=2)
libcint::rys_roots negative value in sqrt for roots 3 (j=3)
libcint::rys_roots negative value in sqrt for roots 2 (j=2)
etc...
It worked in version 4.0.7, but no longer works since 60d233f
Trying to update the Fedora package of libcint to 4.0.5, I ran into test failures on both x86 and x86_64 architectures:
Checking test dependency graph end
test 1
Start 1: cinttest
1: Test command: /usr/bin/python3.9 "/builddir/build/BUILD/libcint-4.0.5/testsuite/test_cint.py" "--quick"
1: Test timeout computed to be: 10000000
1/2 Test #1: cinttest .........................***Failed 2.15 sec
The builds, however, succeed on armv7hl, aarch64, and s390x architectures.
Build logs on the failing architectures
i386.log
x86_64.log
Hello,
I got the 3-center overlap matrix for Cartesian GTOs by setting intor='int3c1e_cart' in the function df.incore.aux_e2. However, I noticed that the matrix has nan elements, as well as elements greater than 1e+200. My question is, why is this happening?
The corresponding matrix for spherical GTOs, for the same molecule and bases, obtained by intor='int3c1e_sph', doesn't have this problem.
Here is my full code:
from pyscf import gto,scf,df
import numpy as np
basis = 'cc-pvdz'
auxbasis = 'cc-pvdz-ri'
atom = 'H 0 0 0; H 1 0 0'
mol = gto.M(atom=atom, basis=basis)
auxmol = df.addons.make_auxmol(mol, auxbasis)
M = df.incore.aux_e2(mol, auxmol, intor='int3c1e_cart')
print('nan elem\n', np.argwhere(np.isnan(M)))
print('big elem\n', np.argwhere(1e+200 < M))
Magnetizabilities obtained with libcint 3.0.19 vs qcint 3.0.19 differ, see pyscf/pyscf#606.
Is there a easy way to obtain single precision integrals?
I tried the naive/brute force approach of changing all double
to float
and recompile , but unsurprisingly it did not work.
Building and compiling the libcint
examples in debug mode produces errors of the form ../libcint.so.4.1.3: undefined reference to `_powl'
. For example, on my Ubuntu 18.04 LTS machine with the system GCC, if I configure as:
$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_EXAMPLE=ON
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test QUADMATH_FOUND
-- Performing Test QUADMATH_FOUND - Success
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- A library with BLAS API found.
-- Looking for expl
-- Looking for expl - found
-- Looking for sqrtl
-- Looking for sqrtl - found
P orbitals convention (px, py, pz)
Enable Fortran interface
Enable old cint (version 2) interface
-- The Fortran compiler identification is GNU 7.5.0
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Configuring done
-- Generating done
-- Build files have been written to: <ELIDED>
errors occur when I build as:
$ make
Scanning dependencies of target cint
[ 1%] Building C object CMakeFiles/cint.dir/src/c2f.c.o
[ 3%] Building C object CMakeFiles/cint.dir/src/cart2sph.c.o
[ 5%] Building C object CMakeFiles/cint.dir/src/cint1e.c.o
[ 7%] Building C object CMakeFiles/cint.dir/src/cint2e.c.o
[ 9%] Building C object CMakeFiles/cint.dir/src/cint_bas.c.o
[ 10%] Building C object CMakeFiles/cint.dir/src/fblas.c.o
[ 12%] Building C object CMakeFiles/cint.dir/src/g1e.c.o
[ 14%] Building C object CMakeFiles/cint.dir/src/g2e.c.o
[ 16%] Building C object CMakeFiles/cint.dir/src/misc.c.o
[ 18%] Building C object CMakeFiles/cint.dir/src/optimizer.c.o
[ 20%] Building C object CMakeFiles/cint.dir/src/fmt.c.o
[ 21%] Building C object CMakeFiles/cint.dir/src/rys_wheeler.c.o
[ 23%] Building C object CMakeFiles/cint.dir/src/eigh.c.o
[ 25%] Building C object CMakeFiles/cint.dir/src/rys_roots.c.o
[ 27%] Building C object CMakeFiles/cint.dir/src/cint2c2e.c.o
[ 29%] Building C object CMakeFiles/cint.dir/src/g2c2e.c.o
[ 30%] Building C object CMakeFiles/cint.dir/src/cint3c2e.c.o
[ 32%] Building C object CMakeFiles/cint.dir/src/g3c2e.c.o
[ 34%] Building C object CMakeFiles/cint.dir/src/cint3c1e.c.o
[ 36%] Building C object CMakeFiles/cint.dir/src/g3c1e.c.o
[ 38%] Building C object CMakeFiles/cint.dir/src/breit.c.o
[ 40%] Building C object CMakeFiles/cint.dir/src/cint4c1e.c.o
[ 41%] Building C object CMakeFiles/cint.dir/src/g4c1e.c.o
[ 43%] Building C object CMakeFiles/cint.dir/src/cint1e_a.c.o
[ 45%] Building C object CMakeFiles/cint.dir/src/cint3c1e_a.c.o
[ 47%] Building C object CMakeFiles/cint.dir/src/autocode/breit1.c.o
[ 49%] Building C object CMakeFiles/cint.dir/src/autocode/dkb.c.o
[ 50%] Building C object CMakeFiles/cint.dir/src/autocode/gaunt1.c.o
[ 52%] Building C object CMakeFiles/cint.dir/src/autocode/grad1.c.o
[ 54%] Building C object CMakeFiles/cint.dir/src/autocode/grad2.c.o
[ 56%] Building C object CMakeFiles/cint.dir/src/autocode/hess.c.o
[ 58%] Building C object CMakeFiles/cint.dir/src/autocode/int3c1e.c.o
[ 60%] Building C object CMakeFiles/cint.dir/src/autocode/int3c2e.c.o
[ 61%] Building C object CMakeFiles/cint.dir/src/autocode/intor1.c.o
[ 63%] Building C object CMakeFiles/cint.dir/src/autocode/intor2.c.o
[ 65%] Building C object CMakeFiles/cint.dir/src/autocode/intor3.c.o
[ 67%] Building C object CMakeFiles/cint.dir/src/autocode/intor4.c.o
[ 69%] Building C object CMakeFiles/cint.dir/src/autocode/deriv3.c.o
[ 70%] Linking C shared library libcint.so
[ 70%] Built target cint
Scanning dependencies of target time_c2h6
[ 72%] Building C object examples/CMakeFiles/time_c2h6.dir/time_c2h6.c.o
[ 74%] Linking C executable time_c2h6
../libcint.so.4.1.3: undefined reference to `_powl'
../libcint.so.4.1.3: undefined reference to `_pow'
../libcint.so.4.1.3: undefined reference to `_powq'
collect2: error: ld returned 1 exit status
The likely cause of this is that the three functions _powl
, _pow
, and _powq
in fmt.c
are declared inline
. I think this is running up against undefined behaviour, cf. here, specifically:
In order to avoid undefined behavior, one external definition must exist in the program if the name of the function with external linkage is used in an expression, see one definition rule.
Assuming that the intention for these functions is for them to used locally only and for the compiler to be suggested to inline them, this issue can be fixed by changing the inline
specifiers to static inline
.
C99 requires explicit function declarations. Because the latest Clang and GCC default to C11, your library will not compile with these compilers.
[ 4%] Building C object CMakeFiles/cint.dir/src/c2f.c.o
[ 8%] Building C object CMakeFiles/cint.dir/src/cart2sph.c.o
[ 12%] Building C object CMakeFiles/cint.dir/src/cint1e.c.o
[ 16%] Building C object CMakeFiles/cint.dir/src/cint2e.c.o
[ 20%] Building C object CMakeFiles/cint.dir/src/cint_bas.c.o
[ 24%] Building C object CMakeFiles/cint.dir/src/fblas.c.o
[ 28%] Building C object CMakeFiles/cint.dir/src/g1e.c.o
[ 32%] Building C object CMakeFiles/cint.dir/src/g2e.c.o
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/g2e.c(1738): warning #266: function "CINTg0_kj2d_3d" declared implicitly
CINTg0_kj2d_3d(g, envs);
^
[ 36%] Building C object CMakeFiles/cint.dir/src/misc.c.o
[ 40%] Building C object CMakeFiles/cint.dir/src/optimizer.c.o
[ 44%] Building C object CMakeFiles/cint.dir/src/rys_roots.c.o
[ 48%] Building C object CMakeFiles/cint.dir/src/cint2c2e.c.o
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/cint2c2e.c(446): warning #266: function "CINTinit_int2c2e_EnvVars" declared implicitly
CINTinit_int2c2e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/cint2c2e.c(466): warning #266: function "CINTinit_int2c2e_EnvVars" declared implicitly
CINTinit_int2c2e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
^
[ 52%] Building C object CMakeFiles/cint.dir/src/g2c2e.c.o
[ 56%] Building C object CMakeFiles/cint.dir/src/cint3c2e.c.o
[ 60%] Building C object CMakeFiles/cint.dir/src/g3c2e.c.o
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/g3c2e.c(308): warning #266: function "CINTg0_2e_2d" declared implicitly
CINTg0_2e_2d(g, bc, envs);
^
[ 64%] Building C object CMakeFiles/cint.dir/src/optimizer_3c2e.c.o
[ 68%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor1.c.o
[ 72%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor2.c.o
[ 76%] Building C object CMakeFiles/cint.dir/src/autocode/auto_intor3.c.o
[ 80%] Building C object CMakeFiles/cint.dir/src/autocode/gaunt1.c.o
[ 84%] Building C object CMakeFiles/cint.dir/src/autocode/grad1.c.o
[ 88%] Building C object CMakeFiles/cint.dir/src/autocode/grad2.c.o
[ 92%] Building C object CMakeFiles/cint.dir/src/autocode/grad3.c.o
[ 96%] Building C object CMakeFiles/cint.dir/src/autocode/auto_hess.c.o
[100%] Building C object CMakeFiles/cint.dir/src/autocode/auto_3c2e.c.o
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(111): warning #266: function "CINT3c2e_spheric_drv" declared implicitly
return CINT3c2e_spheric_drv(opijkl, &envs, opt);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(210): warning #266: function "CINT3c2e_spheric_drv" declared implicitly
return CINT3c2e_spheric_drv(opijkl, &envs, opt);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(307): warning #266: function "CINT2c2e_spheric_drv" declared implicitly
return CINT2c2e_spheric_drv(opijkl, &envs, opt);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(404): warning #266: function "CINT2c2e_spheric_drv" declared implicitly
return CINT2c2e_spheric_drv(opijkl, &envs, opt);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(603): warning #266: function "CINT3c2e_spinor_drv" declared implicitly
return CINT3c2e_spinor_drv(opijkl, &envs, opt, &c2s_sf_3c2e1);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(702): warning #266: function "CINT3c2e_spinor_drv" declared implicitly
return CINT3c2e_spinor_drv(opijkl, &envs, opt, &c2s_sf_3c2e1);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(771): warning #266: function "CINT3c2e_spinor_drv" declared implicitly
return CINT3c2e_spinor_drv(opijkl, &envs, opt, &c2s_si_3c2e1);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(882): warning #266: function "CINT3c2e_spinor_drv" declared implicitly
return CINT3c2e_spinor_drv(opijkl, &envs, opt, &c2s_si_3c2e1);
^
/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/src/autocode/auto_3c2e.c(993): warning #266: function "CINT3c2e_spinor_drv" declared implicitly
return CINT3c2e_spinor_drv(opijkl, &envs, opt, &c2s_si_3c2e1);
^
Linking C shared library libcint.dylib
[100%] Built target cint
make: *** No rule to make target `test'. Stop.
Hi,
I am included in a project where we want to implement Polarizable Embedding in PySCF.
For this we field, field-gradient, .. integrals.
I have tried to add these integrals through the auto_intor.cl script by adding:
'("inte1e_d1rinv" (\| nabla rinv |\))
'("inte1e_d2rinv" (\| nabla nabla rinv |\))
To the "grad1.c" section.
The code compiles and gives a result in PySCF, but it differs alot from the result that I get if I do a finite difference with "int1e_rinv".
The finite difference is simply done as:
step = 10**-5
mol.set_rinv_orig((step,0,0))
rinvp = mol.intor("int1e_rinv")
mol.set_rinv_orig((-step,0,0))
rinvm = mol.intor("int1e_rinv")
field_finite = (rinvp - rinvm)/(2*step)
I have also tried to use the "nabla-rinv" operator in auto_intor.cl, by adding:
'("inte1e_d1rinv2" (\| nabla-rinv |\))
This yield a compilation error:
/home/kjellgren/libcint/src/autocode/grad1.c: In function ‘CINTgout1e_int1e_d1rinv2’:
/home/kjellgren/libcint/src/autocode/grad1.c:487:9: error: ‘g2’ undeclared (first use in this function);
did you mean ‘g1’?
G1E_D_I(g2, g0, envs->i_l+0, envs->j_l+0, 0);
Also it dosen't quite lead to the field-gradient integrals.
To get the field, field-gradient, ... integrals, what would be the correct operators to use in the auto_intor.cl? Seem like "nabla rinv" gives something else than I expect.
The website at http://wiki.sunqm.net/libcint shows:
502 Bad Gateway
nginx/0.7.67
Hi, I am currently switching from libint2 to libcint, and I have a question about scaling coefficients.
As shown in the examples, I scale the basis set coefficients with CINTgto_norm
before passing them to libcint.
However, when I compute the (spherical) overlap integrals, I only get 1 for GTOs that are uncontracted. How do I scale coefficients in order to force unity for overlap integrals for contracted GTOs? I know that for cartesian GTOs you need to scale with the diagonal of the overlap matrix, but I'm not sure how to do it for spherical.
Hi,
I have a super stupid question. I tried to use libcint
via gfortran
, in order to load libcint
for other Fortran
computations.
I managed to proceed in https://github.com/sunqm/libcint up to Build static library (optional)
, looks alright.
Then I started from a simple case, gfortran fortran_call_cartesian.F90
. It leads to
usr/bin/ld: /tmp/ccgyN6Zq.o: in function `MAIN__':
fortran_call_cartesian.F90:(.text+0x841): undefined reference to `cintgto_norm_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x8ea): undefined reference to `cintgto_norm_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x993): undefined reference to `cintgto_norm_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0xa3c): undefined reference to `cintgto_norm_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0xae5): undefined reference to `cintgto_norm_'
/usr/bin/ld: /tmp/ccgyN6Zq.o:fortran_call_cartesian.F90:(.text+0xb8e): more undefined references to `cintgto_norm_' follow
/usr/bin/ld: /tmp/ccgyN6Zq.o: in function `MAIN__':
fortran_call_cartesian.F90:(.text+0x1112): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1144): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x139b): undefined reference to `cint1e_ipovlp_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x14e3): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1515): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1547): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1579): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x18b5): undefined reference to `cint2e_ip1_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1a06): undefined reference to `cint2e_ip1_cart_optimizer_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1a35): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1a67): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1a99): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1acb): undefined reference to `cintcgto_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1e07): undefined reference to `cint2e_ip1_cart_'
/usr/bin/ld: fortran_call_cartesian.F90:(.text+0x1f2f): undefined reference to `cintdel_optimizer_'
collect2: error: ld returned 1 exit status
In ./build/examples/CMakeFiles/cartesian_f.dir/build.make:
there is `cd /home/user-3/Research/libcint/libcint/build/examples && /usr/bin/gfortran
I tried to grep Fortran_DEFINES
, Fortran_INCLUDES
, and Fortran_FLAGS
, looked at the program_ref.pdf
, is there any more straightforward way to use libcint
with Fortran? I assume I need makefile
, perhaps I am not familiar with it.. used other people's makefile
previously. Thank you very much.
Hi Qiming,
When downloading libcint via pyscf, line 3 of CMakeLists.txt is
set(qcint_VERSION "1.6")
and line 52 is
VERSION ${cint_VERSION}
causing an error..
Hello,
I am trying to package libcint 3.1.1 to openSUSE.
https://build.opensuse.org/package/show/home:andythe_great/libcint
I have found that some file go to /usr/usr/lib64/ directory. As shown below.
/usr/usr/lib64/libcint.so.3.1.1
/usr/usr/lib64/libcint.so.3
/usr/usr/lib64/libcint.so
I then patch CMakeLists.txt (fix_lib_install_dir.patch in the repo) like this,
-install(TARGETS cint DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" COMPONENT "lib")
+install(TARGETS cint DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT "lib")
Which fix the issue, the file now go to /usr/lib64/ normally.
Is this an issue?
Thank you.
libcint-4.4.0/src/cint3c2e.c:756:1: warning: all paths through this function will call itself [-Winfinite-recursion]
Source code is
void int3c2e_ssc_optimizer(CINTOpt **opt, FINT *atm, FINT natm,
FINT *bas, FINT nbas, double *env)
{
int3c2e_ssc_optimizer(opt, atm, natm, bas, nbas, env);
}
I'm trying to get this library into vcpkg and while compiling the library through their pipleine I encounter a lot of syntax errors, could be a problem with their pipeline though.
vcpkg issue:
link
The following is the output log (partially in german):
config-x64-windows-out.log
Hello! I am trying to generate an integral with a 1/r^2 operator. Is there an easy method to generate new operators? Otherwise, is there an existing method I can tweak as a workaround? Thanks in advance.
Hi @sunqm, as far as I know, libcint supports up to 2nd order energy derivatives w.r.t. atomic coordinates (Hessian). I'm wondering if it's also capable of calculating 3rd and higher order energy derivatives. If not, is there any plan to implement this feature?
The code uses incompatible versions of the atm
macro in the example code, at least according to the Intel compiler:
warning #47: incompatible redefinition of macro "atm" (declared at line 88 of "/Users/jrhammon/Work/CHEMISTRY/LIBCINT/git/build/include/cint.h")
#define atm(X,Y) atm[(X)+(Y)*ATM_SLOTS]
I can see the usage is not incompatible, but it would be better to remove the duplicate.
In addition, I think using atm
as a macro is dangerous because it doesn't look like a macro (ATM
would be better). Furthermore, int *atm
where atm
is a macro is a bit dangerous.
Finally, if cint.h
is included in user code, then the use will be unable to use atm
as a symbol anywhere, which isn't obvious. If possible, not having such macros in the public header is preferred.
I will submit a pull request to fix this in a second.
in include/cint.h
#define bas(SLOT,I) bas[BAS_SLOTS * (I) + (SLOT)]
#define atm(SLOT,I) atm[ATM_SLOTS * (I) + (SLOT)]
in examples/time_c2h6.c
#include "cint.h"
#define atm(X,Y) atm[(X)+(Y)*ATM_SLOTS]
void run_all(int *atm, int natm, int *bas, int nbas, double *env);
int cint2e_ip1_sph(double *buf, int *shls,
int *atm, int natm, int *bas, int nbas, double *env,
CINTOpt *opt);
void cint2e_ip1_sph_optimizer(CINTOpt **opt, int *atm, int natm,
int *bas, int nbas, double *env);
Hello,
I have been trying to update libcint to 4.0.5.
I encounter an error below while building it for openSUSE Tumbleweed.
I build libcint 3.1.1 before which has no error.
Full log here: https://build.opensuse.org/package/live_build_log/home:andythe_great/libcint/openSUSE_Tumbleweed/x86_64
Thanks.
[ 41s] /home/abuild/rpmbuild/BUILD/libcint-4.0.5/src/rys_roots.c: In function 'R_qsmit':
[ 41s] /home/abuild/rpmbuild/BUILD/libcint-4.0.5/src/rys_roots.c:2150:1: error: control reaches end of non-void function [-Werror=return-type]
[ 41s] 2150 | }
[ 41s] | ^
[ 41s] cc1: some warnings being treated as errors
Hello,
I am trying to package libcint to openSUSE.
https://build.opensuse.org/package/show/home:andythe_great/libcint
I got a warning from RPMLINT as shown below.
libcint3.x86_64: W: shared-lib-calls-exit /usr/lib64/libcint.so.3.1.1 exit@GLIBC_2.2.5
This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.
Not sure what this meant.
Thank you.
To get the python interface example to run, I've had to modify,
atm = numpy.array(atm,dtype=int32)
bas = numpy.array(bas,dtype=int32)
to
atm = numpy.array(atm,dtype=numpy.int32)
bas = numpy.array(bas,dtype=numpy.int32)
and
di = _cint.CINTcgto_spheric(ctypes.c_int(0), bas.data)
to
di = _cint.CINTcgto_spheric(ctypes.c_int(0), bas.ctypes.data)
However, I am still getting a segmentation fault. Here is my full code I am trying to run.
from math import *
import numpy
import ctypes
# general contracted DZ basis [3s1p/2s1p] for H2
# exponents contract-coeff
# S 6.0 0.7 0.4
# 2.0 0.6 0.3
# 0.8 0.5 0.2
# P 0.9 1.
def gto_norm(n, a):
# normalization factor of function r^n e^{-a r^2}
s = 2**(2*n+3) * factorial(n+1) * (2*a)**(n+1.5) \
/ (factorial(2*n+2) * sqrt(pi))
return sqrt(s)
CHARGE_OF = 1
PTR_COORD = 2
NUC_MOD_OF = 3
PTR_ZETA = 4
ATM_SLOTS = 6
ATOM_OF = 1
ANG_OF = 2
NPRIM_OF = 3
NCTR_OF = 4
KAPPA_OF = 5
PTR_EXP = 6
PTR_COEFF = 7
BAS_SLOTS = 8
ptr_env = 20
atm = []
bas = []
env = [0] * ptr_env
i = 0
# CHARGE_OF,PTR_COORD
atm.append([1, ptr_env, 0, 0, 0, 0])
# x y z (Bohr)
env.extend([0, 0, -0.8])
ptr_env += 3
atm.append([1, ptr_env, 0, 0, 0, 0])
env.extend([0, 0, 0.8])
# basis for atom #0
# 3s -> 2s
env.extend([6., 2., .8])
env.extend([.7, .6, .5, .4, .3, .2])
# ATOM_OF, ANG_OF, NPRIM_OF, NCTR_OF, KAPPA_OF, PTR_EXP, PTR_COEFF
bas.append([0, 0, 3, 2, 0, ptr_env, ptr_env+3, 0])
ptr_env += 9
env.extend([.9])
env.extend([1.])
bas.append([0, 1, 1, 1, 0, ptr_env, ptr_env+1, 0])
ptr_env += 1
# basis functions for atom #1, they are the same to thoes of atom #0
bas.extend(bas[-2:])
# note the integer type
atm = numpy.array(atm,dtype=numpy.int32)
bas = numpy.array(bas,dtype=numpy.int32)
env = numpy.array(env)
_cint = ctypes.cdll.LoadLibrary('/home/mmd01986/Dropbox/dev/libcint/build/libcint.so')
c_natm = ctypes.c_int(atm.size)
c_nbas = ctypes.c_int(bas.size)
_cint.CINTcgto_spheric.restype = ctypes.c_int
di = _cint.CINTcgto_spheric(ctypes.c_int(0), bas.ctypes.data)
dj = _cint.CINTcgto_spheric(ctypes.c_int(1), bas.ctypes.data)
c_shls = (ctypes.c_int * 2)(0, 1)
buf = numpy.empty((di.value, dj.value, 3))
_cint.cint1e_ipnuc_sph(buf.ctypes.data, c_shls, \
atm.ctypes.data, c_natm, \
bas.ctypes.data, c_nbas,
env.ctypes.data)
Hi,
Just wanted to note that your tests (at least) are written in python2, and python2 is now officially deprecated.
A built-in python tool to convert to python3 syntax is 2to3
, which is in python2.7. https://docs.python.org/3.9/library/2to3.html
Any plans for updates?
Seems to compile fine, but make test
fails on the second test set. Not sure how to make test more verbose, so it's unclear to me what may be wrong. Let me know and I can give more information.
Running tests...
Test project /home/jjgoings/libcint/build
Start 1: cinttest
1/2 Test #1: cinttest ......................... Passed 95.57 sec
Start 2: cint3c2etest
2/2 Test #2: cint3c2etest .....................***Failed 0.16 sec
50% tests passed, 1 tests failed out of 2
Total Test time (real) = 95.73 sec
The following tests FAILED:
2 - cint3c2etest (Failed)
Errors while running CTest
Makefile:105: recipe for target 'test' failed
make: *** [test] Error 8
Compiling libcint and qcint 4.4.2 gives a GCC warning
/home/susi/fedora/qcint/rawhide/qcint-4.4.2/src/eigh.c: In function '_CINTdiagonalize.part.0':
/home/susi/fedora/qcint/rawhide/qcint-4.4.2/src/eigh.c:847:14: warning: array subscript -1 is outside array bounds of 'double[289]' [-Warray-bounds]
847 | wgap[-1] = MAX(0., w[0] - werr[0] - gl);
| ^
/home/susi/fedora/qcint/rawhide/qcint-4.4.2/src/eigh.c:1463:12: note: while referencing 'work'
1463 | double work[MXRYSROOTS * 9 + 1];
| ^~~~
Is this intentional?
openblas-0.3.3 only installs /usr/local/lib/libopenblas.so
, and provides .pc
file for its discovery with pkg-config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.