diff --git a/CMakeLists.txt b/CMakeLists.txt index 409e73bf..20a610b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.5) project (cint C) set(cint_VERSION_MAJOR "6") -set(cint_VERSION_MINOR "0") +set(cint_VERSION_MINOR "1") set(cint_VERSION_PATCH "0") set(cint_VERSION_TWEAK "0") set(cint_VERSION "${cint_VERSION_MAJOR}.${cint_VERSION_MINOR}.${cint_VERSION_PATCH}") diff --git a/ChangeLog b/ChangeLog index e1b612a4..3fe6232b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Version 6.1.0 (2023-11-10): + * New second order derivative integrals int1e_grids_ipip + Version 6.0.0 (2023-09-17): * Add polynomial root finder using the eigenvalue algorithm * Fitting Rys roots of SR integrals with Chebyshev polynomials diff --git a/README.rst b/README.rst index 18f80d8b..fd953f4b 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ libcint ======= -version 6.0.0 -2023-09-17 +version 6.1.0 +2023-11-10 What is libcint diff --git a/include/cint_funcs.h b/include/cint_funcs.h index adc9eb5f..9d65fb21 100644 --- a/include/cint_funcs.h +++ b/include/cint_funcs.h @@ -1090,6 +1090,24 @@ extern CINTIntegralFunction int1e_ipiprinvip_cart; extern CINTIntegralFunction int1e_ipiprinvip_sph; extern CINTIntegralFunction int1e_ipiprinvip_spinor; +/* */ +extern CINTOptimizerFunction int1e_ipiprinvipip_optimizer; +extern CINTIntegralFunction int1e_ipiprinvipip_cart; +extern CINTIntegralFunction int1e_ipiprinvipip_sph; +extern CINTIntegralFunction int1e_ipiprinvipip_spinor; + +/* */ +extern CINTOptimizerFunction int1e_ipipiprinvip_optimizer; +extern CINTIntegralFunction int1e_ipipiprinvip_cart; +extern CINTIntegralFunction int1e_ipipiprinvip_sph; +extern CINTIntegralFunction int1e_ipipiprinvip_spinor; + +/* */ +extern CINTOptimizerFunction int1e_ipipipiprinv_optimizer; +extern CINTIntegralFunction int1e_ipipipiprinv_cart; +extern CINTIntegralFunction int1e_ipipipiprinv_sph; +extern CINTIntegralFunction int1e_ipipipiprinv_spinor; + /* */ extern CINTOptimizerFunction int1e_grids_ip_optimizer; extern CINTIntegralFunction int1e_grids_ip_cart; @@ -1108,20 +1126,33 @@ extern CINTIntegralFunction int1e_grids_spvsp_cart; extern CINTIntegralFunction int1e_grids_spvsp_sph; extern CINTIntegralFunction int1e_grids_spvsp_spinor; -/* */ -extern CINTOptimizerFunction int1e_ipiprinvipip_optimizer; -extern CINTIntegralFunction int1e_ipiprinvipip_cart; -extern CINTIntegralFunction int1e_ipiprinvipip_sph; -extern CINTIntegralFunction int1e_ipiprinvipip_spinor; +/* */ +extern CINTOptimizerFunction int1e_grids_ipip_optimizer; +extern CINTIntegralFunction int1e_grids_ipip_cart; +extern CINTIntegralFunction int1e_grids_ipip_sph; +extern CINTIntegralFunction int1e_grids_ipip_spinor; + +/* */ +extern CINTOptimizerFunction int1e_iprinvr_optimizer; +extern CINTIntegralFunction int1e_iprinvr_cart; +extern CINTIntegralFunction int1e_iprinvr_sph; +extern CINTIntegralFunction int1e_iprinvr_spinor; + +/* */ +extern CINTOptimizerFunction int1e_iprinviprip_optimizer; +extern CINTIntegralFunction int1e_iprinviprip_cart; +extern CINTIntegralFunction int1e_iprinviprip_sph; +extern CINTIntegralFunction int1e_iprinviprip_spinor; + +/* */ +extern CINTOptimizerFunction int1e_rinvipiprip_optimizer; +extern CINTIntegralFunction int1e_rinvipiprip_cart; +extern CINTIntegralFunction int1e_rinvipiprip_sph; +extern CINTIntegralFunction int1e_rinvipiprip_spinor; + +/* */ +extern CINTOptimizerFunction int1e_ipiprinvrip_optimizer; +extern CINTIntegralFunction int1e_ipiprinvrip_cart; +extern CINTIntegralFunction int1e_ipiprinvrip_sph; +extern CINTIntegralFunction int1e_ipiprinvrip_spinor; -/* */ -extern CINTOptimizerFunction int1e_ipipiprinvip_optimizer; -extern CINTIntegralFunction int1e_ipipiprinvip_cart; -extern CINTIntegralFunction int1e_ipipiprinvip_sph; -extern CINTIntegralFunction int1e_ipipiprinvip_spinor; - -/* */ -extern CINTOptimizerFunction int1e_ipipipiprinv_optimizer; -extern CINTIntegralFunction int1e_ipipipiprinv_cart; -extern CINTIntegralFunction int1e_ipipipiprinv_sph; -extern CINTIntegralFunction int1e_ipipipiprinv_spinor; diff --git a/scripts/auto_intor.cl b/scripts/auto_intor.cl index aec4dfbd..ad80afae 100644 --- a/scripts/auto_intor.cl +++ b/scripts/auto_intor.cl @@ -235,6 +235,7 @@ '("int1e_grids_ip" ( nabla \| grids \| )) '("int1e_grids_ipvip" ( nabla \| grids \| nabla )) '("int1e_grids_spvsp" ( sigma dot p \| grids \| sigma dot p )) + '("int1e_grids_ipip" ( nabla nabla \| grids \| )) ) diff --git a/src/autocode/int1e_grids1.c b/src/autocode/int1e_grids1.c index b1c14558..d2b8aef6 100644 --- a/src/autocode/int1e_grids1.c +++ b/src/autocode/int1e_grids1.c @@ -240,3 +240,89 @@ return CINT1e_grids_spinor_drv(out, dims, &envs, cache, &c2s_si_1e_grids); } // int1e_grids_spvsp_spinor ALL_CINT1E(int1e_grids_spvsp) ALL_CINT1E_FORTRAN_(int1e_grids_spvsp) +/* */ +void CINTgout1e_int1e_grids_ipip(double *gout, double *g, FINT *idx, CINTEnvVars *envs, FINT gout_empty) { +FINT ngrids = envs->ngrids; +FINT bgrids = MIN(ngrids - envs->grids_offset, GRID_BLKSIZE); +FINT nrys_roots = envs->nrys_roots; +FINT nf = envs->nf; +FINT ix, iy, iz, n, i, ig; +double *g0 = g; +double *g1 = g0 + envs->g_size * 3; +double *g2 = g1 + envs->g_size * 3; +double *g3 = g2 + envs->g_size * 3; +double s[GRID_BLKSIZE * 9]; +G1E_GRIDS_D_I(g1, g0, envs->i_l+1, envs->j_l); +G1E_GRIDS_D_I(g2, g0, envs->i_l+0, envs->j_l); +G1E_GRIDS_D_I(g3, g1, envs->i_l+0, envs->j_l); +for (n = 0; n < nf; n++) { +ix = idx[0+n*3]; +iy = idx[1+n*3]; +iz = idx[2+n*3]; +for (i = 0; i < 9; i++) { +for (ig = 0; ig < bgrids; ig++) { s[ig+i*GRID_BLKSIZE] = 0; }} +for (i = 0; i < nrys_roots; i++) { +for (ig = 0; ig < bgrids; ig++) { +s[ig+GRID_BLKSIZE*0] += g3[ix+ig+i*GRID_BLKSIZE] * g0[iy+ig+i*GRID_BLKSIZE] * g0[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*1] += g2[ix+ig+i*GRID_BLKSIZE] * g1[iy+ig+i*GRID_BLKSIZE] * g0[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*2] += g2[ix+ig+i*GRID_BLKSIZE] * g0[iy+ig+i*GRID_BLKSIZE] * g1[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*3] += g1[ix+ig+i*GRID_BLKSIZE] * g2[iy+ig+i*GRID_BLKSIZE] * g0[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*4] += g0[ix+ig+i*GRID_BLKSIZE] * g3[iy+ig+i*GRID_BLKSIZE] * g0[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*5] += g0[ix+ig+i*GRID_BLKSIZE] * g2[iy+ig+i*GRID_BLKSIZE] * g1[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*6] += g1[ix+ig+i*GRID_BLKSIZE] * g0[iy+ig+i*GRID_BLKSIZE] * g2[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*7] += g0[ix+ig+i*GRID_BLKSIZE] * g1[iy+ig+i*GRID_BLKSIZE] * g2[iz+ig+i*GRID_BLKSIZE]; +s[ig+GRID_BLKSIZE*8] += g0[ix+ig+i*GRID_BLKSIZE] * g0[iy+ig+i*GRID_BLKSIZE] * g3[iz+ig+i*GRID_BLKSIZE]; +}}; +if (gout_empty) { +for (ig = 0; ig < bgrids; ig++) { +gout[ig+bgrids*(n*9+0)] = + s[ig+GRID_BLKSIZE*0]; +gout[ig+bgrids*(n*9+1)] = + s[ig+GRID_BLKSIZE*3]; +gout[ig+bgrids*(n*9+2)] = + s[ig+GRID_BLKSIZE*6]; +gout[ig+bgrids*(n*9+3)] = + s[ig+GRID_BLKSIZE*1]; +gout[ig+bgrids*(n*9+4)] = + s[ig+GRID_BLKSIZE*4]; +gout[ig+bgrids*(n*9+5)] = + s[ig+GRID_BLKSIZE*7]; +gout[ig+bgrids*(n*9+6)] = + s[ig+GRID_BLKSIZE*2]; +gout[ig+bgrids*(n*9+7)] = + s[ig+GRID_BLKSIZE*5]; +gout[ig+bgrids*(n*9+8)] = + s[ig+GRID_BLKSIZE*8]; +}} else { +for (ig = 0; ig < bgrids; ig++) { +gout[ig+bgrids*(n*9+0)] += + s[ig+GRID_BLKSIZE*0]; +gout[ig+bgrids*(n*9+1)] += + s[ig+GRID_BLKSIZE*3]; +gout[ig+bgrids*(n*9+2)] += + s[ig+GRID_BLKSIZE*6]; +gout[ig+bgrids*(n*9+3)] += + s[ig+GRID_BLKSIZE*1]; +gout[ig+bgrids*(n*9+4)] += + s[ig+GRID_BLKSIZE*4]; +gout[ig+bgrids*(n*9+5)] += + s[ig+GRID_BLKSIZE*7]; +gout[ig+bgrids*(n*9+6)] += + s[ig+GRID_BLKSIZE*2]; +gout[ig+bgrids*(n*9+7)] += + s[ig+GRID_BLKSIZE*5]; +gout[ig+bgrids*(n*9+8)] += + s[ig+GRID_BLKSIZE*8]; +}}}} +void int1e_grids_ipip_optimizer(CINTOpt **opt, FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) { +FINT ng[] = {2, 0, 0, 0, 2, 1, 0, 9}; +CINTall_1e_grids_optimizer(opt, ng, atm, natm, bas, nbas, env); +} +CACHE_SIZE_T int1e_grids_ipip_cart(double *out, FINT *dims, FINT *shls, +FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) { +FINT ng[] = {2, 0, 0, 0, 2, 1, 0, 9}; +CINTEnvVars envs; +CINTinit_int1e_grids_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); +envs.f_gout = &CINTgout1e_int1e_grids_ipip; +return CINT1e_grids_drv(out, dims, &envs, cache, &c2s_cart_1e_grids); +} // int1e_grids_ipip_cart +CACHE_SIZE_T int1e_grids_ipip_sph(double *out, FINT *dims, FINT *shls, +FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) { +FINT ng[] = {2, 0, 0, 0, 2, 1, 0, 9}; +CINTEnvVars envs; +CINTinit_int1e_grids_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); +envs.f_gout = &CINTgout1e_int1e_grids_ipip; +return CINT1e_grids_drv(out, dims, &envs, cache, &c2s_sph_1e_grids); +} // int1e_grids_ipip_sph +CACHE_SIZE_T int1e_grids_ipip_spinor(double complex *out, FINT *dims, FINT *shls, +FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) { +FINT ng[] = {2, 0, 0, 0, 2, 1, 0, 9}; +CINTEnvVars envs; +CINTinit_int1e_grids_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); +envs.f_gout = &CINTgout1e_int1e_grids_ipip; +return CINT1e_grids_spinor_drv(out, dims, &envs, cache, &c2s_sf_1e_grids); +} // int1e_grids_ipip_spinor +ALL_CINT1E(int1e_grids_ipip) +ALL_CINT1E_FORTRAN_(int1e_grids_ipip)