From 5c9fd6066765131e22df63412314d09f02ad4af9 Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Sun, 17 Sep 2023 14:18:38 -0700 Subject: [PATCH] Change SR integral algorithm for nroots <= 3 Refactor g2e.c Remove GTG integrals and coulerf function --- CMakeLists.txt | 29 +- ChangeLog | 6 +- include/cint.h.in | 5 +- src/cint2c2e_gtg.c | 39 - src/cint2e.c | 14 +- src/cint2e_coulerf.c | 42 - src/cint2e_gtg.c | 41 - src/cint3c2e.c | 10 +- src/cint3c2e_gtg.c | 39 - src/fmt.c | 6 - src/g1e_grids.c | 30 +- src/g2c2e.c | 101 +- src/g2e.c | 4441 ++++++++++++++++++++++++------- src/g2e.h | 39 +- src/g2e_coulerf.c | 112 - src/g2e_f12.c | 174 +- src/g2e_gtg.c | 230 -- src/g3c2e.c | 122 +- src/optimizer.c | 38 +- src/optimizer.h | 9 - src/rys_roots.c | 2 - testsuite/test_f12_with_aft.py | 39 +- testsuite/test_int2e_f12_etc.py | 18 - 23 files changed, 3635 insertions(+), 1951 deletions(-) delete mode 100644 src/cint2c2e_gtg.c delete mode 100644 src/cint2e_coulerf.c delete mode 100644 src/cint2e_gtg.c delete mode 100644 src/cint3c2e_gtg.c delete mode 100644 src/g2e_coulerf.c delete mode 100644 src/g2e_gtg.c diff --git a/CMakeLists.txt b/CMakeLists.txt index d87b94bb..409e73bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.5) project (cint C) -set(cint_VERSION_MAJOR "5") -set(cint_VERSION_MINOR "5") +set(cint_VERSION_MAJOR "6") +set(cint_VERSION_MINOR "0") set(cint_VERSION_PATCH "0") set(cint_VERSION_TWEAK "0") set(cint_VERSION "${cint_VERSION_MAJOR}.${cint_VERSION_MINOR}.${cint_VERSION_PATCH}") @@ -89,23 +89,17 @@ set(cintSrc if(WITH_RANGE_COULOMB) # defined in config.h # add_definitions(-DWITH_RANGE_COULOMB) - message("Enabled WITH_RANGE_COULOMB") - if(WITH_POLYNOMIAL_FIT) - set(cintSrc ${cintSrc} src/polyfits.c src/sr_rys_polyfits.c) - add_definitions(-DWITH_POLYNOMIAL_FIT) - message("Enabled WITH_POLYNOMIAL_FIT") - endif(WITH_POLYNOMIAL_FIT) +# message("Enabled WITH_RANGE_COULOMB") endif(WITH_RANGE_COULOMB) -if(WITH_EIG_ROOTFINDER) - add_definitions(-DWITH_EIG_ROOTFINDER) - message("Enabled linear equation solver with eigenvalue algorithm") -endif(WITH_EIG_ROOTFINDER) +if(WITH_POLYNOMIAL_FIT) + set(cintSrc ${cintSrc} src/polyfits.c src/sr_rys_polyfits.c) + add_definitions(-DWITH_POLYNOMIAL_FIT) + message("Enabled WITH_POLYNOMIAL_FIT") +endif(WITH_POLYNOMIAL_FIT) if(WITH_COULOMB_ERF) - set(cintSrc ${cintSrc} src/g2e_coulerf.c src/cint2e_coulerf.c) - add_definitions(-DWITH_COULOMB_ERF) - message("Enabled WITH_COULOMB_ERF") + message("WITH_COULOMB_ERF is deprecated since v6.0") endif(WITH_COULOMB_ERF) if(WITH_F12) @@ -115,12 +109,13 @@ if(WITH_F12) endif(WITH_F12) # Gaussian type geminal code are incorrect -#if(WITH_GTG) +if(WITH_GTG) # set(cintSrc ${cintSrc} src/g2e_gtg.c src/cint2e_gtg.c src/cint3c2e_gtg.c # src/cint2c2e_gtg.c) # add_definitions(-DWITH_GTG) # message("Enabled WITH_GTG. Note there are bugs in gtg type integrals") -#endif(WITH_GTG) + message("WITH_GTG is deprecated since v6.0") +endif(WITH_GTG) if(WITH_4C1E) set(cintSrc ${cintSrc} src/cint4c1e.c src/g4c1e.c) diff --git a/ChangeLog b/ChangeLog index 0bac66ce..9198f8dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ +Version 6.0.0 (2023-09-14): + * Add polynomial root finder using the eigenvalue algorithm + * Fitting Rys roots of SR integrals with Chebyshev polynomials + Version 5.5.0 (2023-09-14): * Fix memory leak issue in int4c1e - * Add polynomial root finder with eigenvalue algorithm - * Fitting Rys roots of SR integrals with Chebyshev polynomials * New integrals related to LRESC * Supports Gaussian model for int1e_grids diff --git a/include/cint.h.in b/include/cint.h.in index 8eef9ba7..f0ac8c12 100644 --- a/include/cint.h.in +++ b/include/cint.h.in @@ -4,7 +4,8 @@ * Parameters and function signature for libcint. */ -#define CINT_VERSION @cint_VERSION@ +#define CINT_VERSION @cint_VERSION@ +#define CINT_SOVERSION @cint_SOVERSION #cmakedefine I8 #ifdef I8 @@ -170,7 +171,7 @@ typedef struct { union {FINT nfk; FINT grids_offset;}; union {FINT nfl; FINT ngrids;}; FINT nf; // = nfi*nfj*nfk*nfl; - FINT _padding; + FINT rys_order; // = nrys_roots for regular ERIs. can be nrys_roots/2 for SR ERIs FINT x_ctr[4]; FINT gbits; diff --git a/src/cint2c2e_gtg.c b/src/cint2c2e_gtg.c deleted file mode 100644 index 6d819654..00000000 --- a/src/cint2c2e_gtg.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - */ - -#include -#include "cint_bas.h" -#include "g2e.h" -#include "optimizer.h" -#include "cint2e.h" -#include "cart2sph.h" - -CACHE_SIZE_T int2c2e_gtg_sph(double *out, FINT *dims, FINT *shls, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTEnvVars envs; - CINTinit_int2c2e_gtg_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); - envs.f_gout = &CINTgout2e; - return CINT2c2e_drv(out, dims, &envs, opt, cache, &c2s_sph_1e); -} -void int2c2e_gtg_optimizer(CINTOpt **opt, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTall_2c2e_gtg_optimizer(opt, ng, atm, natm, bas, nbas, env); -} - -#define ALL_CINT(NAME) \ -FINT c##NAME##_sph(double *out, FINT *shls, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env, CINTOpt *opt) { \ - return NAME##_sph(out, NULL, shls, atm, natm, bas, nbas, env, opt, NULL); \ -} \ -void c##NAME##_sph_optimizer(CINTOpt **opt, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env) { \ - NAME##_optimizer(opt, atm, natm, bas, nbas, env); \ -} - -ALL_CINT(int2c2e_gtg) - diff --git a/src/cint2e.c b/src/cint2e.c index 65fe755e..a7980ff9 100644 --- a/src/cint2e.c +++ b/src/cint2e.c @@ -122,7 +122,6 @@ FINT CINT2e_loop_nopt(double *gctr, CINTEnvVars *envs, double *cache, FINT *empt double *rij; akl = ak[k_prim-1] + al[l_prim-1]; log_rr_kl = 1.7 - 1.5 * approx_log(akl); -#ifdef WITH_RANGE_COULOMB double omega = env[PTR_RANGE_OMEGA]; if (omega < 0) { // Normally the factor @@ -130,7 +129,7 @@ FINT CINT2e_loop_nopt(double *gctr, CINTEnvVars *envs, double *cache, FINT *empt // is a good approximation for polynomial parts in SR-ERIs. // <~ (aj*d/aij+theta*R)^li * (ai*d/aij+theta*R)^lj * (pi/aij)^1.5 // <~ (d+theta*R)^li * (d+theta*R)^lj * (pi/aij)^1.5 - if (envs->nrys_roots > 1) { + if (envs->rys_order > 1) { double r_guess = 8.; double omega2 = omega * omega; int lij = envs->li_ceil + envs->lj_ceil; @@ -152,11 +151,6 @@ FINT CINT2e_loop_nopt(double *gctr, CINTEnvVars *envs, double *cache, FINT *empt log_rr_kl += lkl * approx_log(sqrt(rr_kl) + 1.); } } -#else - if (lkl > 0) { - log_rr_kl += lkl * approx_log(sqrt(rr_kl) + 1.); - } -#endif FINT *idx; MALLOC_INSTACK(idx, nf * 3); @@ -360,10 +354,9 @@ k_contracted: ; CINTg2e_index_xyz(idx, envs); \ } -#ifdef WITH_RANGE_COULOMB #define ADJUST_CUTOFF \ double omega = env[PTR_RANGE_OMEGA]; \ - if (omega < 0 && envs->nrys_roots > 1) { \ + if (omega < 0 && envs->rys_order > 1) { \ double r_guess = 8.; \ double omega2 = omega * omega; \ int lij = envs->li_ceil + envs->lj_ceil; \ @@ -383,9 +376,6 @@ k_contracted: ; (dist_kl+theta*r_guess+1.)/(dist_kl+1.)); \ } \ } -#else -#define ADJUST_CUTOFF -#endif #define SET_RIJ(I,J) \ if (pdata_##I##J->cceij > e##I##J##cutoff) { \ diff --git a/src/cint2e_coulerf.c b/src/cint2e_coulerf.c deleted file mode 100644 index 5da3fe23..00000000 --- a/src/cint2e_coulerf.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - */ - -#include -#include "cint_bas.h" -#include "g2e.h" -#include "optimizer.h" -#include "cint2e.h" -#include "cart2sph.h" - -FINT CINTinit_int2e_coulerf_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -void CINTgout2e(double *gout, double *g, FINT *idx, CINTEnvVars *envs, FINT gout_empty); - -CACHE_SIZE_T int2e_coulerf_sph(double *out, FINT *dims, FINT *shls, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTEnvVars envs; - CINTinit_int2e_coulerf_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); - envs.f_gout = &CINTgout2e; - return CINT2e_drv(out, dims, &envs, opt, cache, &c2s_sph_2e1); -} -void int2e_coulerf_optimizer(CINTOpt **opt, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTall_2e_optimizer(opt, ng, atm, natm, bas, nbas, env); -} - -#define ALL_CINT(NAME) \ -FINT c##NAME##_sph(double *out, FINT *shls, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env, CINTOpt *opt) { \ - return NAME##_sph(out, NULL, shls, atm, natm, bas, nbas, env, opt, NULL); \ -} \ -void c##NAME##_sph_optimizer(CINTOpt **opt, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env) { \ - NAME##_optimizer(opt, atm, natm, bas, nbas, env); \ -} - -ALL_CINT(int2e_coulerf) diff --git a/src/cint2e_gtg.c b/src/cint2e_gtg.c deleted file mode 100644 index 65ab4002..00000000 --- a/src/cint2e_gtg.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - */ - -#include -#include -#include "cint_bas.h" -#include "g2e.h" -#include "optimizer.h" -#include "cint2e.h" -#include "cart2sph.h" - -CACHE_SIZE_T int2e_gtg_sph(double *out, FINT *dims, FINT *shls, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) -{ - fprintf(stderr, "Don't use this function. GTG integrals have bugs"); - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTEnvVars envs; - CINTinit_int2e_gtg_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); - envs.f_gout = &CINTgout2e; - return CINT2e_drv(out, dims, &envs, opt, cache, &c2s_sph_1e); -} -void int2e_gtg_optimizer(CINTOpt **opt, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTall_2e_gtg_optimizer(opt, ng, atm, natm, bas, nbas, env); -} - -#define ALL_CINT(NAME) \ -FINT c##NAME##_sph(double *out, FINT *shls, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env, CINTOpt *opt) { \ - return NAME##_sph(out, NULL, shls, atm, natm, bas, nbas, env, opt, NULL); \ -} \ -void c##NAME##_sph_optimizer(CINTOpt **opt, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env) { \ - NAME##_optimizer(opt, atm, natm, bas, nbas, env); \ -} - -ALL_CINT(int2e_gtg) - diff --git a/src/cint3c2e.c b/src/cint3c2e.c index 46b5148e..8b12b046 100644 --- a/src/cint3c2e.c +++ b/src/cint3c2e.c @@ -105,9 +105,8 @@ FINT CINT3c2e_loop_nopt(double *gctr, CINTEnvVars *envs, double *cache, FINT *em double expij, cutoff; double *rij; double *rkl = envs->rk; -#ifdef WITH_RANGE_COULOMB double omega = env[PTR_RANGE_OMEGA]; - if (omega < 0 && envs->nrys_roots > 1) { + if (omega < 0 && envs->rys_order > 1) { double r_guess = 8.; double omega2 = omega * omega; int lij = envs->li_ceil + envs->lj_ceil; @@ -123,7 +122,6 @@ FINT CINT3c2e_loop_nopt(double *gctr, CINTEnvVars *envs, double *cache, FINT *em expcutoff += envs->lk_ceil * approx_log(theta*r_guess+1.); } } -#endif FINT *idx; MALLOC_INSTACK(idx, nf * 3); @@ -279,10 +277,9 @@ i_contracted: ; CINTg2e_index_xyz(idx, envs); \ } -#ifdef WITH_RANGE_COULOMB #define ADJUST_CUTOFF \ double omega = env[PTR_RANGE_OMEGA]; \ - if (omega < 0 && envs->nrys_roots > 1) { \ + if (omega < 0 && envs->rys_order > 1) { \ double r_guess = 8.; \ double omega2 = omega * omega; \ int lij = envs->li_ceil + envs->lj_ceil; \ @@ -298,9 +295,6 @@ i_contracted: ; expcutoff += envs->lk_ceil * approx_log(theta*r_guess+1.); \ } \ } -#else -#define ADJUST_CUTOFF -#endif #define SET_RIJ \ if (pdata_ij->cceij > expcutoff) { \ diff --git a/src/cint3c2e_gtg.c b/src/cint3c2e_gtg.c deleted file mode 100644 index 6602e8aa..00000000 --- a/src/cint3c2e_gtg.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - */ - -#include -#include "cint_bas.h" -#include "g2e.h" -#include "optimizer.h" -#include "cint2e.h" -#include "cart2sph.h" - -CACHE_SIZE_T int3c2e_gtg_sph(double *out, FINT *dims, FINT *shls, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env, CINTOpt *opt, double *cache) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTEnvVars envs; - CINTinit_int3c2e_gtg_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env); - envs.f_gout = &CINTgout2e; - return CINT3c2e_drv(out, dims, &envs, opt, cache, &c2s_sph_3c2e1, 0); -} -void int3c2e_gtg_optimizer(CINTOpt **opt, FINT *atm, FINT natm, - FINT *bas, FINT nbas, double *env) -{ - FINT ng[] = {0, 0, 0, 0, 0, 1, 1, 1}; - CINTall_3c2e_gtg_optimizer(opt, ng, atm, natm, bas, nbas, env); -} - -#define ALL_CINT(NAME) \ -FINT c##NAME##_sph(double *out, FINT *shls, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env, CINTOpt *opt) { \ - return NAME##_sph(out, NULL, shls, atm, natm, bas, nbas, env, opt, NULL); \ -} \ -void c##NAME##_sph_optimizer(CINTOpt **opt, FINT *atm, FINT natm, \ - FINT *bas, FINT nbas, double *env) { \ - NAME##_optimizer(opt, atm, natm, bas, nbas, env); \ -} - -ALL_CINT(int3c2e_gtg) - diff --git a/src/fmt.c b/src/fmt.c index 29a6c1a2..0ce47dcd 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -334,7 +334,6 @@ void fmt_erfc_like(double *f, double t, double lower, int m) int i; double lower2 = lower * lower; -#ifdef WITH_RANGE_COULOMB // F[m] < .5*sqrt(pi/t) * erfc(low*tt) if (t * lower2 > ERFC_bound) { for (i = 0; i <= m; i++) { @@ -342,7 +341,6 @@ void fmt_erfc_like(double *f, double t, double lower, int m) } return; } -#endif if (t < TURNOVER_POINT[m]) { fmt1_erfc_like(f, t, lower, m); @@ -372,7 +370,6 @@ void fmt_lerfc_like(long double *f, long double t, long double lower, int m) int i; long double lower2 = lower * lower; -#ifdef WITH_RANGE_COULOMB // F[m] < .5*sqrt(pi/t) * erfc(low*tt) if (t * lower2 > ERFC_bound) { for (i = 0; i <= m; i++) { @@ -380,7 +377,6 @@ void fmt_lerfc_like(long double *f, long double t, long double lower, int m) } return; } -#endif if (t < TURNOVER_POINT[m]) { fmt1_lerfc_like(f, t, lower, m); @@ -492,7 +488,6 @@ void fmt_qerfc_like(__float128 *f, __float128 t, __float128 lower, int m) int i; __float128 lower2 = lower * lower; -#ifdef WITH_RANGE_COULOMB // F[m] < .5*sqrt(pi/t) * erfc(low*tt) if (t * lower2 > ERFC_bound) { for (i = 0; i <= m; i++) { @@ -500,7 +495,6 @@ void fmt_qerfc_like(__float128 *f, __float128 t, __float128 lower, int m) } return; } -#endif if (t < TURNOVER_POINT[m]) { fmt1_qerfc_like(f, t, lower, m); diff --git a/src/g1e_grids.c b/src/g1e_grids.c index fa5465e9..7dc40ae5 100644 --- a/src/g1e_grids.c +++ b/src/g1e_grids.c @@ -26,7 +26,14 @@ void CINTinit_int1e_grids_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->common_factor = 2 * M_PI * CINTcommon_fac_sp(envs->i_l) * CINTcommon_fac_sp(envs->j_l); - int nroots = envs->nrys_roots; + int rys_order = envs->nrys_roots; + int nroots = rys_order; + double omega = env[PTR_RANGE_OMEGA]; + if (omega < 0 && rys_order <= 3) { + nroots *= 2; + } + envs->rys_order = rys_order; + envs->nrys_roots = nroots; FINT dli, dlj; FINT ibase = envs->li_ceil > envs->lj_ceil; @@ -59,7 +66,7 @@ FINT CINTg0_1e_grids(double *g, double cutoff, { FINT ngrids = envs->ngrids; FINT bgrids = MIN(ngrids - envs->grids_offset, GRID_BLKSIZE); - FINT nroots = envs->nrys_roots; + int nroots = envs->nrys_roots; double *gx = g; double *gy = g + envs->g_size; double *gz = g + envs->g_size * 2; @@ -88,11 +95,7 @@ FINT CINTg0_1e_grids(double *g, double cutoff, rijrg[ig+GRID_BLKSIZE*2] = gridsT[ig+GRID_BLKSIZE*2] - rij[2]; } -#ifdef WITH_RANGE_COULOMB double omega = envs->env[PTR_RANGE_OMEGA]; -#else - double omega = 0.; -#endif double zeta = envs->env[PTR_RINV_ZETA]; double omega2, theta, sqrt_theta, a0, tau2; @@ -127,6 +130,8 @@ FINT CINTg0_1e_grids(double *g, double cutoff, // numerical issue in sr_rys_roots. Use this cutoff as a // temporary solution to avoid numerical issues double temp_cutoff = MIN(cutoff, EXPCUTOFF_SR); + int rorder = envs->rys_order; + double tau_theta, fac_theta; for (ig = 0; ig < bgrids; ig++) { x = a0 * RGSQUARE(rijrg, ig); if (theta * x > temp_cutoff) { @@ -135,12 +140,23 @@ FINT CINTg0_1e_grids(double *g, double cutoff, u[ig+GRID_BLKSIZE*i] = 0; w[ig+GRID_BLKSIZE*i] = 0; } - } else { + } else if (rorder == nroots) { CINTsr_rys_roots(nroots, x, sqrt_theta, ubuf, wbuf); for (i = 0; i < nroots; i++) { u[ig+GRID_BLKSIZE*i] = ubuf[i] / (ubuf[i] + 1) * tau2; w[ig+GRID_BLKSIZE*i] = wbuf[i] * fac1; } + } else { + tau_theta = tau2 * theta; + fac_theta = fac1 * -sqrt_theta; + CINTrys_roots(rorder, x, ubuf, wbuf); + CINTrys_roots(rorder, theta*x, ubuf+rorder, wbuf+rorder); + for (i = 0; i < rorder; i++) { + u[ig+GRID_BLKSIZE*i] = ubuf[i] / (ubuf[i] + 1) * tau2; + w[ig+GRID_BLKSIZE*i] = wbuf[i] * fac1; + u[ig+GRID_BLKSIZE*(i+rorder)] = ubuf[i] / (ubuf[i] + 1) * tau_theta; + w[ig+GRID_BLKSIZE*(i+rorder)] = wbuf[i] * fac_theta; + } } } } else { diff --git a/src/g2c2e.c b/src/g2c2e.c index f1689a50..1ba07f51 100644 --- a/src/g2c2e.c +++ b/src/g2c2e.c @@ -58,7 +58,13 @@ void CINTinit_int2c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->lj_ceil = 0; envs->lk_ceil = envs->k_l + ng[KINC]; envs->ll_ceil = 0; - int nrys_roots =(envs->li_ceil + envs->lk_ceil)/2 + 1; + int rys_order =(envs->li_ceil + envs->lk_ceil)/2 + 1; + int nrys_roots = rys_order; + double omega = env[PTR_RANGE_OMEGA]; + if (omega < 0 && rys_order <= 3) { + nrys_roots *= 2; + } + envs->rys_order = rys_order; envs->nrys_roots = nrys_roots; FINT dli = envs->li_ceil + 1; @@ -87,8 +93,11 @@ void CINTinit_int2c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->rx_in_rklrx = envs->rk; envs->rx_in_rijrx = envs->ri; - if (nrys_roots <= 2) { + if (rys_order <= 2) { envs->f_g0_2d4d = &CINTg0_2e_2d4d_unrolled; + if (rys_order != nrys_roots) { + envs->f_g0_2d4d = &CINTsrg0_2e_2d4d_unrolled; + } } else { envs->f_g0_2d4d = &CINTg0_2e_2d; } @@ -100,91 +109,3 @@ void CINTinit_int2c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->nfj = envs->nfk; envs->g_stride_j = envs->g_stride_k; } - -#ifdef WITH_GTG -FINT CINTg0_2e_gtg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); - -void CINTinit_int2c2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - envs->natm = natm; - envs->nbas = nbas; - envs->atm = atm; - envs->bas = bas; - envs->env = env; - envs->shls = shls; - - const FINT i_sh = shls[0]; - const FINT k_sh = shls[1]; - envs->i_l = bas(ANG_OF, i_sh); - envs->j_l = 0; - envs->k_l = bas(ANG_OF, k_sh); - envs->l_l = 0; - envs->x_ctr[0] = bas(NCTR_OF, i_sh); - envs->x_ctr[1] = bas(NCTR_OF, k_sh); - envs->x_ctr[2] = 1; - envs->x_ctr[3] = 1; - envs->nfi = (envs->i_l+1)*(envs->i_l+2)/2; - envs->nfj = 1; - envs->nfk = (envs->k_l+1)*(envs->k_l+2)/2; - envs->nfl = 1; - envs->nf = envs->nfi * envs->nfk; - - envs->ri = env + atm(PTR_COORD, bas(ATOM_OF, i_sh)); - envs->rk = env + atm(PTR_COORD, bas(ATOM_OF, k_sh)); - - envs->common_factor = (M_PI*M_PI*M_PI) - * CINTcommon_fac_sp(envs->i_l) * CINTcommon_fac_sp(envs->k_l); - if (env[PTR_EXPCUTOFF] == 0) { - envs->expcutoff = EXPCUTOFF; - } else { - envs->expcutoff = MAX(MIN_EXPCUTOFF, env[PTR_EXPCUTOFF]); - } - - envs->gbits = ng[GSHIFT]; - envs->ncomp_e1 = ng[POS_E1]; - envs->ncomp_e2 = ng[POS_E2]; - envs->ncomp_tensor = ng[TENSOR]; - - envs->li_ceil = envs->i_l + ng[IINC]; - envs->lj_ceil = 0; - envs->lk_ceil = envs->k_l + ng[KINC]; - envs->ll_ceil = 0; - envs->nrys_roots = 1; - - FINT dli = envs->li_ceil + 1; - FINT dlk = envs->lk_ceil + 1; - envs->g_stride_i = envs->nrys_roots; - envs->g_stride_k = envs->nrys_roots * dli; - envs->g_stride_l = envs->g_stride_k; - envs->g_size = envs->nrys_roots * dli * dlk; - - envs->aj[0] = 0; - envs->al[0] = 0; - envs->rij[0] = envs->ri[0]; - envs->rij[1] = envs->ri[1]; - envs->rij[2] = envs->ri[2]; - envs->rkl[0] = envs->rk[0]; - envs->rkl[1] = envs->rk[1]; - envs->rkl[2] = envs->rk[2]; - envs->g2d_ijmax = envs->g_stride_i; - envs->g2d_klmax = envs->g_stride_k; - envs->rkrl[0] = envs->rk[0]; - envs->rkrl[1] = envs->rk[1]; - envs->rkrl[2] = envs->rk[2]; - envs->rirj[0] = envs->ri[0]; - envs->rirj[1] = envs->ri[1]; - envs->rirj[2] = envs->ri[2]; - envs->rx_in_rklrx = envs->rk; - envs->rx_in_rijrx = envs->ri; - - envs->f_g0_2d4d = &CINTg0_2e_2d; - envs->f_g0_2e = &CINTg0_2e_gtg; - -// initialize j_l, j_ctr, nfj because they are used in c2s_sph_1e and -// CINTg1e_index_xyz - envs->j_l = envs->k_l; - envs->nfj = envs->nfk; - envs->g_stride_j = envs->g_stride_k; -} -#endif diff --git a/src/g2e.c b/src/g2e.c index 946635c6..01fd4504 100644 --- a/src/g2e.c +++ b/src/g2e.c @@ -70,8 +70,14 @@ void CINTinit_int2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->lj_ceil = envs->j_l + ng[JINC]; envs->lk_ceil = envs->k_l + ng[KINC]; envs->ll_ceil = envs->l_l + ng[LINC]; - int nrys_roots =(envs->li_ceil + envs->lj_ceil + int rys_order =(envs->li_ceil + envs->lj_ceil + envs->lk_ceil + envs->ll_ceil)/2 + 1; + int nrys_roots = rys_order; + double omega = env[PTR_RANGE_OMEGA]; + if (omega < 0 && rys_order <= 3) { + nrys_roots *= 2; + } + envs->rys_order = rys_order; envs->nrys_roots = nrys_roots; assert(i_sh < SHLS_MAX); @@ -90,7 +96,7 @@ void CINTinit_int2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, assert(bas(ATOM_OF,j_sh) < natm); assert(bas(ATOM_OF,k_sh) < natm); assert(bas(ATOM_OF,l_sh) < natm); - assert(nrys_roots < MXRYSROOTS); + assert(rys_order < MXRYSROOTS); FINT dli, dlj, dlk, dll; FINT ibase = envs->li_ceil > envs->lj_ceil; @@ -144,8 +150,11 @@ void CINTinit_int2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->rirj[2] = envs->rj[2] - envs->ri[2]; } - if (nrys_roots <= 2) { + if (rys_order <= 2) { envs->f_g0_2d4d = &CINTg0_2e_2d4d_unrolled; + if (rys_order != nrys_roots) { + envs->f_g0_2d4d = &CINTsrg0_2e_2d4d_unrolled; + } } else if (kbase) { if (ibase) { envs->f_g0_2d4d = &CINTg0_2e_ik2d4d; @@ -260,7 +269,7 @@ void CINTg2e_index_xyz(FINT *idx, const CINTEnvVars *envs) /* * g(nroots,0:nmax,0:mmax) */ -void CINTg0_2e_2d(double *g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_2d(double *g, Rys2eT *bc, CINTEnvVars *envs) { const FINT nroots = envs->nrys_roots; const FINT nmax = envs->li_ceil + envs->lj_ceil; @@ -270,7 +279,8 @@ void CINTg0_2e_2d(double *g, struct _BC *bc, CINTEnvVars *envs) FINT i, j, m, n, off; DEF_GXYZ(double, g, gx, gy, gz); double *p0x, *p0y, *p0z; - double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; + double *p1x, *p1y, *p1z; + double nb1, mb0; for (i = 0; i < nroots; i++) { gx[i] = 1; @@ -281,17 +291,17 @@ void CINTg0_2e_2d(double *g, struct _BC *bc, CINTEnvVars *envs) double s0x, s1x, s2x, t0x, t1x; double s0y, s1y, s2y, t0y, t1y; double s0z, s1z, s2z, t0z, t1z; - double b00, b10, b01, c00x, c00y, c00z, c0px, c0py, c0pz; + double c00x, c00y, c00z, c0px, c0py, c0pz, b10, b01, b00; for (i = 0; i < nroots; i++) { - c00x = bc->c00[i*3+0]; - c00y = bc->c00[i*3+1]; - c00z = bc->c00[i*3+2]; - c0px = bc->c0p[i*3+0]; - c0py = bc->c0p[i*3+1]; - c0pz = bc->c0p[i*3+2]; - b00 = bc->b00[i]; - b01 = bc->b01[i]; + c00x = bc->c00x[i]; + c00y = bc->c00y[i]; + c00z = bc->c00z[i]; + c0px = bc->c0px[i]; + c0py = bc->c0py[i]; + c0pz = bc->c0pz[i]; b10 = bc->b10[i]; + b01 = bc->b01[i]; + b00 = bc->b00[i]; if (nmax > 0) { // gx(irys,0,1) = c00(irys) * gx(irys,0,0) // gx(irys,0,n+1) = c00(irys)*gx(irys,0,n) @@ -417,22 +427,25 @@ void CINTg0_2e_2d(double *g, struct _BC *bc, CINTEnvVars *envs) /* 2d is based on l,j */ void CINTg0_lj2d_4d(double *restrict g, CINTEnvVars *envs) { - const FINT nmax = envs->li_ceil + envs->lj_ceil; - const FINT mmax = envs->lk_ceil + envs->ll_ceil; - const FINT li = envs->li_ceil; - const FINT lk = envs->lk_ceil; - //const FINT ll = envs->ll_ceil; - const FINT lj = envs->lj_ceil; - const FINT nroots = envs->nrys_roots; + FINT li = envs->li_ceil; + FINT lk = envs->lk_ceil; + if (li == 0 && lk == 0) { + return; + } + FINT nmax = envs->li_ceil + envs->lj_ceil; + FINT mmax = envs->lk_ceil + envs->ll_ceil; + //FINT ll = envs->ll_ceil; + FINT lj = envs->lj_ceil; + FINT nroots = envs->nrys_roots; FINT i, j, k, l, ptr, n; - const FINT di = envs->g_stride_i; - const FINT dk = envs->g_stride_k; - const FINT dl = envs->g_stride_l; - const FINT dj = envs->g_stride_j; - const double *rirj = envs->rirj; - const double *rkrl = envs->rkrl; + FINT di = envs->g_stride_i; + FINT dk = envs->g_stride_k; + FINT dl = envs->g_stride_l; + FINT dj = envs->g_stride_j; + double *rirj = envs->rirj; + double *rkrl = envs->rkrl; DEF_GXYZ(double, g, gx, gy, gz); - const double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; + double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; double rx, ry, rz; // g(i,...,j) = rirj * g(i-1,...,j) + g(i-1,...,j+1) @@ -480,22 +493,25 @@ void CINTg0_lj2d_4d(double *restrict g, CINTEnvVars *envs) /* 2d is based on k,j */ void CINTg0_kj2d_4d(double *restrict g, CINTEnvVars *envs) { - const FINT nmax = envs->li_ceil + envs->lj_ceil; - const FINT mmax = envs->lk_ceil + envs->ll_ceil; - const FINT li = envs->li_ceil; - //const FINT lk = envs->lk_ceil; - const FINT ll = envs->ll_ceil; - const FINT lj = envs->lj_ceil; - const FINT nroots = envs->nrys_roots; + FINT li = envs->li_ceil; + FINT ll = envs->ll_ceil; + if (li == 0 && ll == 0) { + return; + } + FINT nmax = envs->li_ceil + envs->lj_ceil; + FINT mmax = envs->lk_ceil + envs->ll_ceil; + //FINT lk = envs->lk_ceil; + FINT lj = envs->lj_ceil; + FINT nroots = envs->nrys_roots; FINT i, j, k, l, ptr, n; - const FINT di = envs->g_stride_i; - const FINT dk = envs->g_stride_k; - const FINT dl = envs->g_stride_l; - const FINT dj = envs->g_stride_j; - const double *rirj = envs->rirj; - const double *rkrl = envs->rkrl; + FINT di = envs->g_stride_i; + FINT dk = envs->g_stride_k; + FINT dl = envs->g_stride_l; + FINT dj = envs->g_stride_j; + double *rirj = envs->rirj; + double *rkrl = envs->rkrl; DEF_GXYZ(double, g, gx, gy, gz); - const double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; + double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; double rx, ry, rz; // g(i,...,j) = rirj * g(i-1,...,j) + g(i-1,...,j+1) @@ -543,22 +559,25 @@ void CINTg0_kj2d_4d(double *restrict g, CINTEnvVars *envs) /* 2d is based on i,l */ void CINTg0_il2d_4d(double *restrict g, CINTEnvVars *envs) { - const FINT nmax = envs->li_ceil + envs->lj_ceil; - const FINT mmax = envs->lk_ceil + envs->ll_ceil; - //const FINT li = envs->li_ceil; - const FINT lk = envs->lk_ceil; - const FINT ll = envs->ll_ceil; - const FINT lj = envs->lj_ceil; - const FINT nroots = envs->nrys_roots; + FINT lk = envs->lk_ceil; + FINT lj = envs->lj_ceil; + if (lj == 0 && lk == 0) { + return; + } + FINT nmax = envs->li_ceil + envs->lj_ceil; + FINT mmax = envs->lk_ceil + envs->ll_ceil; + //FINT li = envs->li_ceil; + FINT ll = envs->ll_ceil; + FINT nroots = envs->nrys_roots; FINT i, j, k, l, ptr, n; - const FINT di = envs->g_stride_i; - const FINT dk = envs->g_stride_k; - const FINT dl = envs->g_stride_l; - const FINT dj = envs->g_stride_j; - const double *rirj = envs->rirj; - const double *rkrl = envs->rkrl; + FINT di = envs->g_stride_i; + FINT dk = envs->g_stride_k; + FINT dl = envs->g_stride_l; + FINT dj = envs->g_stride_j; + double *rirj = envs->rirj; + double *rkrl = envs->rkrl; DEF_GXYZ(double, g, gx, gy, gz); - const double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; + double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; double rx, ry, rz; // g(...,k,l,..) = rkrl * g(...,k-1,l,..) + g(...,k-1,l+1,..) @@ -606,22 +625,25 @@ void CINTg0_il2d_4d(double *restrict g, CINTEnvVars *envs) /* 2d is based on i,k */ void CINTg0_ik2d_4d(double *restrict g, CINTEnvVars *envs) { - const FINT nmax = envs->li_ceil + envs->lj_ceil; - const FINT mmax = envs->lk_ceil + envs->ll_ceil; - //const FINT li = envs->li_ceil; - const FINT lk = envs->lk_ceil; - const FINT ll = envs->ll_ceil; - const FINT lj = envs->lj_ceil; - const FINT nroots = envs->nrys_roots; + FINT lj = envs->lj_ceil; + FINT ll = envs->ll_ceil; + if (lj == 0 && ll == 0) { + return; + } + FINT nmax = envs->li_ceil + envs->lj_ceil; + FINT mmax = envs->lk_ceil + envs->ll_ceil; + //FINT li = envs->li_ceil; + FINT lk = envs->lk_ceil; + FINT nroots = envs->nrys_roots; FINT i, j, k, l, ptr, n; - const FINT di = envs->g_stride_i; - const FINT dk = envs->g_stride_k; - const FINT dl = envs->g_stride_l; - const FINT dj = envs->g_stride_j; - const double *rirj = envs->rirj; - const double *rkrl = envs->rkrl; + FINT di = envs->g_stride_i; + FINT dk = envs->g_stride_k; + FINT dl = envs->g_stride_l; + FINT dj = envs->g_stride_j; + double *rirj = envs->rirj; + double *rkrl = envs->rkrl; DEF_GXYZ(double, g, gx, gy, gz); - const double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; + double *p1x, *p1y, *p1z, *p2x, *p2y, *p2z; double rx, ry, rz; // g(...,k,l,..) = rkrl * g(...,k,l-1,..) + g(...,k+1,l-1,..) @@ -670,387 +692,423 @@ void CINTg0_ik2d_4d(double *restrict g, CINTEnvVars *envs) } } } } -static inline void _g0_2d4d_0000(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { g[0] = 1; g[1] = 1; //g[2] = w[0]; } -static inline void _g0_2d4d_0001(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; g[0] = 1; - g[1] = cp[0]; + g[1] = cpx[0]; g[2] = 1; - g[3] = cp[1]; + g[3] = cpy[0]; //g[4] = w[0]; - g[5] = cp[2] * g[4]; + g[5] = cpz[0] * g[4]; } -static inline void _g0_2d4d_0002(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0002(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; g[6] = 1; g[7] = 1; - g[8] = cp[1]; - g[9] = cp[4]; - g[10] = cp[1] * cp[1] + b01[0]; - g[11] = cp[4] * cp[4] + b01[1]; + g[8] = cpy[0]; + g[9] = cpy[1]; + g[10] = cpy[0] * cpy[0] + b01[0]; + g[11] = cpy[1] * cpy[1] + b01[1]; //g[12] = w[0]; //g[13] = w[1]; - g[14] = cp[2] * g[12]; - g[15] = cp[5] * g[13]; - g[16] = cp[2] * g[14] + b01[0] * g[12]; - g[17] = cp[5] * g[15] + b01[1] * g[13]; + g[14] = cpz[0] * g[12]; + g[15] = cpz[1] * g[13]; + g[16] = cpz[0] * g[14] + b01[0] * g[12]; + g[17] = cpz[1] * g[15] + b01[1] * g[13]; } -static inline void _g0_2d4d_0003(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0003(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; - g[6] = cp[0] * (g[4] + 2 * b01[0]); - g[7] = cp[3] * (g[5] + 2 * b01[1]); + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; + g[6] = cpx[0] * (g[4] + 2 * b01[0]); + g[7] = cpx[1] * (g[5] + 2 * b01[1]); g[8] = 1; g[9] = 1; - g[10] = cp[1]; - g[11] = cp[4]; - g[12] = cp[1] * cp[1] + b01[0]; - g[13] = cp[4] * cp[4] + b01[1]; - g[14] = cp[1] * (g[12] + 2 * b01[0]); - g[15] = cp[4] * (g[13] + 2 * b01[1]); + g[10] = cpy[0]; + g[11] = cpy[1]; + g[12] = cpy[0] * cpy[0] + b01[0]; + g[13] = cpy[1] * cpy[1] + b01[1]; + g[14] = cpy[0] * (g[12] + 2 * b01[0]); + g[15] = cpy[1] * (g[13] + 2 * b01[1]); //g[16] = w[0]; //g[17] = w[1]; - g[18] = cp[2] * g[16]; - g[19] = cp[5] * g[17]; - g[20] = cp[2] * g[18] + b01[0] * g[16]; - g[21] = cp[5] * g[19] + b01[1] * g[17]; - g[22] = cp[2] * g[20] + 2 * b01[0] * g[18]; - g[23] = cp[5] * g[21] + 2 * b01[1] * g[19]; + g[18] = cpz[0] * g[16]; + g[19] = cpz[1] * g[17]; + g[20] = cpz[0] * g[18] + b01[0] * g[16]; + g[21] = cpz[1] * g[19] + b01[1] * g[17]; + g[22] = cpz[0] * g[20] + 2 * b01[0] * g[18]; + g[23] = cpz[1] * g[21] + 2 * b01[1] * g[19]; } -static inline void _g0_2d4d_0010(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; g[0] = 1; - g[1] = cp[0]; + g[1] = cpx[0]; g[2] = 1; - g[3] = cp[1]; + g[3] = cpy[0]; //g[4] = w[0]; - g[5] = cp[2] * g[4]; + g[5] = cpz[0] * g[4]; } -static inline void _g0_2d4d_0011(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0011(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; double xkxl = envs->rkrl[0]; double ykyl = envs->rkrl[1]; double zkzl = envs->rkrl[2]; g[0] = 1; g[1] = 1; - g[4] = cp[0]; - g[5] = cp[3]; - g[6] = cp[0] * (xkxl + cp[0]) + b01[0]; - g[7] = cp[3] * (xkxl + cp[3]) + b01[1]; - g[2] = xkxl + cp[0]; - g[3] = xkxl + cp[3]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[7] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[2] = xkxl + cpx[0]; + g[3] = xkxl + cpx[1]; g[12] = 1; g[13] = 1; - g[16] = cp[1]; - g[17] = cp[4]; - g[18] = cp[1] * (ykyl + cp[1]) + b01[0]; - g[19] = cp[4] * (ykyl + cp[4]) + b01[1]; - g[14] = ykyl + cp[1]; - g[15] = ykyl + cp[4]; + g[16] = cpy[0]; + g[17] = cpy[1]; + g[18] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[19] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[14] = ykyl + cpy[0]; + g[15] = ykyl + cpy[1]; //g[24] = w[0]; //g[25] = w[1]; - g[28] = cp[2] * g[24]; - g[29] = cp[5] * g[25]; - g[30] = g[28] * (zkzl + cp[2]) + b01[0] * g[24]; - g[31] = g[29] * (zkzl + cp[5]) + b01[1] * g[25]; - g[26] = g[24] * (zkzl + cp[2]); - g[27] = g[25] * (zkzl + cp[5]); + g[28] = cpz[0] * g[24]; + g[29] = cpz[1] * g[25]; + g[30] = g[28] * (zkzl + cpz[0]) + b01[0] * g[24]; + g[31] = g[29] * (zkzl + cpz[1]) + b01[1] * g[25]; + g[26] = g[24] * (zkzl + cpz[0]); + g[27] = g[25] * (zkzl + cpz[1]); } -static inline void _g0_2d4d_0012(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0012(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; double xkxl = envs->rkrl[0]; double ykyl = envs->rkrl[1]; double zkzl = envs->rkrl[2]; g[0] = 1; g[1] = 1; - g[4] = cp[0]; - g[5] = cp[3]; - g[8] = cp[0] * cp[0] + b01[0]; - g[9] = cp[3] * cp[3] + b01[1]; - g[10] = g[8] * (xkxl + cp[0]) + cp[0] * 2 * b01[0]; - g[11] = g[9] * (xkxl + cp[3]) + cp[3] * 2 * b01[1]; - g[6] = cp[0] * (xkxl + cp[0]) + b01[0]; - g[7] = cp[3] * (xkxl + cp[3]) + b01[1]; - g[2] = xkxl + cp[0]; - g[3] = xkxl + cp[3]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = g[8] * (xkxl + cpx[0]) + cpx[0] * 2 * b01[0]; + g[11] = g[9] * (xkxl + cpx[1]) + cpx[1] * 2 * b01[1]; + g[6] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[7] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[2] = xkxl + cpx[0]; + g[3] = xkxl + cpx[1]; g[16] = 1; g[17] = 1; - g[20] = cp[1]; - g[21] = cp[4]; - g[24] = cp[1] * cp[1] + b01[0]; - g[25] = cp[4] * cp[4] + b01[1]; - g[26] = g[24] * (ykyl + cp[1]) + cp[1] * 2 * b01[0]; - g[27] = g[25] * (ykyl + cp[4]) + cp[4] * 2 * b01[1]; - g[22] = cp[1] * (ykyl + cp[1]) + b01[0]; - g[23] = cp[4] * (ykyl + cp[4]) + b01[1]; - g[18] = ykyl + cp[1]; - g[19] = ykyl + cp[4]; + g[20] = cpy[0]; + g[21] = cpy[1]; + g[24] = cpy[0] * cpy[0] + b01[0]; + g[25] = cpy[1] * cpy[1] + b01[1]; + g[26] = g[24] * (ykyl + cpy[0]) + cpy[0] * 2 * b01[0]; + g[27] = g[25] * (ykyl + cpy[1]) + cpy[1] * 2 * b01[1]; + g[22] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[23] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[18] = ykyl + cpy[0]; + g[19] = ykyl + cpy[1]; //g[32] = w[0]; //g[33] = w[1]; - g[36] = cp[2] * g[32]; - g[37] = cp[5] * g[33]; - g[40] = cp[2] * g[36] + b01[0] * g[32]; - g[41] = cp[5] * g[37] + b01[1] * g[33]; - g[42] = g[40] * (zkzl + cp[2]) + 2 * b01[0] * g[36]; - g[43] = g[41] * (zkzl + cp[5]) + 2 * b01[1] * g[37]; - g[38] = g[36] * (zkzl + cp[2]) + b01[0] * g[32]; - g[39] = g[37] * (zkzl + cp[5]) + b01[1] * g[33]; - g[34] = g[32] * (zkzl + cp[2]); - g[35] = g[33] * (zkzl + cp[5]); + g[36] = cpz[0] * g[32]; + g[37] = cpz[1] * g[33]; + g[40] = cpz[0] * g[36] + b01[0] * g[32]; + g[41] = cpz[1] * g[37] + b01[1] * g[33]; + g[42] = g[40] * (zkzl + cpz[0]) + 2 * b01[0] * g[36]; + g[43] = g[41] * (zkzl + cpz[1]) + 2 * b01[1] * g[37]; + g[38] = g[36] * (zkzl + cpz[0]) + b01[0] * g[32]; + g[39] = g[37] * (zkzl + cpz[1]) + b01[1] * g[33]; + g[34] = g[32] * (zkzl + cpz[0]); + g[35] = g[33] * (zkzl + cpz[1]); } -static inline void _g0_2d4d_0020(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0020(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; g[6] = 1; g[7] = 1; - g[8] = cp[1]; - g[9] = cp[4]; - g[10] = cp[1] * cp[1] + b01[0]; - g[11] = cp[4] * cp[4] + b01[1]; + g[8] = cpy[0]; + g[9] = cpy[1]; + g[10] = cpy[0] * cpy[0] + b01[0]; + g[11] = cpy[1] * cpy[1] + b01[1]; //g[12] = w[0]; //g[13] = w[1]; - g[14] = cp[2] * g[12]; - g[15] = cp[5] * g[13]; - g[16] = cp[2] * g[14] + b01[0] * g[12]; - g[17] = cp[5] * g[15] + b01[1] * g[13]; + g[14] = cpz[0] * g[12]; + g[15] = cpz[1] * g[13]; + g[16] = cpz[0] * g[14] + b01[0] * g[12]; + g[17] = cpz[1] * g[15] + b01[1] * g[13]; } -static inline void _g0_2d4d_0021(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0021(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; double xkxl = envs->rkrl[0]; double ykyl = envs->rkrl[1]; double zkzl = envs->rkrl[2]; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; - g[8] = xkxl + cp[0]; - g[9] = xkxl + cp[3]; - g[10] = cp[0] * (xkxl + cp[0]) + b01[0]; - g[11] = cp[3] * (xkxl + cp[3]) + b01[1]; - g[12] = g[4] * (xkxl + cp[0]) + cp[0] * 2 * b01[0]; - g[13] = g[5] * (xkxl + cp[3]) + cp[3] * 2 * b01[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; + g[8] = xkxl + cpx[0]; + g[9] = xkxl + cpx[1]; + g[10] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[11] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[12] = g[4] * (xkxl + cpx[0]) + cpx[0] * 2 * b01[0]; + g[13] = g[5] * (xkxl + cpx[1]) + cpx[1] * 2 * b01[1]; g[16] = 1; g[17] = 1; - g[18] = cp[1]; - g[19] = cp[4]; - g[20] = cp[1] * cp[1] + b01[0]; - g[21] = cp[4] * cp[4] + b01[1]; - g[24] = ykyl + cp[1]; - g[25] = ykyl + cp[4]; - g[26] = cp[1] * (ykyl + cp[1]) + b01[0]; - g[27] = cp[4] * (ykyl + cp[4]) + b01[1]; - g[28] = g[20] * (ykyl + cp[1]) + cp[1] * 2 * b01[0]; - g[29] = g[21] * (ykyl + cp[4]) + cp[4] * 2 * b01[1]; + g[18] = cpy[0]; + g[19] = cpy[1]; + g[20] = cpy[0] * cpy[0] + b01[0]; + g[21] = cpy[1] * cpy[1] + b01[1]; + g[24] = ykyl + cpy[0]; + g[25] = ykyl + cpy[1]; + g[26] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[27] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[28] = g[20] * (ykyl + cpy[0]) + cpy[0] * 2 * b01[0]; + g[29] = g[21] * (ykyl + cpy[1]) + cpy[1] * 2 * b01[1]; //g[32] = w[0]; //g[33] = w[1]; - g[34] = cp[2] * g[32]; - g[35] = cp[5] * g[33]; - g[36] = cp[2] * g[34] + b01[0] * g[32]; - g[37] = cp[5] * g[35] + b01[1] * g[33]; - g[40] = g[32] * (zkzl + cp[2]); - g[41] = g[33] * (zkzl + cp[5]); - g[42] = g[34] * (zkzl + cp[2]) + b01[0] * g[32]; - g[43] = g[35] * (zkzl + cp[5]) + b01[1] * g[33]; - g[44] = g[36] * (zkzl + cp[2]) + 2 * b01[0] * g[34]; - g[45] = g[37] * (zkzl + cp[5]) + 2 * b01[1] * g[35]; + g[34] = cpz[0] * g[32]; + g[35] = cpz[1] * g[33]; + g[36] = cpz[0] * g[34] + b01[0] * g[32]; + g[37] = cpz[1] * g[35] + b01[1] * g[33]; + g[40] = g[32] * (zkzl + cpz[0]); + g[41] = g[33] * (zkzl + cpz[1]); + g[42] = g[34] * (zkzl + cpz[0]) + b01[0] * g[32]; + g[43] = g[35] * (zkzl + cpz[1]) + b01[1] * g[33]; + g[44] = g[36] * (zkzl + cpz[0]) + 2 * b01[0] * g[34]; + g[45] = g[37] * (zkzl + cpz[1]) + 2 * b01[1] * g[35]; } -static inline void _g0_2d4d_0030(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0030(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *cp = bc->c0p; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; - g[6] = cp[0] * (g[4] + 2 * b01[0]); - g[7] = cp[3] * (g[5] + 2 * b01[1]); + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; + g[6] = cpx[0] * (g[4] + 2 * b01[0]); + g[7] = cpx[1] * (g[5] + 2 * b01[1]); g[8] = 1; g[9] = 1; - g[10] = cp[1]; - g[11] = cp[4]; - g[12] = cp[1] * cp[1] + b01[0]; - g[13] = cp[4] * cp[4] + b01[1]; - g[14] = cp[1] * (g[12] + 2 * b01[0]); - g[15] = cp[4] * (g[13] + 2 * b01[1]); + g[10] = cpy[0]; + g[11] = cpy[1]; + g[12] = cpy[0] * cpy[0] + b01[0]; + g[13] = cpy[1] * cpy[1] + b01[1]; + g[14] = cpy[0] * (g[12] + 2 * b01[0]); + g[15] = cpy[1] * (g[13] + 2 * b01[1]); //g[16] = w[0]; //g[17] = w[1]; - g[18] = cp[2] * g[16]; - g[19] = cp[5] * g[17]; - g[20] = cp[2] * g[18] + b01[0] * g[16]; - g[21] = cp[5] * g[19] + b01[1] * g[17]; - g[22] = cp[2] * g[20] + 2 * b01[0] * g[18]; - g[23] = cp[5] * g[21] + 2 * b01[1] * g[19]; + g[18] = cpz[0] * g[16]; + g[19] = cpz[1] * g[17]; + g[20] = cpz[0] * g[18] + b01[0] * g[16]; + g[21] = cpz[1] * g[19] + b01[1] * g[17]; + g[22] = cpz[0] * g[20] + 2 * b01[0] * g[18]; + g[23] = cpz[1] * g[21] + 2 * b01[1] * g[19]; } -static inline void _g0_2d4d_0100(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; g[0] = 1; - g[1] = c0[0]; + g[1] = c0x[0]; g[2] = 1; - g[3] = c0[1]; + g[3] = c0y[0]; //g[4] = w[0]; - g[5] = c0[2] * g[4]; + g[5] = c0z[0] * g[4]; } -static inline void _g0_2d4d_0101(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0101(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = c0[0]; - g[5] = c0[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; g[8] = 1; g[9] = 1; - g[10] = cp[1]; - g[11] = cp[4]; - g[12] = c0[1]; - g[13] = c0[4]; - g[14] = cp[1] * c0[1] + b00[0]; - g[15] = cp[4] * c0[4] + b00[1]; + g[10] = cpy[0]; + g[11] = cpy[1]; + g[12] = c0y[0]; + g[13] = c0y[1]; + g[14] = cpy[0] * c0y[0] + b00[0]; + g[15] = cpy[1] * c0y[1] + b00[1]; //g[16] = w[0]; //g[17] = w[1]; - g[18] = cp[2] * g[16]; - g[19] = cp[5] * g[17]; - g[20] = c0[2] * g[16]; - g[21] = c0[5] * g[17]; - g[22] = cp[2] * g[20] + b00[0] * g[16]; - g[23] = cp[5] * g[21] + b00[1] * g[17]; + g[18] = cpz[0] * g[16]; + g[19] = cpz[1] * g[17]; + g[20] = c0z[0] * g[16]; + g[21] = c0z[1] * g[17]; + g[22] = cpz[0] * g[20] + b00[0] * g[16]; + g[23] = cpz[1] * g[21] + b00[1] * g[17]; } -static inline void _g0_2d4d_0102(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0102(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[6] = c0[0]; - g[7] = c0[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; - g[8] = cp[0] * c0[0] + b00[0]; - g[9] = cp[3] * c0[3] + b00[1]; - g[10] = cp[0] * (g[8] + b00[0]) + b01[0] * c0[0]; - g[11] = cp[3] * (g[9] + b00[1]) + b01[1] * c0[3]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[6] = c0x[0]; + g[7] = c0x[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; + g[8] = cpx[0] * c0x[0] + b00[0]; + g[9] = cpx[1] * c0x[1] + b00[1]; + g[10] = cpx[0] * (g[8] + b00[0]) + b01[0] * c0x[0]; + g[11] = cpx[1] * (g[9] + b00[1]) + b01[1] * c0x[1]; g[12] = 1; g[13] = 1; - g[14] = cp[1]; - g[15] = cp[4]; - g[18] = c0[1]; - g[19] = c0[4]; - g[16] = cp[1] * cp[1] + b01[0]; - g[17] = cp[4] * cp[4] + b01[1]; - g[20] = cp[1] * c0[1] + b00[0]; - g[21] = cp[4] * c0[4] + b00[1]; - g[22] = cp[1] * (g[20] + b00[0]) + b01[0] * c0[1]; - g[23] = cp[4] * (g[21] + b00[1]) + b01[1] * c0[4]; + g[14] = cpy[0]; + g[15] = cpy[1]; + g[18] = c0y[0]; + g[19] = c0y[1]; + g[16] = cpy[0] * cpy[0] + b01[0]; + g[17] = cpy[1] * cpy[1] + b01[1]; + g[20] = cpy[0] * c0y[0] + b00[0]; + g[21] = cpy[1] * c0y[1] + b00[1]; + g[22] = cpy[0] * (g[20] + b00[0]) + b01[0] * c0y[0]; + g[23] = cpy[1] * (g[21] + b00[1]) + b01[1] * c0y[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = cp[2] * g[24]; - g[27] = cp[5] * g[25]; - g[30] = c0[2] * g[24]; - g[31] = c0[5] * g[25]; - g[28] = cp[2] * g[26] + b01[0] * g[24]; - g[29] = cp[5] * g[27] + b01[1] * g[25]; - g[32] = cp[2] * g[30] + b00[0] * g[24]; - g[33] = cp[5] * g[31] + b00[1] * g[25]; - g[34] = cp[2] * g[32] + b01[0] * g[30] + b00[0] * g[26]; - g[35] = cp[5] * g[33] + b01[1] * g[31] + b00[1] * g[27]; -} - -static inline void _g0_2d4d_0110(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[26] = cpz[0] * g[24]; + g[27] = cpz[1] * g[25]; + g[30] = c0z[0] * g[24]; + g[31] = c0z[1] * g[25]; + g[28] = cpz[0] * g[26] + b01[0] * g[24]; + g[29] = cpz[1] * g[27] + b01[1] * g[25]; + g[32] = cpz[0] * g[30] + b00[0] * g[24]; + g[33] = cpz[1] * g[31] + b00[1] * g[25]; + g[34] = cpz[0] * g[32] + b01[0] * g[30] + b00[0] * g[26]; + g[35] = cpz[1] * g[33] + b01[1] * g[31] + b00[1] * g[27]; +} + +static inline void _g0_2d4d_0110(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = c0[0]; - g[5] = c0[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; g[8] = 1; g[9] = 1; - g[10] = cp[1]; - g[11] = cp[4]; - g[12] = c0[1]; - g[13] = c0[4]; - g[14] = cp[1] * c0[1] + b00[0]; - g[15] = cp[4] * c0[4] + b00[1]; + g[10] = cpy[0]; + g[11] = cpy[1]; + g[12] = c0y[0]; + g[13] = c0y[1]; + g[14] = cpy[0] * c0y[0] + b00[0]; + g[15] = cpy[1] * c0y[1] + b00[1]; //g[16] = w[0]; //g[17] = w[1]; - g[18] = cp[2] * g[16]; - g[19] = cp[5] * g[17]; - g[20] = c0[2] * g[16]; - g[21] = c0[5] * g[17]; - g[22] = cp[2] * g[20] + b00[0] * g[16]; - g[23] = cp[5] * g[21] + b00[1] * g[17]; + g[18] = cpz[0] * g[16]; + g[19] = cpz[1] * g[17]; + g[20] = c0z[0] * g[16]; + g[21] = c0z[1] * g[17]; + g[22] = cpz[0] * g[20] + b00[0] * g[16]; + g[23] = cpz[1] * g[21] + b00[1] * g[17]; } -static inline void _g0_2d4d_0111(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0111(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; double xkxl = envs->rkrl[0]; @@ -1058,361 +1116,395 @@ static inline void _g0_2d4d_0111(double *restrict g, struct _BC *bc, CINTEnvVars double zkzl = envs->rkrl[2]; g[0] = 1; g[1] = 1; - g[12] = c0[0]; - g[13] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[16] = cp[0] * c0[0] + b00[0]; - g[17] = cp[3] * c0[3] + b00[1]; - g[6] = cp[0] * (xkxl + cp[0]) + b01[0]; - g[7] = cp[3] * (xkxl + cp[3]) + b01[1]; - g[18] = g[16] * (xkxl + cp[0]) + cp[0] * b00[0] + b01[0] * c0[0]; - g[19] = g[17] * (xkxl + cp[3]) + cp[3] * b00[1] + b01[1] * c0[3]; - g[2] = xkxl + cp[0]; - g[3] = xkxl + cp[3]; - g[14] = c0[0] * (xkxl + cp[0]) + b00[0]; - g[15] = c0[3] * (xkxl + cp[3]) + b00[1]; + g[12] = c0x[0]; + g[13] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[16] = cpx[0] * c0x[0] + b00[0]; + g[17] = cpx[1] * c0x[1] + b00[1]; + g[6] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[7] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[18] = g[16] * (xkxl + cpx[0]) + cpx[0] * b00[0] + b01[0] * c0x[0]; + g[19] = g[17] * (xkxl + cpx[1]) + cpx[1] * b00[1] + b01[1] * c0x[1]; + g[2] = xkxl + cpx[0]; + g[3] = xkxl + cpx[1]; + g[14] = c0x[0] * (xkxl + cpx[0]) + b00[0]; + g[15] = c0x[1] * (xkxl + cpx[1]) + b00[1]; g[24] = 1; g[25] = 1; - g[36] = c0[1]; - g[37] = c0[4]; - g[28] = cp[1]; - g[29] = cp[4]; - g[40] = cp[1] * c0[1] + b00[0]; - g[41] = cp[4] * c0[4] + b00[1]; - g[30] = cp[1] * (ykyl + cp[1]) + b01[0]; - g[31] = cp[4] * (ykyl + cp[4]) + b01[1]; - g[42] = g[40] * (ykyl + cp[1]) + cp[1] * b00[0] + b01[0] * c0[1]; - g[43] = g[41] * (ykyl + cp[4]) + cp[4] * b00[1] + b01[1] * c0[4]; - g[26] = ykyl + cp[1]; - g[27] = ykyl + cp[4]; - g[38] = c0[1] * (ykyl + cp[1]) + b00[0]; - g[39] = c0[4] * (ykyl + cp[4]) + b00[1]; + g[36] = c0y[0]; + g[37] = c0y[1]; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[40] = cpy[0] * c0y[0] + b00[0]; + g[41] = cpy[1] * c0y[1] + b00[1]; + g[30] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[31] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[42] = g[40] * (ykyl + cpy[0]) + cpy[0] * b00[0] + b01[0] * c0y[0]; + g[43] = g[41] * (ykyl + cpy[1]) + cpy[1] * b00[1] + b01[1] * c0y[1]; + g[26] = ykyl + cpy[0]; + g[27] = ykyl + cpy[1]; + g[38] = c0y[0] * (ykyl + cpy[0]) + b00[0]; + g[39] = c0y[1] * (ykyl + cpy[1]) + b00[1]; //g[48] = w[0]; //g[49] = w[1]; - g[60] = c0[2] * g[48]; - g[61] = c0[5] * g[49]; - g[52] = cp[2] * g[48]; - g[53] = cp[5] * g[49]; - g[64] = cp[2] * g[60] + b00[0] * g[48]; - g[65] = cp[5] * g[61] + b00[1] * g[49]; - g[54] = g[52] * (zkzl + cp[2]) + b01[0] * g[48]; - g[55] = g[53] * (zkzl + cp[5]) + b01[1] * g[49]; - g[66] = g[64] * (zkzl + cp[2]) + b01[0] * g[60] + b00[0] * g[52]; - g[67] = g[65] * (zkzl + cp[5]) + b01[1] * g[61] + b00[1] * g[53]; - g[50] = g[48] * (zkzl + cp[2]); - g[51] = g[49] * (zkzl + cp[5]); - g[62] = g[60] * (zkzl + cp[2]) + b00[0] * g[48]; - g[63] = g[61] * (zkzl + cp[5]) + b00[1] * g[49]; -} - -static inline void _g0_2d4d_0120(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[60] = c0z[0] * g[48]; + g[61] = c0z[1] * g[49]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[64] = cpz[0] * g[60] + b00[0] * g[48]; + g[65] = cpz[1] * g[61] + b00[1] * g[49]; + g[54] = g[52] * (zkzl + cpz[0]) + b01[0] * g[48]; + g[55] = g[53] * (zkzl + cpz[1]) + b01[1] * g[49]; + g[66] = g[64] * (zkzl + cpz[0]) + b01[0] * g[60] + b00[0] * g[52]; + g[67] = g[65] * (zkzl + cpz[1]) + b01[1] * g[61] + b00[1] * g[53]; + g[50] = g[48] * (zkzl + cpz[0]); + g[51] = g[49] * (zkzl + cpz[1]); + g[62] = g[60] * (zkzl + cpz[0]) + b00[0] * g[48]; + g[63] = g[61] * (zkzl + cpz[1]) + b00[1] * g[49]; +} + +static inline void _g0_2d4d_0120(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[6] = c0[0]; - g[7] = c0[3]; - g[4] = cp[0] * cp[0] + b01[0]; - g[5] = cp[3] * cp[3] + b01[1]; - g[8] = cp[0] * c0[0] + b00[0]; - g[9] = cp[3] * c0[3] + b00[1]; - g[10] = cp[0] * (g[8] + b00[0]) + b01[0] * c0[0]; - g[11] = cp[3] * (g[9] + b00[1]) + b01[1] * c0[3]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[6] = c0x[0]; + g[7] = c0x[1]; + g[4] = cpx[0] * cpx[0] + b01[0]; + g[5] = cpx[1] * cpx[1] + b01[1]; + g[8] = cpx[0] * c0x[0] + b00[0]; + g[9] = cpx[1] * c0x[1] + b00[1]; + g[10] = cpx[0] * (g[8] + b00[0]) + b01[0] * c0x[0]; + g[11] = cpx[1] * (g[9] + b00[1]) + b01[1] * c0x[1]; g[12] = 1; g[13] = 1; - g[14] = cp[1]; - g[15] = cp[4]; - g[18] = c0[1]; - g[19] = c0[4]; - g[16] = cp[1] * cp[1] + b01[0]; - g[17] = cp[4] * cp[4] + b01[1]; - g[20] = cp[1] * c0[1] + b00[0]; - g[21] = cp[4] * c0[4] + b00[1]; - g[22] = cp[1] * (g[20] + b00[0]) + b01[0] * c0[1]; - g[23] = cp[4] * (g[21] + b00[1]) + b01[1] * c0[4]; + g[14] = cpy[0]; + g[15] = cpy[1]; + g[18] = c0y[0]; + g[19] = c0y[1]; + g[16] = cpy[0] * cpy[0] + b01[0]; + g[17] = cpy[1] * cpy[1] + b01[1]; + g[20] = cpy[0] * c0y[0] + b00[0]; + g[21] = cpy[1] * c0y[1] + b00[1]; + g[22] = cpy[0] * (g[20] + b00[0]) + b01[0] * c0y[0]; + g[23] = cpy[1] * (g[21] + b00[1]) + b01[1] * c0y[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = cp[2] * g[24]; - g[27] = cp[5] * g[25]; - g[30] = c0[2] * g[24]; - g[31] = c0[5] * g[25]; - g[28] = cp[2] * g[26] + b01[0] * g[24]; - g[29] = cp[5] * g[27] + b01[1] * g[25]; - g[32] = cp[2] * g[30] + b00[0] * g[24]; - g[33] = cp[5] * g[31] + b00[1] * g[25]; - g[34] = cp[2] * g[32] + b01[0] * g[30] + b00[0] * g[26]; - g[35] = cp[5] * g[33] + b01[1] * g[31] + b00[1] * g[27]; + g[26] = cpz[0] * g[24]; + g[27] = cpz[1] * g[25]; + g[30] = c0z[0] * g[24]; + g[31] = c0z[1] * g[25]; + g[28] = cpz[0] * g[26] + b01[0] * g[24]; + g[29] = cpz[1] * g[27] + b01[1] * g[25]; + g[32] = cpz[0] * g[30] + b00[0] * g[24]; + g[33] = cpz[1] * g[31] + b00[1] * g[25]; + g[34] = cpz[0] * g[32] + b01[0] * g[30] + b00[0] * g[26]; + g[35] = cpz[1] * g[33] + b01[1] * g[31] + b00[1] * g[27]; } -static inline void _g0_2d4d_0200(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0200(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; g[6] = 1; g[7] = 1; - g[8] = c0[1]; - g[9] = c0[4]; - g[10] = c0[1] * c0[1] + b10[0]; - g[11] = c0[4] * c0[4] + b10[1]; + g[8] = c0y[0]; + g[9] = c0y[1]; + g[10] = c0y[0] * c0y[0] + b10[0]; + g[11] = c0y[1] * c0y[1] + b10[1]; //g[12] = w[0]; //g[13] = w[1]; - g[14] = c0[2] * g[12]; - g[15] = c0[5] * g[13]; - g[16] = c0[2] * g[14] + b10[0] * g[12]; - g[17] = c0[5] * g[15] + b10[1] * g[13]; + g[14] = c0z[0] * g[12]; + g[15] = c0z[1] * g[13]; + g[16] = c0z[0] * g[14] + b10[0] * g[12]; + g[17] = c0z[1] * g[15] + b10[1] * g[13]; } -static inline void _g0_2d4d_0201(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0201(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[4] = c0[0]; - g[5] = c0[3]; - g[8] = c0[0] * c0[0] + b10[0]; - g[9] = c0[3] * c0[3] + b10[1]; - g[2] = cp[0]; - g[3] = cp[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; - g[10] = c0[0] * (g[6] + b00[0]) + b10[0] * cp[0]; - g[11] = c0[3] * (g[7] + b00[1]) + b10[1] * cp[3]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; + g[10] = c0x[0] * (g[6] + b00[0]) + b10[0] * cpx[0]; + g[11] = c0x[1] * (g[7] + b00[1]) + b10[1] * cpx[1]; g[12] = 1; g[13] = 1; - g[16] = c0[1]; - g[17] = c0[4]; - g[20] = c0[1] * c0[1] + b10[0]; - g[21] = c0[4] * c0[4] + b10[1]; - g[14] = cp[1]; - g[15] = cp[4]; - g[18] = cp[1] * c0[1] + b00[0]; - g[19] = cp[4] * c0[4] + b00[1]; - g[22] = c0[1] * (g[18] + b00[0]) + b10[0] * cp[1]; - g[23] = c0[4] * (g[19] + b00[1]) + b10[1] * cp[4]; + g[16] = c0y[0]; + g[17] = c0y[1]; + g[20] = c0y[0] * c0y[0] + b10[0]; + g[21] = c0y[1] * c0y[1] + b10[1]; + g[14] = cpy[0]; + g[15] = cpy[1]; + g[18] = cpy[0] * c0y[0] + b00[0]; + g[19] = cpy[1] * c0y[1] + b00[1]; + g[22] = c0y[0] * (g[18] + b00[0]) + b10[0] * cpy[0]; + g[23] = c0y[1] * (g[19] + b00[1]) + b10[1] * cpy[1]; //g[24] = w[0]; //g[25] = w[1]; - g[28] = c0[2] * g[24]; - g[29] = c0[5] * g[25]; - g[32] = c0[2] * g[28] + b10[0] * g[24]; - g[33] = c0[5] * g[29] + b10[1] * g[25]; - g[26] = cp[2] * g[24]; - g[27] = cp[5] * g[25]; - g[30] = cp[2] * g[28] + b00[0] * g[24]; - g[31] = cp[5] * g[29] + b00[1] * g[25]; - g[34] = c0[2] * g[30] + b10[0] * g[26] + b00[0] * g[28]; - g[35] = c0[5] * g[31] + b10[1] * g[27] + b00[1] * g[29]; -} - -static inline void _g0_2d4d_0210(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[28] = c0z[0] * g[24]; + g[29] = c0z[1] * g[25]; + g[32] = c0z[0] * g[28] + b10[0] * g[24]; + g[33] = c0z[1] * g[29] + b10[1] * g[25]; + g[26] = cpz[0] * g[24]; + g[27] = cpz[1] * g[25]; + g[30] = cpz[0] * g[28] + b00[0] * g[24]; + g[31] = cpz[1] * g[29] + b00[1] * g[25]; + g[34] = c0z[0] * g[30] + b10[0] * g[26] + b00[0] * g[28]; + g[35] = c0z[1] * g[31] + b10[1] * g[27] + b00[1] * g[29]; +} + +static inline void _g0_2d4d_0210(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = cp[0]; - g[3] = cp[3]; - g[4] = c0[0]; - g[5] = c0[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; - g[8] = c0[0] * c0[0] + b10[0]; - g[9] = c0[3] * c0[3] + b10[1]; - g[10] = c0[0] * (g[6] + b00[0]) + b10[0] * cp[0]; - g[11] = c0[3] * (g[7] + b00[1]) + b10[1] * cp[3]; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[0] * (g[6] + b00[0]) + b10[0] * cpx[0]; + g[11] = c0x[1] * (g[7] + b00[1]) + b10[1] * cpx[1]; g[12] = 1; g[13] = 1; - g[14] = cp[1]; - g[15] = cp[4]; - g[16] = c0[1]; - g[17] = c0[4]; - g[18] = cp[1] * c0[1] + b00[0]; - g[19] = cp[4] * c0[4] + b00[1]; - g[20] = c0[1] * c0[1] + b10[0]; - g[21] = c0[4] * c0[4] + b10[1]; - g[22] = c0[1] * (g[18] + b00[0]) + b10[0] * cp[1]; - g[23] = c0[4] * (g[19] + b00[1]) + b10[1] * cp[4]; + g[14] = cpy[0]; + g[15] = cpy[1]; + g[16] = c0y[0]; + g[17] = c0y[1]; + g[18] = cpy[0] * c0y[0] + b00[0]; + g[19] = cpy[1] * c0y[1] + b00[1]; + g[20] = c0y[0] * c0y[0] + b10[0]; + g[21] = c0y[1] * c0y[1] + b10[1]; + g[22] = c0y[0] * (g[18] + b00[0]) + b10[0] * cpy[0]; + g[23] = c0y[1] * (g[19] + b00[1]) + b10[1] * cpy[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = cp[2] * g[24]; - g[27] = cp[5] * g[25]; - g[28] = c0[2] * g[24]; - g[29] = c0[5] * g[25]; - g[30] = cp[2] * g[28] + b00[0] * g[24]; - g[31] = cp[5] * g[29] + b00[1] * g[25]; - g[32] = c0[2] * g[28] + b10[0] * g[24]; - g[33] = c0[5] * g[29] + b10[1] * g[25]; - g[34] = c0[2] * g[30] + b10[0] * g[26] + b00[0] * g[28]; - g[35] = c0[5] * g[31] + b10[1] * g[27] + b00[1] * g[29]; + g[26] = cpz[0] * g[24]; + g[27] = cpz[1] * g[25]; + g[28] = c0z[0] * g[24]; + g[29] = c0z[1] * g[25]; + g[30] = cpz[0] * g[28] + b00[0] * g[24]; + g[31] = cpz[1] * g[29] + b00[1] * g[25]; + g[32] = c0z[0] * g[28] + b10[0] * g[24]; + g[33] = c0z[1] * g[29] + b10[1] * g[25]; + g[34] = c0z[0] * g[30] + b10[0] * g[26] + b00[0] * g[28]; + g[35] = c0z[1] * g[31] + b10[1] * g[27] + b00[1] * g[29]; } -static inline void _g0_2d4d_0300(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_0300(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; - g[6] = c0[0] * (g[4] + 2 * b10[0]); - g[7] = c0[3] * (g[5] + 2 * b10[1]); + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; + g[6] = c0x[0] * (g[4] + 2 * b10[0]); + g[7] = c0x[1] * (g[5] + 2 * b10[1]); g[8] = 1; g[9] = 1; - g[10] = c0[1]; - g[11] = c0[4]; - g[12] = c0[1] * c0[1] + b10[0]; - g[13] = c0[4] * c0[4] + b10[1]; - g[14] = c0[1] * (g[12] + 2 * b10[0]); - g[15] = c0[4] * (g[13] + 2 * b10[1]); + g[10] = c0y[0]; + g[11] = c0y[1]; + g[12] = c0y[0] * c0y[0] + b10[0]; + g[13] = c0y[1] * c0y[1] + b10[1]; + g[14] = c0y[0] * (g[12] + 2 * b10[0]); + g[15] = c0y[1] * (g[13] + 2 * b10[1]); //g[16] = w[0]; //g[17] = w[1]; - g[18] = c0[2] * g[16]; - g[19] = c0[5] * g[17]; - g[20] = c0[2] * g[18] + b10[0] * g[16]; - g[21] = c0[5] * g[19] + b10[1] * g[17]; - g[22] = c0[2] * g[20] + 2 * b10[0] * g[18]; - g[23] = c0[5] * g[21] + 2 * b10[1] * g[19]; + g[18] = c0z[0] * g[16]; + g[19] = c0z[1] * g[17]; + g[20] = c0z[0] * g[18] + b10[0] * g[16]; + g[21] = c0z[1] * g[19] + b10[1] * g[17]; + g[22] = c0z[0] * g[20] + 2 * b10[0] * g[18]; + g[23] = c0z[1] * g[21] + 2 * b10[1] * g[19]; } -static inline void _g0_2d4d_1000(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; g[0] = 1; - g[1] = c0[0]; + g[1] = c0x[0]; g[2] = 1; - g[3] = c0[1]; + g[3] = c0y[0]; //g[4] = w[0]; - g[5] = c0[2] * g[4]; + g[5] = c0z[0] * g[4]; } -static inline void _g0_2d4d_1001(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; g[8] = 1; g[9] = 1; - g[10] = c0[1]; - g[11] = c0[4]; - g[12] = cp[1]; - g[13] = cp[4]; - g[14] = cp[1] * c0[1] + b00[0]; - g[15] = cp[4] * c0[4] + b00[1]; + g[10] = c0y[0]; + g[11] = c0y[1]; + g[12] = cpy[0]; + g[13] = cpy[1]; + g[14] = cpy[0] * c0y[0] + b00[0]; + g[15] = cpy[1] * c0y[1] + b00[1]; //g[16] = w[0]; //g[17] = w[1]; - g[18] = c0[2] * g[16]; - g[19] = c0[5] * g[17]; - g[20] = cp[2] * g[16]; - g[21] = cp[5] * g[17]; - g[22] = cp[2] * g[18] + b00[0] * g[16]; - g[23] = cp[5] * g[19] + b00[1] * g[17]; + g[18] = c0z[0] * g[16]; + g[19] = c0z[1] * g[17]; + g[20] = cpz[0] * g[16]; + g[21] = cpz[1] * g[17]; + g[22] = cpz[0] * g[18] + b00[0] * g[16]; + g[23] = cpz[1] * g[19] + b00[1] * g[17]; } -static inline void _g0_2d4d_1002(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1002(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; - g[8] = cp[0] * cp[0] + b01[0]; - g[9] = cp[3] * cp[3] + b01[1]; - g[10] = cp[0] * (g[6] + b00[0]) + b01[0] * c0[0]; - g[11] = cp[3] * (g[7] + b00[1]) + b01[1] * c0[3]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[0] * (g[6] + b00[0]) + b01[0] * c0x[0]; + g[11] = cpx[1] * (g[7] + b00[1]) + b01[1] * c0x[1]; g[12] = 1; g[13] = 1; - g[14] = c0[1]; - g[15] = c0[4]; - g[16] = cp[1]; - g[17] = cp[4]; - g[18] = cp[1] * c0[1] + b00[0]; - g[19] = cp[4] * c0[4] + b00[1]; - g[20] = cp[1] * cp[1] + b01[0]; - g[21] = cp[4] * cp[4] + b01[1]; - g[22] = cp[1] * (g[18] + b00[0]) + b01[0] * c0[1]; - g[23] = cp[4] * (g[19] + b00[1]) + b01[1] * c0[4]; + g[14] = c0y[0]; + g[15] = c0y[1]; + g[16] = cpy[0]; + g[17] = cpy[1]; + g[18] = cpy[0] * c0y[0] + b00[0]; + g[19] = cpy[1] * c0y[1] + b00[1]; + g[20] = cpy[0] * cpy[0] + b01[0]; + g[21] = cpy[1] * cpy[1] + b01[1]; + g[22] = cpy[0] * (g[18] + b00[0]) + b01[0] * c0y[0]; + g[23] = cpy[1] * (g[19] + b00[1]) + b01[1] * c0y[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = c0[2] * g[24]; - g[27] = c0[5] * g[25]; - g[28] = cp[2] * g[24]; - g[29] = cp[5] * g[25]; - g[30] = cp[2] * g[26] + b00[0] * g[24]; - g[31] = cp[5] * g[27] + b00[1] * g[25]; - g[32] = cp[2] * g[28] + b01[0] * g[24]; - g[33] = cp[5] * g[29] + b01[1] * g[25]; - g[34] = cp[2] * g[30] + b01[0] * g[26] + b00[0] * g[28]; - g[35] = cp[5] * g[31] + b01[1] * g[27] + b00[1] * g[29]; -} - -static inline void _g0_2d4d_1010(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[26] = c0z[0] * g[24]; + g[27] = c0z[1] * g[25]; + g[28] = cpz[0] * g[24]; + g[29] = cpz[1] * g[25]; + g[30] = cpz[0] * g[26] + b00[0] * g[24]; + g[31] = cpz[1] * g[27] + b00[1] * g[25]; + g[32] = cpz[0] * g[28] + b01[0] * g[24]; + g[33] = cpz[1] * g[29] + b01[1] * g[25]; + g[34] = cpz[0] * g[30] + b01[0] * g[26] + b00[0] * g[28]; + g[35] = cpz[1] * g[31] + b01[1] * g[27] + b00[1] * g[29]; +} + +static inline void _g0_2d4d_1010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; g[8] = 1; g[9] = 1; - g[10] = c0[1]; - g[11] = c0[4]; - g[12] = cp[1]; - g[13] = cp[4]; - g[14] = cp[1] * c0[1] + b00[0]; - g[15] = cp[4] * c0[4] + b00[1]; + g[10] = c0y[0]; + g[11] = c0y[1]; + g[12] = cpy[0]; + g[13] = cpy[1]; + g[14] = cpy[0] * c0y[0] + b00[0]; + g[15] = cpy[1] * c0y[1] + b00[1]; //g[16] = w[0]; //g[17] = w[1]; - g[18] = c0[2] * g[16]; - g[19] = c0[5] * g[17]; - g[20] = cp[2] * g[16]; - g[21] = cp[5] * g[17]; - g[22] = cp[2] * g[18] + b00[0] * g[16]; - g[23] = cp[5] * g[19] + b00[1] * g[17]; + g[18] = c0z[0] * g[16]; + g[19] = c0z[1] * g[17]; + g[20] = cpz[0] * g[16]; + g[21] = cpz[1] * g[17]; + g[22] = cpz[0] * g[18] + b00[0] * g[16]; + g[23] = cpz[1] * g[19] + b00[1] * g[17]; } -static inline void _g0_2d4d_1011(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1011(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; double xkxl = envs->rkrl[0]; @@ -1420,135 +1512,145 @@ static inline void _g0_2d4d_1011(double *restrict g, struct _BC *bc, CINTEnvVars double zkzl = envs->rkrl[2]; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[8] = cp[0]; - g[9] = cp[3]; - g[10] = cp[0] * c0[0] + b00[0]; - g[11] = cp[3] * c0[3] + b00[1]; - g[12] = cp[0] * (xkxl + cp[0]) + b01[0]; - g[13] = cp[3] * (xkxl + cp[3]) + b01[1]; - g[14] = g[10] * (xkxl + cp[0]) + cp[0] * b00[0] + b01[0] * c0[0]; - g[15] = g[11] * (xkxl + cp[3]) + cp[3] * b00[1] + b01[1] * c0[3]; - g[4] = xkxl + cp[0]; - g[5] = xkxl + cp[3]; - g[6] = c0[0] * (xkxl + cp[0]) + b00[0]; - g[7] = c0[3] * (xkxl + cp[3]) + b00[1]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[0] * c0x[0] + b00[0]; + g[11] = cpx[1] * c0x[1] + b00[1]; + g[12] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[13] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[14] = g[10] * (xkxl + cpx[0]) + cpx[0] * b00[0] + b01[0] * c0x[0]; + g[15] = g[11] * (xkxl + cpx[1]) + cpx[1] * b00[1] + b01[1] * c0x[1]; + g[4] = xkxl + cpx[0]; + g[5] = xkxl + cpx[1]; + g[6] = c0x[0] * (xkxl + cpx[0]) + b00[0]; + g[7] = c0x[1] * (xkxl + cpx[1]) + b00[1]; g[24] = 1; g[25] = 1; - g[26] = c0[1]; - g[27] = c0[4]; - g[32] = cp[1]; - g[33] = cp[4]; - g[34] = cp[1] * c0[1] + b00[0]; - g[35] = cp[4] * c0[4] + b00[1]; - g[36] = cp[1] * (ykyl + cp[1]) + b01[0]; - g[37] = cp[4] * (ykyl + cp[4]) + b01[1]; - g[38] = g[34] * (ykyl + cp[1]) + cp[1] * b00[0] + b01[0] * c0[1]; - g[39] = g[35] * (ykyl + cp[4]) + cp[4] * b00[1] + b01[1] * c0[4]; - g[28] = ykyl + cp[1]; - g[29] = ykyl + cp[4]; - g[30] = c0[1] * (ykyl + cp[1]) + b00[0]; - g[31] = c0[4] * (ykyl + cp[4]) + b00[1]; + g[26] = c0y[0]; + g[27] = c0y[1]; + g[32] = cpy[0]; + g[33] = cpy[1]; + g[34] = cpy[0] * c0y[0] + b00[0]; + g[35] = cpy[1] * c0y[1] + b00[1]; + g[36] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[37] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[38] = g[34] * (ykyl + cpy[0]) + cpy[0] * b00[0] + b01[0] * c0y[0]; + g[39] = g[35] * (ykyl + cpy[1]) + cpy[1] * b00[1] + b01[1] * c0y[1]; + g[28] = ykyl + cpy[0]; + g[29] = ykyl + cpy[1]; + g[30] = c0y[0] * (ykyl + cpy[0]) + b00[0]; + g[31] = c0y[1] * (ykyl + cpy[1]) + b00[1]; //g[48] = w[0]; //g[49] = w[1]; - g[50] = c0[2] * g[48]; - g[51] = c0[5] * g[49]; - g[56] = cp[2] * g[48]; - g[57] = cp[5] * g[49]; - g[58] = cp[2] * g[50] + b00[0] * g[48]; - g[59] = cp[5] * g[51] + b00[1] * g[49]; - g[60] = g[56] * (zkzl + cp[2]) + b01[0] * g[48]; - g[61] = g[57] * (zkzl + cp[5]) + b01[1] * g[49]; - g[62] = g[58] * (zkzl + cp[2]) + b01[0] * g[50] + b00[0] * g[56]; - g[63] = g[59] * (zkzl + cp[5]) + b01[1] * g[51] + b00[1] * g[57]; - g[52] = g[48] * (zkzl + cp[2]); - g[53] = g[49] * (zkzl + cp[5]); - g[54] = g[50] * (zkzl + cp[2]) + b00[0] * g[48]; - g[55] = g[51] * (zkzl + cp[5]) + b00[1] * g[49]; -} - -static inline void _g0_2d4d_1020(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[50] = c0z[0] * g[48]; + g[51] = c0z[1] * g[49]; + g[56] = cpz[0] * g[48]; + g[57] = cpz[1] * g[49]; + g[58] = cpz[0] * g[50] + b00[0] * g[48]; + g[59] = cpz[1] * g[51] + b00[1] * g[49]; + g[60] = g[56] * (zkzl + cpz[0]) + b01[0] * g[48]; + g[61] = g[57] * (zkzl + cpz[1]) + b01[1] * g[49]; + g[62] = g[58] * (zkzl + cpz[0]) + b01[0] * g[50] + b00[0] * g[56]; + g[63] = g[59] * (zkzl + cpz[1]) + b01[1] * g[51] + b00[1] * g[57]; + g[52] = g[48] * (zkzl + cpz[0]); + g[53] = g[49] * (zkzl + cpz[1]); + g[54] = g[50] * (zkzl + cpz[0]) + b00[0] * g[48]; + g[55] = g[51] * (zkzl + cpz[1]) + b00[1] * g[49]; +} + +static inline void _g0_2d4d_1020(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b01 = bc->b01; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[6] = cp[0] * c0[0] + b00[0]; - g[7] = cp[3] * c0[3] + b00[1]; - g[8] = cp[0] * cp[0] + b01[0]; - g[9] = cp[3] * cp[3] + b01[1]; - g[10] = cp[0] * (g[6] + b00[0]) + b01[0] * c0[0]; - g[11] = cp[3] * (g[7] + b00[1]) + b01[1] * c0[3]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[0] * c0x[0] + b00[0]; + g[7] = cpx[1] * c0x[1] + b00[1]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[0] * (g[6] + b00[0]) + b01[0] * c0x[0]; + g[11] = cpx[1] * (g[7] + b00[1]) + b01[1] * c0x[1]; g[12] = 1; g[13] = 1; - g[14] = c0[1]; - g[15] = c0[4]; - g[16] = cp[1]; - g[17] = cp[4]; - g[18] = cp[1] * c0[1] + b00[0]; - g[19] = cp[4] * c0[4] + b00[1]; - g[20] = cp[1] * cp[1] + b01[0]; - g[21] = cp[4] * cp[4] + b01[1]; - g[22] = cp[1] * (g[18] + b00[0]) + b01[0] * c0[1]; - g[23] = cp[4] * (g[19] + b00[1]) + b01[1] * c0[4]; + g[14] = c0y[0]; + g[15] = c0y[1]; + g[16] = cpy[0]; + g[17] = cpy[1]; + g[18] = cpy[0] * c0y[0] + b00[0]; + g[19] = cpy[1] * c0y[1] + b00[1]; + g[20] = cpy[0] * cpy[0] + b01[0]; + g[21] = cpy[1] * cpy[1] + b01[1]; + g[22] = cpy[0] * (g[18] + b00[0]) + b01[0] * c0y[0]; + g[23] = cpy[1] * (g[19] + b00[1]) + b01[1] * c0y[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = c0[2] * g[24]; - g[27] = c0[5] * g[25]; - g[28] = cp[2] * g[24]; - g[29] = cp[5] * g[25]; - g[30] = cp[2] * g[26] + b00[0] * g[24]; - g[31] = cp[5] * g[27] + b00[1] * g[25]; - g[32] = cp[2] * g[28] + b01[0] * g[24]; - g[33] = cp[5] * g[29] + b01[1] * g[25]; - g[34] = cp[2] * g[30] + b01[0] * g[26] + b00[0] * g[28]; - g[35] = cp[5] * g[31] + b01[1] * g[27] + b00[1] * g[29]; + g[26] = c0z[0] * g[24]; + g[27] = c0z[1] * g[25]; + g[28] = cpz[0] * g[24]; + g[29] = cpz[1] * g[25]; + g[30] = cpz[0] * g[26] + b00[0] * g[24]; + g[31] = cpz[1] * g[27] + b00[1] * g[25]; + g[32] = cpz[0] * g[28] + b01[0] * g[24]; + g[33] = cpz[1] * g[29] + b01[1] * g[25]; + g[34] = cpz[0] * g[30] + b01[0] * g[26] + b00[0] * g[28]; + g[35] = cpz[1] * g[31] + b01[1] * g[27] + b00[1] * g[29]; } -static inline void _g0_2d4d_1100(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; double xixj = envs->rirj[0]; double yiyj = envs->rirj[1]; double zizj = envs->rirj[2]; g[0] = 1; g[1] = 1; - g[4] = c0[0]; - g[5] = c0[3]; - g[6] = c0[0] * (xixj + c0[0]) + b10[0]; - g[7] = c0[3] * (xixj + c0[3]) + b10[1]; - g[2] = xixj + c0[0]; - g[3] = xixj + c0[3]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[7] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[2] = xixj + c0x[0]; + g[3] = xixj + c0x[1]; g[12] = 1; g[13] = 1; - g[16] = c0[1]; - g[17] = c0[4]; - g[18] = c0[1] * (yiyj + c0[1]) + b10[0]; - g[19] = c0[4] * (yiyj + c0[4]) + b10[1]; - g[14] = yiyj + c0[1]; - g[15] = yiyj + c0[4]; + g[16] = c0y[0]; + g[17] = c0y[1]; + g[18] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[19] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[14] = yiyj + c0y[0]; + g[15] = yiyj + c0y[1]; //g[24] = w[0]; //g[25] = w[1]; - g[28] = c0[2] * g[24]; - g[29] = c0[5] * g[25]; - g[30] = g[28] * (zizj + c0[2]) + b10[0] * g[24]; - g[31] = g[29] * (zizj + c0[5]) + b10[1] * g[25]; - g[26] = g[24] * (zizj + c0[2]); - g[27] = g[25] * (zizj + c0[5]); + g[28] = c0z[0] * g[24]; + g[29] = c0z[1] * g[25]; + g[30] = g[28] * (zizj + c0z[0]) + b10[0] * g[24]; + g[31] = g[29] * (zizj + c0z[1]) + b10[1] * g[25]; + g[26] = g[24] * (zizj + c0z[0]); + g[27] = g[25] * (zizj + c0z[1]); } -static inline void _g0_2d4d_1101(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_1101(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; double xixj = envs->rirj[0]; @@ -1556,58 +1658,62 @@ static inline void _g0_2d4d_1101(double *restrict g, struct _BC *bc, CINTEnvVars double zizj = envs->rirj[2]; g[0] = 1; g[1] = 1; - g[8] = c0[0]; - g[9] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[12] = cp[0] * c0[0] + b00[0]; - g[13] = cp[3] * c0[3] + b00[1]; - g[10] = c0[0] * (xixj + c0[0]) + b10[0]; - g[11] = c0[3] * (xixj + c0[3]) + b10[1]; - g[2] = xixj + c0[0]; - g[3] = xixj + c0[3]; - g[14] = g[12] * (xixj + c0[0]) + c0[0] * b00[0] + b10[0] * cp[0]; - g[15] = g[13] * (xixj + c0[3]) + c0[3] * b00[1] + b10[1] * cp[3]; - g[6] = cp[0] * (xixj + c0[0]) + b00[0]; - g[7] = cp[3] * (xixj + c0[3]) + b00[1]; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[10] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[11] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[2] = xixj + c0x[0]; + g[3] = xixj + c0x[1]; + g[14] = g[12] * (xixj + c0x[0]) + c0x[0] * b00[0] + b10[0] * cpx[0]; + g[15] = g[13] * (xixj + c0x[1]) + c0x[1] * b00[1] + b10[1] * cpx[1]; + g[6] = cpx[0] * (xixj + c0x[0]) + b00[0]; + g[7] = cpx[1] * (xixj + c0x[1]) + b00[1]; g[24] = 1; g[25] = 1; - g[32] = c0[1]; - g[33] = c0[4]; - g[28] = cp[1]; - g[29] = cp[4]; - g[36] = cp[1] * c0[1] + b00[0]; - g[37] = cp[4] * c0[4] + b00[1]; - g[34] = c0[1] * (yiyj + c0[1]) + b10[0]; - g[35] = c0[4] * (yiyj + c0[4]) + b10[1]; - g[26] = yiyj + c0[1]; - g[27] = yiyj + c0[4]; - g[38] = g[36] * (yiyj + c0[1]) + c0[1] * b00[0] + b10[0] * cp[1]; - g[39] = g[37] * (yiyj + c0[4]) + c0[4] * b00[1] + b10[1] * cp[4]; - g[30] = cp[1] * (yiyj + c0[1]) + b00[0]; - g[31] = cp[4] * (yiyj + c0[4]) + b00[1]; + g[32] = c0y[0]; + g[33] = c0y[1]; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[34] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[35] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[26] = yiyj + c0y[0]; + g[27] = yiyj + c0y[1]; + g[38] = g[36] * (yiyj + c0y[0]) + c0y[0] * b00[0] + b10[0] * cpy[0]; + g[39] = g[37] * (yiyj + c0y[1]) + c0y[1] * b00[1] + b10[1] * cpy[1]; + g[30] = cpy[0] * (yiyj + c0y[0]) + b00[0]; + g[31] = cpy[1] * (yiyj + c0y[1]) + b00[1]; //g[48] = w[0]; //g[49] = w[1]; - g[56] = c0[2] * g[48]; - g[57] = c0[5] * g[49]; - g[52] = cp[2] * g[48]; - g[53] = cp[5] * g[49]; - g[60] = cp[2] * g[56] + b00[0] * g[48]; - g[61] = cp[5] * g[57] + b00[1] * g[49]; - g[58] = g[56] * (zizj + c0[2]) + b10[0] * g[48]; - g[59] = g[57] * (zizj + c0[5]) + b10[1] * g[49]; - g[50] = g[48] * (zizj + c0[2]); - g[51] = g[49] * (zizj + c0[5]); - g[62] = g[60] * (zizj + c0[2]) + b10[0] * g[52] + b00[0] * g[56]; - g[63] = g[61] * (zizj + c0[5]) + b10[1] * g[53] + b00[1] * g[57]; - g[54] = zizj * g[52] + cp[2] * g[56] + b00[0] * g[48]; - g[55] = zizj * g[53] + cp[5] * g[57] + b00[1] * g[49]; -} - -static inline void _g0_2d4d_1110(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[56] = c0z[0] * g[48]; + g[57] = c0z[1] * g[49]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[60] = cpz[0] * g[56] + b00[0] * g[48]; + g[61] = cpz[1] * g[57] + b00[1] * g[49]; + g[58] = g[56] * (zizj + c0z[0]) + b10[0] * g[48]; + g[59] = g[57] * (zizj + c0z[1]) + b10[1] * g[49]; + g[50] = g[48] * (zizj + c0z[0]); + g[51] = g[49] * (zizj + c0z[1]); + g[62] = g[60] * (zizj + c0z[0]) + b10[0] * g[52] + b00[0] * g[56]; + g[63] = g[61] * (zizj + c0z[1]) + b10[1] * g[53] + b00[1] * g[57]; + g[54] = zizj * g[52] + cpz[0] * g[56] + b00[0] * g[48]; + g[55] = zizj * g[53] + cpz[1] * g[57] + b00[1] * g[49]; +} + +static inline void _g0_2d4d_1110(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; double xixj = envs->rirj[0]; @@ -1615,287 +1721,303 @@ static inline void _g0_2d4d_1110(double *restrict g, struct _BC *bc, CINTEnvVars double zizj = envs->rirj[2]; g[0] = 1; g[1] = 1; - g[8] = c0[0]; - g[9] = c0[3]; - g[4] = cp[0]; - g[5] = cp[3]; - g[12] = cp[0] * c0[0] + b00[0]; - g[13] = cp[3] * c0[3] + b00[1]; - g[10] = c0[0] * (xixj + c0[0]) + b10[0]; - g[11] = c0[3] * (xixj + c0[3]) + b10[1]; - g[2] = xixj + c0[0]; - g[3] = xixj + c0[3]; - g[14] = g[12] * (xixj + c0[0]) + c0[0] * b00[0] + b10[0] * cp[0]; - g[15] = g[13] * (xixj + c0[3]) + c0[3] * b00[1] + b10[1] * cp[3]; - g[6] = cp[0] * (xixj + c0[0]) + b00[0]; - g[7] = cp[3] * (xixj + c0[3]) + b00[1]; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[10] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[11] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[2] = xixj + c0x[0]; + g[3] = xixj + c0x[1]; + g[14] = g[12] * (xixj + c0x[0]) + c0x[0] * b00[0] + b10[0] * cpx[0]; + g[15] = g[13] * (xixj + c0x[1]) + c0x[1] * b00[1] + b10[1] * cpx[1]; + g[6] = cpx[0] * (xixj + c0x[0]) + b00[0]; + g[7] = cpx[1] * (xixj + c0x[1]) + b00[1]; g[24] = 1; g[25] = 1; - g[32] = c0[1]; - g[33] = c0[4]; - g[28] = cp[1]; - g[29] = cp[4]; - g[36] = cp[1] * c0[1] + b00[0]; - g[37] = cp[4] * c0[4] + b00[1]; - g[34] = c0[1] * (yiyj + c0[1]) + b10[0]; - g[35] = c0[4] * (yiyj + c0[4]) + b10[1]; - g[26] = yiyj + c0[1]; - g[27] = yiyj + c0[4]; - g[38] = g[36] * (yiyj + c0[1]) + c0[1] * b00[0] + b10[0] * cp[1]; - g[39] = g[37] * (yiyj + c0[4]) + c0[4] * b00[1] + b10[1] * cp[4]; - g[30] = cp[1] * (yiyj + c0[1]) + b00[0]; - g[31] = cp[4] * (yiyj + c0[4]) + b00[1]; + g[32] = c0y[0]; + g[33] = c0y[1]; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[34] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[35] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[26] = yiyj + c0y[0]; + g[27] = yiyj + c0y[1]; + g[38] = g[36] * (yiyj + c0y[0]) + c0y[0] * b00[0] + b10[0] * cpy[0]; + g[39] = g[37] * (yiyj + c0y[1]) + c0y[1] * b00[1] + b10[1] * cpy[1]; + g[30] = cpy[0] * (yiyj + c0y[0]) + b00[0]; + g[31] = cpy[1] * (yiyj + c0y[1]) + b00[1]; //g[48] = w[0]; //g[49] = w[1]; - g[56] = c0[2] * g[48]; - g[57] = c0[5] * g[49]; - g[52] = cp[2] * g[48]; - g[53] = cp[5] * g[49]; - g[60] = cp[2] * g[56] + b00[0] * g[48]; - g[61] = cp[5] * g[57] + b00[1] * g[49]; - g[58] = g[56] * (zizj + c0[2]) + b10[0] * g[48]; - g[59] = g[57] * (zizj + c0[5]) + b10[1] * g[49]; - g[50] = g[48] * (zizj + c0[2]); - g[51] = g[49] * (zizj + c0[5]); - g[62] = g[60] * (zizj + c0[2]) + b10[0] * g[52] + b00[0] * g[56]; - g[63] = g[61] * (zizj + c0[5]) + b10[1] * g[53] + b00[1] * g[57]; - g[54] = zizj * g[52] + cp[2] * g[56] + b00[0] * g[48]; - g[55] = zizj * g[53] + cp[5] * g[57] + b00[1] * g[49]; -} - -static inline void _g0_2d4d_1200(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; + g[56] = c0z[0] * g[48]; + g[57] = c0z[1] * g[49]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[60] = cpz[0] * g[56] + b00[0] * g[48]; + g[61] = cpz[1] * g[57] + b00[1] * g[49]; + g[58] = g[56] * (zizj + c0z[0]) + b10[0] * g[48]; + g[59] = g[57] * (zizj + c0z[1]) + b10[1] * g[49]; + g[50] = g[48] * (zizj + c0z[0]); + g[51] = g[49] * (zizj + c0z[1]); + g[62] = g[60] * (zizj + c0z[0]) + b10[0] * g[52] + b00[0] * g[56]; + g[63] = g[61] * (zizj + c0z[1]) + b10[1] * g[53] + b00[1] * g[57]; + g[54] = zizj * g[52] + cpz[0] * g[56] + b00[0] * g[48]; + g[55] = zizj * g[53] + cpz[1] * g[57] + b00[1] * g[49]; +} + +static inline void _g0_2d4d_1200(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; double xixj = envs->rirj[0]; double yiyj = envs->rirj[1]; double zizj = envs->rirj[2]; g[0] = 1; g[1] = 1; - g[4] = c0[0]; - g[5] = c0[3]; - g[8] = c0[0] * c0[0] + b10[0]; - g[9] = c0[3] * c0[3] + b10[1]; - g[10] = g[8] * (xixj + c0[0]) + c0[0] * 2 * b10[0]; - g[11] = g[9] * (xixj + c0[3]) + c0[3] * 2 * b10[1]; - g[6] = c0[0] * (xixj + c0[0]) + b10[0]; - g[7] = c0[3] * (xixj + c0[3]) + b10[1]; - g[2] = xixj + c0[0]; - g[3] = xixj + c0[3]; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = g[8] * (xixj + c0x[0]) + c0x[0] * 2 * b10[0]; + g[11] = g[9] * (xixj + c0x[1]) + c0x[1] * 2 * b10[1]; + g[6] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[7] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[2] = xixj + c0x[0]; + g[3] = xixj + c0x[1]; g[16] = 1; g[17] = 1; - g[20] = c0[1]; - g[21] = c0[4]; - g[24] = c0[1] * c0[1] + b10[0]; - g[25] = c0[4] * c0[4] + b10[1]; - g[26] = g[24] * (yiyj + c0[1]) + c0[1] * 2 * b10[0]; - g[27] = g[25] * (yiyj + c0[4]) + c0[4] * 2 * b10[1]; - g[22] = c0[1] * (yiyj + c0[1]) + b10[0]; - g[23] = c0[4] * (yiyj + c0[4]) + b10[1]; - g[18] = yiyj + c0[1]; - g[19] = yiyj + c0[4]; + g[20] = c0y[0]; + g[21] = c0y[1]; + g[24] = c0y[0] * c0y[0] + b10[0]; + g[25] = c0y[1] * c0y[1] + b10[1]; + g[26] = g[24] * (yiyj + c0y[0]) + c0y[0] * 2 * b10[0]; + g[27] = g[25] * (yiyj + c0y[1]) + c0y[1] * 2 * b10[1]; + g[22] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[23] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[18] = yiyj + c0y[0]; + g[19] = yiyj + c0y[1]; //g[32] = w[0]; //g[33] = w[1]; - g[36] = c0[2] * g[32]; - g[37] = c0[5] * g[33]; - g[40] = c0[2] * g[36] + b10[0] * g[32]; - g[41] = c0[5] * g[37] + b10[1] * g[33]; - g[42] = g[40] * (zizj + c0[2]) + 2 * b10[0] * g[36]; - g[43] = g[41] * (zizj + c0[5]) + 2 * b10[1] * g[37]; - g[38] = g[36] * (zizj + c0[2]) + b10[0] * g[32]; - g[39] = g[37] * (zizj + c0[5]) + b10[1] * g[33]; - g[34] = g[32] * (zizj + c0[2]); - g[35] = g[33] * (zizj + c0[5]); + g[36] = c0z[0] * g[32]; + g[37] = c0z[1] * g[33]; + g[40] = c0z[0] * g[36] + b10[0] * g[32]; + g[41] = c0z[1] * g[37] + b10[1] * g[33]; + g[42] = g[40] * (zizj + c0z[0]) + 2 * b10[0] * g[36]; + g[43] = g[41] * (zizj + c0z[1]) + 2 * b10[1] * g[37]; + g[38] = g[36] * (zizj + c0z[0]) + b10[0] * g[32]; + g[39] = g[37] * (zizj + c0z[1]) + b10[1] * g[33]; + g[34] = g[32] * (zizj + c0z[0]); + g[35] = g[33] * (zizj + c0z[1]); } -static inline void _g0_2d4d_2000(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_2000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; g[6] = 1; g[7] = 1; - g[8] = c0[1]; - g[9] = c0[4]; - g[10] = c0[1] * c0[1] + b10[0]; - g[11] = c0[4] * c0[4] + b10[1]; + g[8] = c0y[0]; + g[9] = c0y[1]; + g[10] = c0y[0] * c0y[0] + b10[0]; + g[11] = c0y[1] * c0y[1] + b10[1]; //g[12] = w[0]; //g[13] = w[1]; - g[14] = c0[2] * g[12]; - g[15] = c0[5] * g[13]; - g[16] = c0[2] * g[14] + b10[0] * g[12]; - g[17] = c0[5] * g[15] + b10[1] * g[13]; + g[14] = c0z[0] * g[12]; + g[15] = c0z[1] * g[13]; + g[16] = c0z[0] * g[14] + b10[0] * g[12]; + g[17] = c0z[1] * g[15] + b10[1] * g[13]; } -static inline void _g0_2d4d_2001(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_2001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; - double *cp = bc->c0p; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; - g[6] = cp[0]; - g[7] = cp[3]; - g[8] = cp[0] * c0[0] + b00[0]; - g[9] = cp[3] * c0[3] + b00[1]; - g[10] = c0[0] * (g[8] + b00[0]) + b10[0] * cp[0]; - g[11] = c0[3] * (g[9] + b00[1]) + b10[1] * cp[3]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; + g[6] = cpx[0]; + g[7] = cpx[1]; + g[8] = cpx[0] * c0x[0] + b00[0]; + g[9] = cpx[1] * c0x[1] + b00[1]; + g[10] = c0x[0] * (g[8] + b00[0]) + b10[0] * cpx[0]; + g[11] = c0x[1] * (g[9] + b00[1]) + b10[1] * cpx[1]; g[12] = 1; g[13] = 1; - g[14] = c0[1]; - g[15] = c0[4]; - g[16] = c0[1] * c0[1] + b10[0]; - g[17] = c0[4] * c0[4] + b10[1]; - g[18] = cp[1]; - g[19] = cp[4]; - g[20] = cp[1] * c0[1] + b00[0]; - g[21] = cp[4] * c0[4] + b00[1]; - g[22] = c0[1] * (g[20] + b00[0]) + b10[0] * cp[1]; - g[23] = c0[4] * (g[21] + b00[1]) + b10[1] * cp[4]; + g[14] = c0y[0]; + g[15] = c0y[1]; + g[16] = c0y[0] * c0y[0] + b10[0]; + g[17] = c0y[1] * c0y[1] + b10[1]; + g[18] = cpy[0]; + g[19] = cpy[1]; + g[20] = cpy[0] * c0y[0] + b00[0]; + g[21] = cpy[1] * c0y[1] + b00[1]; + g[22] = c0y[0] * (g[20] + b00[0]) + b10[0] * cpy[0]; + g[23] = c0y[1] * (g[21] + b00[1]) + b10[1] * cpy[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = c0[2] * g[24]; - g[27] = c0[5] * g[25]; - g[28] = c0[2] * g[26] + b10[0] * g[24]; - g[29] = c0[5] * g[27] + b10[1] * g[25]; - g[30] = cp[2] * g[24]; - g[31] = cp[5] * g[25]; - g[32] = cp[2] * g[26] + b00[0] * g[24]; - g[33] = cp[5] * g[27] + b00[1] * g[25]; - g[34] = c0[2] * g[32] + b10[0] * g[30] + b00[0] * g[26]; - g[35] = c0[5] * g[33] + b10[1] * g[31] + b00[1] * g[27]; -} - -static inline void _g0_2d4d_2010(double *restrict g, struct _BC *bc, CINTEnvVars *envs) -{ - double *c0 = bc->c00; - double *cp = bc->c0p; + g[26] = c0z[0] * g[24]; + g[27] = c0z[1] * g[25]; + g[28] = c0z[0] * g[26] + b10[0] * g[24]; + g[29] = c0z[1] * g[27] + b10[1] * g[25]; + g[30] = cpz[0] * g[24]; + g[31] = cpz[1] * g[25]; + g[32] = cpz[0] * g[26] + b00[0] * g[24]; + g[33] = cpz[1] * g[27] + b00[1] * g[25]; + g[34] = c0z[0] * g[32] + b10[0] * g[30] + b00[0] * g[26]; + g[35] = c0z[1] * g[33] + b10[1] * g[31] + b00[1] * g[27]; +} + +static inline void _g0_2d4d_2010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; double *b00 = bc->b00; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; - g[6] = cp[0]; - g[7] = cp[3]; - g[8] = cp[0] * c0[0] + b00[0]; - g[9] = cp[3] * c0[3] + b00[1]; - g[10] = c0[0] * (g[8] + b00[0]) + b10[0] * cp[0]; - g[11] = c0[3] * (g[9] + b00[1]) + b10[1] * cp[3]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; + g[6] = cpx[0]; + g[7] = cpx[1]; + g[8] = cpx[0] * c0x[0] + b00[0]; + g[9] = cpx[1] * c0x[1] + b00[1]; + g[10] = c0x[0] * (g[8] + b00[0]) + b10[0] * cpx[0]; + g[11] = c0x[1] * (g[9] + b00[1]) + b10[1] * cpx[1]; g[12] = 1; g[13] = 1; - g[14] = c0[1]; - g[15] = c0[4]; - g[16] = c0[1] * c0[1] + b10[0]; - g[17] = c0[4] * c0[4] + b10[1]; - g[18] = cp[1]; - g[19] = cp[4]; - g[20] = cp[1] * c0[1] + b00[0]; - g[21] = cp[4] * c0[4] + b00[1]; - g[22] = c0[1] * (g[20] + b00[0]) + b10[0] * cp[1]; - g[23] = c0[4] * (g[21] + b00[1]) + b10[1] * cp[4]; + g[14] = c0y[0]; + g[15] = c0y[1]; + g[16] = c0y[0] * c0y[0] + b10[0]; + g[17] = c0y[1] * c0y[1] + b10[1]; + g[18] = cpy[0]; + g[19] = cpy[1]; + g[20] = cpy[0] * c0y[0] + b00[0]; + g[21] = cpy[1] * c0y[1] + b00[1]; + g[22] = c0y[0] * (g[20] + b00[0]) + b10[0] * cpy[0]; + g[23] = c0y[1] * (g[21] + b00[1]) + b10[1] * cpy[1]; //g[24] = w[0]; //g[25] = w[1]; - g[26] = c0[2] * g[24]; - g[27] = c0[5] * g[25]; - g[28] = c0[2] * g[26] + b10[0] * g[24]; - g[29] = c0[5] * g[27] + b10[1] * g[25]; - g[30] = cp[2] * g[24]; - g[31] = cp[5] * g[25]; - g[32] = cp[2] * g[26] + b00[0] * g[24]; - g[33] = cp[5] * g[27] + b00[1] * g[25]; - g[34] = c0[2] * g[32] + b10[0] * g[30] + b00[0] * g[26]; - g[35] = c0[5] * g[33] + b10[1] * g[31] + b00[1] * g[27]; + g[26] = c0z[0] * g[24]; + g[27] = c0z[1] * g[25]; + g[28] = c0z[0] * g[26] + b10[0] * g[24]; + g[29] = c0z[1] * g[27] + b10[1] * g[25]; + g[30] = cpz[0] * g[24]; + g[31] = cpz[1] * g[25]; + g[32] = cpz[0] * g[26] + b00[0] * g[24]; + g[33] = cpz[1] * g[27] + b00[1] * g[25]; + g[34] = c0z[0] * g[32] + b10[0] * g[30] + b00[0] * g[26]; + g[35] = c0z[1] * g[33] + b10[1] * g[31] + b00[1] * g[27]; } -static inline void _g0_2d4d_2100(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_2100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; double xixj = envs->rirj[0]; double yiyj = envs->rirj[1]; double zizj = envs->rirj[2]; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; - g[12] = g[4] * (xixj + c0[0]) + c0[0] * 2 * b10[0]; - g[13] = g[5] * (xixj + c0[3]) + c0[3] * 2 * b10[1]; - g[10] = c0[0] * (xixj + c0[0]) + b10[0]; - g[11] = c0[3] * (xixj + c0[3]) + b10[1]; - g[8] = xixj + c0[0]; - g[9] = xixj + c0[3]; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; + g[12] = g[4] * (xixj + c0x[0]) + c0x[0] * 2 * b10[0]; + g[13] = g[5] * (xixj + c0x[1]) + c0x[1] * 2 * b10[1]; + g[10] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[11] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[8] = xixj + c0x[0]; + g[9] = xixj + c0x[1]; g[16] = 1; g[17] = 1; - g[18] = c0[1]; - g[19] = c0[4]; - g[20] = c0[1] * c0[1] + b10[0]; - g[21] = c0[4] * c0[4] + b10[1]; - g[28] = g[20] * (yiyj + c0[1]) + c0[1] * 2 * b10[0]; - g[29] = g[21] * (yiyj + c0[4]) + c0[4] * 2 * b10[1]; - g[26] = c0[1] * (yiyj + c0[1]) + b10[0]; - g[27] = c0[4] * (yiyj + c0[4]) + b10[1]; - g[24] = yiyj + c0[1]; - g[25] = yiyj + c0[4]; + g[18] = c0y[0]; + g[19] = c0y[1]; + g[20] = c0y[0] * c0y[0] + b10[0]; + g[21] = c0y[1] * c0y[1] + b10[1]; + g[28] = g[20] * (yiyj + c0y[0]) + c0y[0] * 2 * b10[0]; + g[29] = g[21] * (yiyj + c0y[1]) + c0y[1] * 2 * b10[1]; + g[26] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[27] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[24] = yiyj + c0y[0]; + g[25] = yiyj + c0y[1]; //g[32] = w[0]; //g[33] = w[1]; - g[34] = c0[2] * g[32]; - g[35] = c0[5] * g[33]; - g[36] = c0[2] * g[34] + b10[0] * g[32]; - g[37] = c0[5] * g[35] + b10[1] * g[33]; - g[44] = g[36] * (zizj + c0[2]) + 2 * b10[0] * g[34]; - g[45] = g[37] * (zizj + c0[5]) + 2 * b10[1] * g[35]; - g[42] = g[34] * (zizj + c0[2]) + b10[0] * g[32]; - g[43] = g[35] * (zizj + c0[5]) + b10[1] * g[33]; - g[40] = g[32] * (zizj + c0[2]); - g[41] = g[33] * (zizj + c0[5]); + g[34] = c0z[0] * g[32]; + g[35] = c0z[1] * g[33]; + g[36] = c0z[0] * g[34] + b10[0] * g[32]; + g[37] = c0z[1] * g[35] + b10[1] * g[33]; + g[44] = g[36] * (zizj + c0z[0]) + 2 * b10[0] * g[34]; + g[45] = g[37] * (zizj + c0z[1]) + 2 * b10[1] * g[35]; + g[42] = g[34] * (zizj + c0z[0]) + b10[0] * g[32]; + g[43] = g[35] * (zizj + c0z[1]) + b10[1] * g[33]; + g[40] = g[32] * (zizj + c0z[0]); + g[41] = g[33] * (zizj + c0z[1]); } -static inline void _g0_2d4d_3000(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _g0_2d4d_3000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { - double *c0 = bc->c00; + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; double *b10 = bc->b10; g[0] = 1; g[1] = 1; - g[2] = c0[0]; - g[3] = c0[3]; - g[4] = c0[0] * c0[0] + b10[0]; - g[5] = c0[3] * c0[3] + b10[1]; - g[6] = c0[0] * (g[4] + 2 * b10[0]); - g[7] = c0[3] * (g[5] + 2 * b10[1]); + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = c0x[0] * c0x[0] + b10[0]; + g[5] = c0x[1] * c0x[1] + b10[1]; + g[6] = c0x[0] * (g[4] + 2 * b10[0]); + g[7] = c0x[1] * (g[5] + 2 * b10[1]); g[8] = 1; g[9] = 1; - g[10] = c0[1]; - g[11] = c0[4]; - g[12] = c0[1] * c0[1] + b10[0]; - g[13] = c0[4] * c0[4] + b10[1]; - g[14] = c0[1] * (g[12] + 2 * b10[0]); - g[15] = c0[4] * (g[13] + 2 * b10[1]); + g[10] = c0y[0]; + g[11] = c0y[1]; + g[12] = c0y[0] * c0y[0] + b10[0]; + g[13] = c0y[1] * c0y[1] + b10[1]; + g[14] = c0y[0] * (g[12] + 2 * b10[0]); + g[15] = c0y[1] * (g[13] + 2 * b10[1]); //g[16] = w[0]; //g[17] = w[1]; - g[18] = c0[2] * g[16]; - g[19] = c0[5] * g[17]; - g[20] = c0[2] * g[18] + b10[0] * g[16]; - g[21] = c0[5] * g[19] + b10[1] * g[17]; - g[22] = c0[2] * g[20] + 2 * b10[0] * g[18]; - g[23] = c0[5] * g[21] + 2 * b10[1] * g[19]; + g[18] = c0z[0] * g[16]; + g[19] = c0z[1] * g[17]; + g[20] = c0z[0] * g[18] + b10[0] * g[16]; + g[21] = c0z[1] * g[19] + b10[1] * g[17]; + g[22] = c0z[0] * g[20] + 2 * b10[0] * g[18]; + g[23] = c0z[1] * g[21] + 2 * b10[1] * g[19]; } -void CINTg0_2e_2d4d_unrolled(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_2d4d_unrolled(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { int type_ijkl = ((envs->li_ceil << 6) | (envs->lj_ceil << 4) | (envs->lk_ceil << 2) | (envs->ll_ceil)); @@ -1941,23 +2063,2357 @@ void CINTg0_2e_2d4d_unrolled(double *restrict g, struct _BC *bc, CINTEnvVars *en (int)envs->ll_ceil, (int)envs->lj_ceil); } -void CINTg0_2e_lj2d4d(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +static inline void _srg0_2d4d_0000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + //g[4] = w[0]; + //g[5] = w[0]; +} + +static inline void _srg0_2d4d_0001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + g[0] = 1; + g[1] = 1; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = 1; + g[5] = 1; + g[6] = cpy[0]; + g[7] = cpy[1]; + //g[8] = w[0]; + //g[9] = w[0]; + g[10] = cpz[0] * g[8]; + g[11] = cpz[1] * g[9]; +} + +static inline void _srg0_2d4d_0002(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[12] = 1; + g[13] = 1; + g[14] = 1; + g[15] = 1; + g[16] = cpy[0]; + g[17] = cpy[1]; + g[18] = cpy[2]; + g[19] = cpy[3]; + g[20] = cpy[0] * cpy[0] + b01[0]; + g[21] = cpy[1] * cpy[1] + b01[1]; + g[22] = cpy[2] * cpy[2] + b01[2]; + g[23] = cpy[3] * cpy[3] + b01[3]; + //g[24] = w[0]; + //g[25] = w[0]; + //g[26] = w[1]; + //g[27] = w[1]; + g[28] = cpz[0] * g[24]; + g[29] = cpz[1] * g[25]; + g[30] = cpz[2] * g[26]; + g[31] = cpz[3] * g[27]; + g[32] = cpz[0] * g[28] + b01[0] * g[24]; + g[33] = cpz[1] * g[29] + b01[1] * g[25]; + g[34] = cpz[2] * g[30] + b01[2] * g[26]; + g[35] = cpz[3] * g[31] + b01[3] * g[27]; +} + +static inline void _srg0_2d4d_0003(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[12] = cpx[0] * (g[8] + 2 * b01[0]); + g[13] = cpx[1] * (g[9] + 2 * b01[1]); + g[14] = cpx[2] * (g[10] + 2 * b01[2]); + g[15] = cpx[3] * (g[11] + 2 * b01[3]); + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = cpy[0]; + g[21] = cpy[1]; + g[22] = cpy[2]; + g[23] = cpy[3]; + g[24] = cpy[0] * cpy[0] + b01[0]; + g[25] = cpy[1] * cpy[1] + b01[1]; + g[26] = cpy[2] * cpy[2] + b01[2]; + g[27] = cpy[3] * cpy[3] + b01[3]; + g[28] = cpy[0] * (g[24] + 2 * b01[0]); + g[29] = cpy[1] * (g[25] + 2 * b01[1]); + g[30] = cpy[2] * (g[26] + 2 * b01[2]); + g[31] = cpy[3] * (g[27] + 2 * b01[3]); + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = cpz[0] * g[32]; + g[37] = cpz[1] * g[33]; + g[38] = cpz[2] * g[34]; + g[39] = cpz[3] * g[35]; + g[40] = cpz[0] * g[36] + b01[0] * g[32]; + g[41] = cpz[1] * g[37] + b01[1] * g[33]; + g[42] = cpz[2] * g[38] + b01[2] * g[34]; + g[43] = cpz[3] * g[39] + b01[3] * g[35]; + g[44] = cpz[0] * g[40] + 2 * b01[0] * g[36]; + g[45] = cpz[1] * g[41] + 2 * b01[1] * g[37]; + g[46] = cpz[2] * g[42] + 2 * b01[2] * g[38]; + g[47] = cpz[3] * g[43] + 2 * b01[3] * g[39]; +} + +static inline void _srg0_2d4d_0010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + g[0] = 1; + g[1] = 1; + g[2] = cpx[0]; + g[3] = cpx[1]; + g[4] = 1; + g[5] = 1; + g[6] = cpy[0]; + g[7] = cpy[1]; + //g[8] = w[0]; + //g[9] = w[0]; + g[10] = cpz[0] * g[8]; + g[11] = cpz[1] * g[9]; +} + +static inline void _srg0_2d4d_0011(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + double xkxl = envs->rkrl[0]; + double ykyl = envs->rkrl[1]; + double zkzl = envs->rkrl[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[12] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[13] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[14] = cpx[2] * (xkxl + cpx[2]) + b01[2]; + g[15] = cpx[3] * (xkxl + cpx[3]) + b01[3]; + g[4] = xkxl + cpx[0]; + g[5] = xkxl + cpx[1]; + g[6] = xkxl + cpx[2]; + g[7] = xkxl + cpx[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[32] = cpy[0]; + g[33] = cpy[1]; + g[34] = cpy[2]; + g[35] = cpy[3]; + g[36] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[37] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[38] = cpy[2] * (ykyl + cpy[2]) + b01[2]; + g[39] = cpy[3] * (ykyl + cpy[3]) + b01[3]; + g[28] = ykyl + cpy[0]; + g[29] = ykyl + cpy[1]; + g[30] = ykyl + cpy[2]; + g[31] = ykyl + cpy[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[56] = cpz[0] * g[48]; + g[57] = cpz[1] * g[49]; + g[58] = cpz[2] * g[50]; + g[59] = cpz[3] * g[51]; + g[60] = g[56] * (zkzl + cpz[0]) + b01[0] * g[48]; + g[61] = g[57] * (zkzl + cpz[1]) + b01[1] * g[49]; + g[62] = g[58] * (zkzl + cpz[2]) + b01[2] * g[50]; + g[63] = g[59] * (zkzl + cpz[3]) + b01[3] * g[51]; + g[52] = g[48] * (zkzl + cpz[0]); + g[53] = g[49] * (zkzl + cpz[1]); + g[54] = g[50] * (zkzl + cpz[2]); + g[55] = g[51] * (zkzl + cpz[3]); +} + +static inline void _srg0_2d4d_0012(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + double xkxl = envs->rkrl[0]; + double ykyl = envs->rkrl[1]; + double zkzl = envs->rkrl[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[16] = cpx[0] * cpx[0] + b01[0]; + g[17] = cpx[1] * cpx[1] + b01[1]; + g[18] = cpx[2] * cpx[2] + b01[2]; + g[19] = cpx[3] * cpx[3] + b01[3]; + g[20] = g[16] * (xkxl + cpx[0]) + cpx[0] * 2 * b01[0]; + g[21] = g[17] * (xkxl + cpx[1]) + cpx[1] * 2 * b01[1]; + g[22] = g[18] * (xkxl + cpx[2]) + cpx[2] * 2 * b01[2]; + g[23] = g[19] * (xkxl + cpx[3]) + cpx[3] * 2 * b01[3]; + g[12] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[13] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[14] = cpx[2] * (xkxl + cpx[2]) + b01[2]; + g[15] = cpx[3] * (xkxl + cpx[3]) + b01[3]; + g[4] = xkxl + cpx[0]; + g[5] = xkxl + cpx[1]; + g[6] = xkxl + cpx[2]; + g[7] = xkxl + cpx[3]; + g[32] = 1; + g[33] = 1; + g[34] = 1; + g[35] = 1; + g[40] = cpy[0]; + g[41] = cpy[1]; + g[42] = cpy[2]; + g[43] = cpy[3]; + g[48] = cpy[0] * cpy[0] + b01[0]; + g[49] = cpy[1] * cpy[1] + b01[1]; + g[50] = cpy[2] * cpy[2] + b01[2]; + g[51] = cpy[3] * cpy[3] + b01[3]; + g[52] = g[48] * (ykyl + cpy[0]) + cpy[0] * 2 * b01[0]; + g[53] = g[49] * (ykyl + cpy[1]) + cpy[1] * 2 * b01[1]; + g[54] = g[50] * (ykyl + cpy[2]) + cpy[2] * 2 * b01[2]; + g[55] = g[51] * (ykyl + cpy[3]) + cpy[3] * 2 * b01[3]; + g[44] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[45] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[46] = cpy[2] * (ykyl + cpy[2]) + b01[2]; + g[47] = cpy[3] * (ykyl + cpy[3]) + b01[3]; + g[36] = ykyl + cpy[0]; + g[37] = ykyl + cpy[1]; + g[38] = ykyl + cpy[2]; + g[39] = ykyl + cpy[3]; + //g[64] = w[0]; + //g[65] = w[0]; + //g[66] = w[1]; + //g[67] = w[1]; + g[72] = cpz[0] * g[64]; + g[73] = cpz[1] * g[65]; + g[74] = cpz[2] * g[66]; + g[75] = cpz[3] * g[67]; + g[80] = cpz[0] * g[72] + b01[0] * g[64]; + g[81] = cpz[1] * g[73] + b01[1] * g[65]; + g[82] = cpz[2] * g[74] + b01[2] * g[66]; + g[83] = cpz[3] * g[75] + b01[3] * g[67]; + g[84] = g[80] * (zkzl + cpz[0]) + 2 * b01[0] * g[72]; + g[85] = g[81] * (zkzl + cpz[1]) + 2 * b01[1] * g[73]; + g[86] = g[82] * (zkzl + cpz[2]) + 2 * b01[2] * g[74]; + g[87] = g[83] * (zkzl + cpz[3]) + 2 * b01[3] * g[75]; + g[76] = g[72] * (zkzl + cpz[0]) + b01[0] * g[64]; + g[77] = g[73] * (zkzl + cpz[1]) + b01[1] * g[65]; + g[78] = g[74] * (zkzl + cpz[2]) + b01[2] * g[66]; + g[79] = g[75] * (zkzl + cpz[3]) + b01[3] * g[67]; + g[68] = g[64] * (zkzl + cpz[0]); + g[69] = g[65] * (zkzl + cpz[1]); + g[70] = g[66] * (zkzl + cpz[2]); + g[71] = g[67] * (zkzl + cpz[3]); +} + +static inline void _srg0_2d4d_0020(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[12] = 1; + g[13] = 1; + g[14] = 1; + g[15] = 1; + g[16] = cpy[0]; + g[17] = cpy[1]; + g[18] = cpy[2]; + g[19] = cpy[3]; + g[20] = cpy[0] * cpy[0] + b01[0]; + g[21] = cpy[1] * cpy[1] + b01[1]; + g[22] = cpy[2] * cpy[2] + b01[2]; + g[23] = cpy[3] * cpy[3] + b01[3]; + //g[24] = w[0]; + //g[25] = w[0]; + //g[26] = w[1]; + //g[27] = w[1]; + g[28] = cpz[0] * g[24]; + g[29] = cpz[1] * g[25]; + g[30] = cpz[2] * g[26]; + g[31] = cpz[3] * g[27]; + g[32] = cpz[0] * g[28] + b01[0] * g[24]; + g[33] = cpz[1] * g[29] + b01[1] * g[25]; + g[34] = cpz[2] * g[30] + b01[2] * g[26]; + g[35] = cpz[3] * g[31] + b01[3] * g[27]; +} + +static inline void _srg0_2d4d_0021(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + double xkxl = envs->rkrl[0]; + double ykyl = envs->rkrl[1]; + double zkzl = envs->rkrl[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[16] = xkxl + cpx[0]; + g[17] = xkxl + cpx[1]; + g[18] = xkxl + cpx[2]; + g[19] = xkxl + cpx[3]; + g[20] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[21] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[22] = cpx[2] * (xkxl + cpx[2]) + b01[2]; + g[23] = cpx[3] * (xkxl + cpx[3]) + b01[3]; + g[24] = g[8] * (xkxl + cpx[0]) + cpx[0] * 2 * b01[0]; + g[25] = g[9] * (xkxl + cpx[1]) + cpx[1] * 2 * b01[1]; + g[26] = g[10] * (xkxl + cpx[2]) + cpx[2] * 2 * b01[2]; + g[27] = g[11] * (xkxl + cpx[3]) + cpx[3] * 2 * b01[3]; + g[32] = 1; + g[33] = 1; + g[34] = 1; + g[35] = 1; + g[36] = cpy[0]; + g[37] = cpy[1]; + g[38] = cpy[2]; + g[39] = cpy[3]; + g[40] = cpy[0] * cpy[0] + b01[0]; + g[41] = cpy[1] * cpy[1] + b01[1]; + g[42] = cpy[2] * cpy[2] + b01[2]; + g[43] = cpy[3] * cpy[3] + b01[3]; + g[48] = ykyl + cpy[0]; + g[49] = ykyl + cpy[1]; + g[50] = ykyl + cpy[2]; + g[51] = ykyl + cpy[3]; + g[52] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[53] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[54] = cpy[2] * (ykyl + cpy[2]) + b01[2]; + g[55] = cpy[3] * (ykyl + cpy[3]) + b01[3]; + g[56] = g[40] * (ykyl + cpy[0]) + cpy[0] * 2 * b01[0]; + g[57] = g[41] * (ykyl + cpy[1]) + cpy[1] * 2 * b01[1]; + g[58] = g[42] * (ykyl + cpy[2]) + cpy[2] * 2 * b01[2]; + g[59] = g[43] * (ykyl + cpy[3]) + cpy[3] * 2 * b01[3]; + //g[64] = w[0]; + //g[65] = w[0]; + //g[66] = w[1]; + //g[67] = w[1]; + g[68] = cpz[0] * g[64]; + g[69] = cpz[1] * g[65]; + g[70] = cpz[2] * g[66]; + g[71] = cpz[3] * g[67]; + g[72] = cpz[0] * g[68] + b01[0] * g[64]; + g[73] = cpz[1] * g[69] + b01[1] * g[65]; + g[74] = cpz[2] * g[70] + b01[2] * g[66]; + g[75] = cpz[3] * g[71] + b01[3] * g[67]; + g[80] = g[64] * (zkzl + cpz[0]); + g[81] = g[65] * (zkzl + cpz[1]); + g[82] = g[66] * (zkzl + cpz[2]); + g[83] = g[67] * (zkzl + cpz[3]); + g[84] = g[68] * (zkzl + cpz[0]) + b01[0] * g[64]; + g[85] = g[69] * (zkzl + cpz[1]) + b01[1] * g[65]; + g[86] = g[70] * (zkzl + cpz[2]) + b01[2] * g[66]; + g[87] = g[71] * (zkzl + cpz[3]) + b01[3] * g[67]; + g[88] = g[72] * (zkzl + cpz[0]) + 2 * b01[0] * g[68]; + g[89] = g[73] * (zkzl + cpz[1]) + 2 * b01[1] * g[69]; + g[90] = g[74] * (zkzl + cpz[2]) + 2 * b01[2] * g[70]; + g[91] = g[75] * (zkzl + cpz[3]) + 2 * b01[3] * g[71]; +} + +static inline void _srg0_2d4d_0030(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[12] = cpx[0] * (g[8] + 2 * b01[0]); + g[13] = cpx[1] * (g[9] + 2 * b01[1]); + g[14] = cpx[2] * (g[10] + 2 * b01[2]); + g[15] = cpx[3] * (g[11] + 2 * b01[3]); + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = cpy[0]; + g[21] = cpy[1]; + g[22] = cpy[2]; + g[23] = cpy[3]; + g[24] = cpy[0] * cpy[0] + b01[0]; + g[25] = cpy[1] * cpy[1] + b01[1]; + g[26] = cpy[2] * cpy[2] + b01[2]; + g[27] = cpy[3] * cpy[3] + b01[3]; + g[28] = cpy[0] * (g[24] + 2 * b01[0]); + g[29] = cpy[1] * (g[25] + 2 * b01[1]); + g[30] = cpy[2] * (g[26] + 2 * b01[2]); + g[31] = cpy[3] * (g[27] + 2 * b01[3]); + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = cpz[0] * g[32]; + g[37] = cpz[1] * g[33]; + g[38] = cpz[2] * g[34]; + g[39] = cpz[3] * g[35]; + g[40] = cpz[0] * g[36] + b01[0] * g[32]; + g[41] = cpz[1] * g[37] + b01[1] * g[33]; + g[42] = cpz[2] * g[38] + b01[2] * g[34]; + g[43] = cpz[3] * g[39] + b01[3] * g[35]; + g[44] = cpz[0] * g[40] + 2 * b01[0] * g[36]; + g[45] = cpz[1] * g[41] + 2 * b01[1] * g[37]; + g[46] = cpz[2] * g[42] + 2 * b01[2] * g[38]; + g[47] = cpz[3] * g[43] + 2 * b01[3] * g[39]; +} + +static inline void _srg0_2d4d_0100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + g[0] = 1; + g[1] = 1; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = 1; + g[5] = 1; + g[6] = c0y[0]; + g[7] = c0y[1]; + //g[8] = w[0]; + //g[9] = w[0]; + g[10] = c0z[0] * g[8]; + g[11] = c0z[1] * g[9]; +} + +static inline void _srg0_2d4d_0101(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = cpy[0]; + g[21] = cpy[1]; + g[22] = cpy[2]; + g[23] = cpy[3]; + g[24] = c0y[0]; + g[25] = c0y[1]; + g[26] = c0y[2]; + g[27] = c0y[3]; + g[28] = cpy[0] * c0y[0] + b00[0]; + g[29] = cpy[1] * c0y[1] + b00[1]; + g[30] = cpy[2] * c0y[2] + b00[2]; + g[31] = cpy[3] * c0y[3] + b00[3]; + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = cpz[0] * g[32]; + g[37] = cpz[1] * g[33]; + g[38] = cpz[2] * g[34]; + g[39] = cpz[3] * g[35]; + g[40] = c0z[0] * g[32]; + g[41] = c0z[1] * g[33]; + g[42] = c0z[2] * g[34]; + g[43] = c0z[3] * g[35]; + g[44] = cpz[0] * g[40] + b00[0] * g[32]; + g[45] = cpz[1] * g[41] + b00[1] * g[33]; + g[46] = cpz[2] * g[42] + b00[2] * g[34]; + g[47] = cpz[3] * g[43] + b00[3] * g[35]; +} + +static inline void _srg0_2d4d_0102(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[12] = c0x[0]; + g[13] = c0x[1]; + g[14] = c0x[2]; + g[15] = c0x[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[16] = cpx[0] * c0x[0] + b00[0]; + g[17] = cpx[1] * c0x[1] + b00[1]; + g[18] = cpx[2] * c0x[2] + b00[2]; + g[19] = cpx[3] * c0x[3] + b00[3]; + g[20] = cpx[0] * (g[16] + b00[0]) + b01[0] * c0x[0]; + g[21] = cpx[1] * (g[17] + b00[1]) + b01[1] * c0x[1]; + g[22] = cpx[2] * (g[18] + b00[2]) + b01[2] * c0x[2]; + g[23] = cpx[3] * (g[19] + b00[3]) + b01[3] * c0x[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[30] = cpy[2]; + g[31] = cpy[3]; + g[36] = c0y[0]; + g[37] = c0y[1]; + g[38] = c0y[2]; + g[39] = c0y[3]; + g[32] = cpy[0] * cpy[0] + b01[0]; + g[33] = cpy[1] * cpy[1] + b01[1]; + g[34] = cpy[2] * cpy[2] + b01[2]; + g[35] = cpy[3] * cpy[3] + b01[3]; + g[40] = cpy[0] * c0y[0] + b00[0]; + g[41] = cpy[1] * c0y[1] + b00[1]; + g[42] = cpy[2] * c0y[2] + b00[2]; + g[43] = cpy[3] * c0y[3] + b00[3]; + g[44] = cpy[0] * (g[40] + b00[0]) + b01[0] * c0y[0]; + g[45] = cpy[1] * (g[41] + b00[1]) + b01[1] * c0y[1]; + g[46] = cpy[2] * (g[42] + b00[2]) + b01[2] * c0y[2]; + g[47] = cpy[3] * (g[43] + b00[3]) + b01[3] * c0y[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[54] = cpz[2] * g[50]; + g[55] = cpz[3] * g[51]; + g[60] = c0z[0] * g[48]; + g[61] = c0z[1] * g[49]; + g[62] = c0z[2] * g[50]; + g[63] = c0z[3] * g[51]; + g[56] = cpz[0] * g[52] + b01[0] * g[48]; + g[57] = cpz[1] * g[53] + b01[1] * g[49]; + g[58] = cpz[2] * g[54] + b01[2] * g[50]; + g[59] = cpz[3] * g[55] + b01[3] * g[51]; + g[64] = cpz[0] * g[60] + b00[0] * g[48]; + g[65] = cpz[1] * g[61] + b00[1] * g[49]; + g[66] = cpz[2] * g[62] + b00[2] * g[50]; + g[67] = cpz[3] * g[63] + b00[3] * g[51]; + g[68] = cpz[0] * g[64] + b01[0] * g[60] + b00[0] * g[52]; + g[69] = cpz[1] * g[65] + b01[1] * g[61] + b00[1] * g[53]; + g[70] = cpz[2] * g[66] + b01[2] * g[62] + b00[2] * g[54]; + g[71] = cpz[3] * g[67] + b01[3] * g[63] + b00[3] * g[55]; +} + +static inline void _srg0_2d4d_0110(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = cpy[0]; + g[21] = cpy[1]; + g[22] = cpy[2]; + g[23] = cpy[3]; + g[24] = c0y[0]; + g[25] = c0y[1]; + g[26] = c0y[2]; + g[27] = c0y[3]; + g[28] = cpy[0] * c0y[0] + b00[0]; + g[29] = cpy[1] * c0y[1] + b00[1]; + g[30] = cpy[2] * c0y[2] + b00[2]; + g[31] = cpy[3] * c0y[3] + b00[3]; + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = cpz[0] * g[32]; + g[37] = cpz[1] * g[33]; + g[38] = cpz[2] * g[34]; + g[39] = cpz[3] * g[35]; + g[40] = c0z[0] * g[32]; + g[41] = c0z[1] * g[33]; + g[42] = c0z[2] * g[34]; + g[43] = c0z[3] * g[35]; + g[44] = cpz[0] * g[40] + b00[0] * g[32]; + g[45] = cpz[1] * g[41] + b00[1] * g[33]; + g[46] = cpz[2] * g[42] + b00[2] * g[34]; + g[47] = cpz[3] * g[43] + b00[3] * g[35]; +} + +static inline void _srg0_2d4d_0111(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + double xkxl = envs->rkrl[0]; + double ykyl = envs->rkrl[1]; + double zkzl = envs->rkrl[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[24] = c0x[0]; + g[25] = c0x[1]; + g[26] = c0x[2]; + g[27] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[32] = cpx[0] * c0x[0] + b00[0]; + g[33] = cpx[1] * c0x[1] + b00[1]; + g[34] = cpx[2] * c0x[2] + b00[2]; + g[35] = cpx[3] * c0x[3] + b00[3]; + g[12] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[13] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[14] = cpx[2] * (xkxl + cpx[2]) + b01[2]; + g[15] = cpx[3] * (xkxl + cpx[3]) + b01[3]; + g[36] = g[32] * (xkxl + cpx[0]) + cpx[0] * b00[0] + b01[0] * c0x[0]; + g[37] = g[33] * (xkxl + cpx[1]) + cpx[1] * b00[1] + b01[1] * c0x[1]; + g[38] = g[34] * (xkxl + cpx[2]) + cpx[2] * b00[2] + b01[2] * c0x[2]; + g[39] = g[35] * (xkxl + cpx[3]) + cpx[3] * b00[3] + b01[3] * c0x[3]; + g[4] = xkxl + cpx[0]; + g[5] = xkxl + cpx[1]; + g[6] = xkxl + cpx[2]; + g[7] = xkxl + cpx[3]; + g[28] = c0x[0] * (xkxl + cpx[0]) + b00[0]; + g[29] = c0x[1] * (xkxl + cpx[1]) + b00[1]; + g[30] = c0x[2] * (xkxl + cpx[2]) + b00[2]; + g[31] = c0x[3] * (xkxl + cpx[3]) + b00[3]; + g[48] = 1; + g[49] = 1; + g[50] = 1; + g[51] = 1; + g[72] = c0y[0]; + g[73] = c0y[1]; + g[74] = c0y[2]; + g[75] = c0y[3]; + g[56] = cpy[0]; + g[57] = cpy[1]; + g[58] = cpy[2]; + g[59] = cpy[3]; + g[80] = cpy[0] * c0y[0] + b00[0]; + g[81] = cpy[1] * c0y[1] + b00[1]; + g[82] = cpy[2] * c0y[2] + b00[2]; + g[83] = cpy[3] * c0y[3] + b00[3]; + g[60] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[61] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[62] = cpy[2] * (ykyl + cpy[2]) + b01[2]; + g[63] = cpy[3] * (ykyl + cpy[3]) + b01[3]; + g[84] = g[80] * (ykyl + cpy[0]) + cpy[0] * b00[0] + b01[0] * c0y[0]; + g[85] = g[81] * (ykyl + cpy[1]) + cpy[1] * b00[1] + b01[1] * c0y[1]; + g[86] = g[82] * (ykyl + cpy[2]) + cpy[2] * b00[2] + b01[2] * c0y[2]; + g[87] = g[83] * (ykyl + cpy[3]) + cpy[3] * b00[3] + b01[3] * c0y[3]; + g[52] = ykyl + cpy[0]; + g[53] = ykyl + cpy[1]; + g[54] = ykyl + cpy[2]; + g[55] = ykyl + cpy[3]; + g[76] = c0y[0] * (ykyl + cpy[0]) + b00[0]; + g[77] = c0y[1] * (ykyl + cpy[1]) + b00[1]; + g[78] = c0y[2] * (ykyl + cpy[2]) + b00[2]; + g[79] = c0y[3] * (ykyl + cpy[3]) + b00[3]; + //g[96] = w[0]; + //g[97] = w[0]; + //g[98] = w[1]; + //g[99] = w[1]; + g[120] = c0z[0] * g[96]; + g[121] = c0z[1] * g[97]; + g[122] = c0z[2] * g[98]; + g[123] = c0z[3] * g[99]; + g[104] = cpz[0] * g[96]; + g[105] = cpz[1] * g[97]; + g[106] = cpz[2] * g[98]; + g[107] = cpz[3] * g[99]; + g[128] = cpz[0] * g[120] + b00[0] * g[96]; + g[129] = cpz[1] * g[121] + b00[1] * g[97]; + g[130] = cpz[2] * g[122] + b00[2] * g[98]; + g[131] = cpz[3] * g[123] + b00[3] * g[99]; + g[108] = g[104] * (zkzl + cpz[0]) + b01[0] * g[96]; + g[109] = g[105] * (zkzl + cpz[1]) + b01[1] * g[97]; + g[110] = g[106] * (zkzl + cpz[2]) + b01[2] * g[98]; + g[111] = g[107] * (zkzl + cpz[3]) + b01[3] * g[99]; + g[132] = g[128] * (zkzl + cpz[0]) + b01[0] * g[120] + b00[0] * g[104]; + g[133] = g[129] * (zkzl + cpz[1]) + b01[1] * g[121] + b00[1] * g[105]; + g[134] = g[130] * (zkzl + cpz[2]) + b01[2] * g[122] + b00[2] * g[106]; + g[135] = g[131] * (zkzl + cpz[3]) + b01[3] * g[123] + b00[3] * g[107]; + g[100] = g[96] * (zkzl + cpz[0]); + g[101] = g[97] * (zkzl + cpz[1]); + g[102] = g[98] * (zkzl + cpz[2]); + g[103] = g[99] * (zkzl + cpz[3]); + g[124] = g[120] * (zkzl + cpz[0]) + b00[0] * g[96]; + g[125] = g[121] * (zkzl + cpz[1]) + b00[1] * g[97]; + g[126] = g[122] * (zkzl + cpz[2]) + b00[2] * g[98]; + g[127] = g[123] * (zkzl + cpz[3]) + b00[3] * g[99]; +} + +static inline void _srg0_2d4d_0120(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[12] = c0x[0]; + g[13] = c0x[1]; + g[14] = c0x[2]; + g[15] = c0x[3]; + g[8] = cpx[0] * cpx[0] + b01[0]; + g[9] = cpx[1] * cpx[1] + b01[1]; + g[10] = cpx[2] * cpx[2] + b01[2]; + g[11] = cpx[3] * cpx[3] + b01[3]; + g[16] = cpx[0] * c0x[0] + b00[0]; + g[17] = cpx[1] * c0x[1] + b00[1]; + g[18] = cpx[2] * c0x[2] + b00[2]; + g[19] = cpx[3] * c0x[3] + b00[3]; + g[20] = cpx[0] * (g[16] + b00[0]) + b01[0] * c0x[0]; + g[21] = cpx[1] * (g[17] + b00[1]) + b01[1] * c0x[1]; + g[22] = cpx[2] * (g[18] + b00[2]) + b01[2] * c0x[2]; + g[23] = cpx[3] * (g[19] + b00[3]) + b01[3] * c0x[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[30] = cpy[2]; + g[31] = cpy[3]; + g[36] = c0y[0]; + g[37] = c0y[1]; + g[38] = c0y[2]; + g[39] = c0y[3]; + g[32] = cpy[0] * cpy[0] + b01[0]; + g[33] = cpy[1] * cpy[1] + b01[1]; + g[34] = cpy[2] * cpy[2] + b01[2]; + g[35] = cpy[3] * cpy[3] + b01[3]; + g[40] = cpy[0] * c0y[0] + b00[0]; + g[41] = cpy[1] * c0y[1] + b00[1]; + g[42] = cpy[2] * c0y[2] + b00[2]; + g[43] = cpy[3] * c0y[3] + b00[3]; + g[44] = cpy[0] * (g[40] + b00[0]) + b01[0] * c0y[0]; + g[45] = cpy[1] * (g[41] + b00[1]) + b01[1] * c0y[1]; + g[46] = cpy[2] * (g[42] + b00[2]) + b01[2] * c0y[2]; + g[47] = cpy[3] * (g[43] + b00[3]) + b01[3] * c0y[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[54] = cpz[2] * g[50]; + g[55] = cpz[3] * g[51]; + g[60] = c0z[0] * g[48]; + g[61] = c0z[1] * g[49]; + g[62] = c0z[2] * g[50]; + g[63] = c0z[3] * g[51]; + g[56] = cpz[0] * g[52] + b01[0] * g[48]; + g[57] = cpz[1] * g[53] + b01[1] * g[49]; + g[58] = cpz[2] * g[54] + b01[2] * g[50]; + g[59] = cpz[3] * g[55] + b01[3] * g[51]; + g[64] = cpz[0] * g[60] + b00[0] * g[48]; + g[65] = cpz[1] * g[61] + b00[1] * g[49]; + g[66] = cpz[2] * g[62] + b00[2] * g[50]; + g[67] = cpz[3] * g[63] + b00[3] * g[51]; + g[68] = cpz[0] * g[64] + b01[0] * g[60] + b00[0] * g[52]; + g[69] = cpz[1] * g[65] + b01[1] * g[61] + b00[1] * g[53]; + g[70] = cpz[2] * g[66] + b01[2] * g[62] + b00[2] * g[54]; + g[71] = cpz[3] * g[67] + b01[3] * g[63] + b00[3] * g[55]; +} + +static inline void _srg0_2d4d_0200(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = 1; + g[13] = 1; + g[14] = 1; + g[15] = 1; + g[16] = c0y[0]; + g[17] = c0y[1]; + g[18] = c0y[2]; + g[19] = c0y[3]; + g[20] = c0y[0] * c0y[0] + b10[0]; + g[21] = c0y[1] * c0y[1] + b10[1]; + g[22] = c0y[2] * c0y[2] + b10[2]; + g[23] = c0y[3] * c0y[3] + b10[3]; + //g[24] = w[0]; + //g[25] = w[0]; + //g[26] = w[1]; + //g[27] = w[1]; + g[28] = c0z[0] * g[24]; + g[29] = c0z[1] * g[25]; + g[30] = c0z[2] * g[26]; + g[31] = c0z[3] * g[27]; + g[32] = c0z[0] * g[28] + b10[0] * g[24]; + g[33] = c0z[1] * g[29] + b10[1] * g[25]; + g[34] = c0z[2] * g[30] + b10[2] * g[26]; + g[35] = c0z[3] * g[31] + b10[3] * g[27]; +} + +static inline void _srg0_2d4d_0201(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[16] = c0x[0] * c0x[0] + b10[0]; + g[17] = c0x[1] * c0x[1] + b10[1]; + g[18] = c0x[2] * c0x[2] + b10[2]; + g[19] = c0x[3] * c0x[3] + b10[3]; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[20] = c0x[0] * (g[12] + b00[0]) + b10[0] * cpx[0]; + g[21] = c0x[1] * (g[13] + b00[1]) + b10[1] * cpx[1]; + g[22] = c0x[2] * (g[14] + b00[2]) + b10[2] * cpx[2]; + g[23] = c0x[3] * (g[15] + b00[3]) + b10[3] * cpx[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[32] = c0y[0]; + g[33] = c0y[1]; + g[34] = c0y[2]; + g[35] = c0y[3]; + g[40] = c0y[0] * c0y[0] + b10[0]; + g[41] = c0y[1] * c0y[1] + b10[1]; + g[42] = c0y[2] * c0y[2] + b10[2]; + g[43] = c0y[3] * c0y[3] + b10[3]; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[30] = cpy[2]; + g[31] = cpy[3]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[38] = cpy[2] * c0y[2] + b00[2]; + g[39] = cpy[3] * c0y[3] + b00[3]; + g[44] = c0y[0] * (g[36] + b00[0]) + b10[0] * cpy[0]; + g[45] = c0y[1] * (g[37] + b00[1]) + b10[1] * cpy[1]; + g[46] = c0y[2] * (g[38] + b00[2]) + b10[2] * cpy[2]; + g[47] = c0y[3] * (g[39] + b00[3]) + b10[3] * cpy[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[56] = c0z[0] * g[48]; + g[57] = c0z[1] * g[49]; + g[58] = c0z[2] * g[50]; + g[59] = c0z[3] * g[51]; + g[64] = c0z[0] * g[56] + b10[0] * g[48]; + g[65] = c0z[1] * g[57] + b10[1] * g[49]; + g[66] = c0z[2] * g[58] + b10[2] * g[50]; + g[67] = c0z[3] * g[59] + b10[3] * g[51]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[54] = cpz[2] * g[50]; + g[55] = cpz[3] * g[51]; + g[60] = cpz[0] * g[56] + b00[0] * g[48]; + g[61] = cpz[1] * g[57] + b00[1] * g[49]; + g[62] = cpz[2] * g[58] + b00[2] * g[50]; + g[63] = cpz[3] * g[59] + b00[3] * g[51]; + g[68] = c0z[0] * g[60] + b10[0] * g[52] + b00[0] * g[56]; + g[69] = c0z[1] * g[61] + b10[1] * g[53] + b00[1] * g[57]; + g[70] = c0z[2] * g[62] + b10[2] * g[54] + b00[2] * g[58]; + g[71] = c0z[3] * g[63] + b10[3] * g[55] + b00[3] * g[59]; +} + +static inline void _srg0_2d4d_0210(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = cpx[0]; + g[5] = cpx[1]; + g[6] = cpx[2]; + g[7] = cpx[3]; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = c0x[0] * c0x[0] + b10[0]; + g[17] = c0x[1] * c0x[1] + b10[1]; + g[18] = c0x[2] * c0x[2] + b10[2]; + g[19] = c0x[3] * c0x[3] + b10[3]; + g[20] = c0x[0] * (g[12] + b00[0]) + b10[0] * cpx[0]; + g[21] = c0x[1] * (g[13] + b00[1]) + b10[1] * cpx[1]; + g[22] = c0x[2] * (g[14] + b00[2]) + b10[2] * cpx[2]; + g[23] = c0x[3] * (g[15] + b00[3]) + b10[3] * cpx[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = cpy[0]; + g[29] = cpy[1]; + g[30] = cpy[2]; + g[31] = cpy[3]; + g[32] = c0y[0]; + g[33] = c0y[1]; + g[34] = c0y[2]; + g[35] = c0y[3]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[38] = cpy[2] * c0y[2] + b00[2]; + g[39] = cpy[3] * c0y[3] + b00[3]; + g[40] = c0y[0] * c0y[0] + b10[0]; + g[41] = c0y[1] * c0y[1] + b10[1]; + g[42] = c0y[2] * c0y[2] + b10[2]; + g[43] = c0y[3] * c0y[3] + b10[3]; + g[44] = c0y[0] * (g[36] + b00[0]) + b10[0] * cpy[0]; + g[45] = c0y[1] * (g[37] + b00[1]) + b10[1] * cpy[1]; + g[46] = c0y[2] * (g[38] + b00[2]) + b10[2] * cpy[2]; + g[47] = c0y[3] * (g[39] + b00[3]) + b10[3] * cpy[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = cpz[0] * g[48]; + g[53] = cpz[1] * g[49]; + g[54] = cpz[2] * g[50]; + g[55] = cpz[3] * g[51]; + g[56] = c0z[0] * g[48]; + g[57] = c0z[1] * g[49]; + g[58] = c0z[2] * g[50]; + g[59] = c0z[3] * g[51]; + g[60] = cpz[0] * g[56] + b00[0] * g[48]; + g[61] = cpz[1] * g[57] + b00[1] * g[49]; + g[62] = cpz[2] * g[58] + b00[2] * g[50]; + g[63] = cpz[3] * g[59] + b00[3] * g[51]; + g[64] = c0z[0] * g[56] + b10[0] * g[48]; + g[65] = c0z[1] * g[57] + b10[1] * g[49]; + g[66] = c0z[2] * g[58] + b10[2] * g[50]; + g[67] = c0z[3] * g[59] + b10[3] * g[51]; + g[68] = c0z[0] * g[60] + b10[0] * g[52] + b00[0] * g[56]; + g[69] = c0z[1] * g[61] + b10[1] * g[53] + b00[1] * g[57]; + g[70] = c0z[2] * g[62] + b10[2] * g[54] + b00[2] * g[58]; + g[71] = c0z[3] * g[63] + b10[3] * g[55] + b00[3] * g[59]; +} + +static inline void _srg0_2d4d_0300(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = c0x[0] * (g[8] + 2 * b10[0]); + g[13] = c0x[1] * (g[9] + 2 * b10[1]); + g[14] = c0x[2] * (g[10] + 2 * b10[2]); + g[15] = c0x[3] * (g[11] + 2 * b10[3]); + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = c0y[0]; + g[21] = c0y[1]; + g[22] = c0y[2]; + g[23] = c0y[3]; + g[24] = c0y[0] * c0y[0] + b10[0]; + g[25] = c0y[1] * c0y[1] + b10[1]; + g[26] = c0y[2] * c0y[2] + b10[2]; + g[27] = c0y[3] * c0y[3] + b10[3]; + g[28] = c0y[0] * (g[24] + 2 * b10[0]); + g[29] = c0y[1] * (g[25] + 2 * b10[1]); + g[30] = c0y[2] * (g[26] + 2 * b10[2]); + g[31] = c0y[3] * (g[27] + 2 * b10[3]); + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = c0z[0] * g[32]; + g[37] = c0z[1] * g[33]; + g[38] = c0z[2] * g[34]; + g[39] = c0z[3] * g[35]; + g[40] = c0z[0] * g[36] + b10[0] * g[32]; + g[41] = c0z[1] * g[37] + b10[1] * g[33]; + g[42] = c0z[2] * g[38] + b10[2] * g[34]; + g[43] = c0z[3] * g[39] + b10[3] * g[35]; + g[44] = c0z[0] * g[40] + 2 * b10[0] * g[36]; + g[45] = c0z[1] * g[41] + 2 * b10[1] * g[37]; + g[46] = c0z[2] * g[42] + 2 * b10[2] * g[38]; + g[47] = c0z[3] * g[43] + 2 * b10[3] * g[39]; +} + +static inline void _srg0_2d4d_1000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + g[0] = 1; + g[1] = 1; + g[2] = c0x[0]; + g[3] = c0x[1]; + g[4] = 1; + g[5] = 1; + g[6] = c0y[0]; + g[7] = c0y[1]; + //g[8] = w[0]; + //g[9] = w[0]; + g[10] = c0z[0] * g[8]; + g[11] = c0z[1] * g[9]; +} + +static inline void _srg0_2d4d_1001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = c0y[0]; + g[21] = c0y[1]; + g[22] = c0y[2]; + g[23] = c0y[3]; + g[24] = cpy[0]; + g[25] = cpy[1]; + g[26] = cpy[2]; + g[27] = cpy[3]; + g[28] = cpy[0] * c0y[0] + b00[0]; + g[29] = cpy[1] * c0y[1] + b00[1]; + g[30] = cpy[2] * c0y[2] + b00[2]; + g[31] = cpy[3] * c0y[3] + b00[3]; + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = c0z[0] * g[32]; + g[37] = c0z[1] * g[33]; + g[38] = c0z[2] * g[34]; + g[39] = c0z[3] * g[35]; + g[40] = cpz[0] * g[32]; + g[41] = cpz[1] * g[33]; + g[42] = cpz[2] * g[34]; + g[43] = cpz[3] * g[35]; + g[44] = cpz[0] * g[36] + b00[0] * g[32]; + g[45] = cpz[1] * g[37] + b00[1] * g[33]; + g[46] = cpz[2] * g[38] + b00[2] * g[34]; + g[47] = cpz[3] * g[39] + b00[3] * g[35]; +} + +static inline void _srg0_2d4d_1002(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = cpx[0] * cpx[0] + b01[0]; + g[17] = cpx[1] * cpx[1] + b01[1]; + g[18] = cpx[2] * cpx[2] + b01[2]; + g[19] = cpx[3] * cpx[3] + b01[3]; + g[20] = cpx[0] * (g[12] + b00[0]) + b01[0] * c0x[0]; + g[21] = cpx[1] * (g[13] + b00[1]) + b01[1] * c0x[1]; + g[22] = cpx[2] * (g[14] + b00[2]) + b01[2] * c0x[2]; + g[23] = cpx[3] * (g[15] + b00[3]) + b01[3] * c0x[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = c0y[0]; + g[29] = c0y[1]; + g[30] = c0y[2]; + g[31] = c0y[3]; + g[32] = cpy[0]; + g[33] = cpy[1]; + g[34] = cpy[2]; + g[35] = cpy[3]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[38] = cpy[2] * c0y[2] + b00[2]; + g[39] = cpy[3] * c0y[3] + b00[3]; + g[40] = cpy[0] * cpy[0] + b01[0]; + g[41] = cpy[1] * cpy[1] + b01[1]; + g[42] = cpy[2] * cpy[2] + b01[2]; + g[43] = cpy[3] * cpy[3] + b01[3]; + g[44] = cpy[0] * (g[36] + b00[0]) + b01[0] * c0y[0]; + g[45] = cpy[1] * (g[37] + b00[1]) + b01[1] * c0y[1]; + g[46] = cpy[2] * (g[38] + b00[2]) + b01[2] * c0y[2]; + g[47] = cpy[3] * (g[39] + b00[3]) + b01[3] * c0y[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = c0z[0] * g[48]; + g[53] = c0z[1] * g[49]; + g[54] = c0z[2] * g[50]; + g[55] = c0z[3] * g[51]; + g[56] = cpz[0] * g[48]; + g[57] = cpz[1] * g[49]; + g[58] = cpz[2] * g[50]; + g[59] = cpz[3] * g[51]; + g[60] = cpz[0] * g[52] + b00[0] * g[48]; + g[61] = cpz[1] * g[53] + b00[1] * g[49]; + g[62] = cpz[2] * g[54] + b00[2] * g[50]; + g[63] = cpz[3] * g[55] + b00[3] * g[51]; + g[64] = cpz[0] * g[56] + b01[0] * g[48]; + g[65] = cpz[1] * g[57] + b01[1] * g[49]; + g[66] = cpz[2] * g[58] + b01[2] * g[50]; + g[67] = cpz[3] * g[59] + b01[3] * g[51]; + g[68] = cpz[0] * g[60] + b01[0] * g[52] + b00[0] * g[56]; + g[69] = cpz[1] * g[61] + b01[1] * g[53] + b00[1] * g[57]; + g[70] = cpz[2] * g[62] + b01[2] * g[54] + b00[2] * g[58]; + g[71] = cpz[3] * g[63] + b01[3] * g[55] + b00[3] * g[59]; +} + +static inline void _srg0_2d4d_1010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = c0y[0]; + g[21] = c0y[1]; + g[22] = c0y[2]; + g[23] = c0y[3]; + g[24] = cpy[0]; + g[25] = cpy[1]; + g[26] = cpy[2]; + g[27] = cpy[3]; + g[28] = cpy[0] * c0y[0] + b00[0]; + g[29] = cpy[1] * c0y[1] + b00[1]; + g[30] = cpy[2] * c0y[2] + b00[2]; + g[31] = cpy[3] * c0y[3] + b00[3]; + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = c0z[0] * g[32]; + g[37] = c0z[1] * g[33]; + g[38] = c0z[2] * g[34]; + g[39] = c0z[3] * g[35]; + g[40] = cpz[0] * g[32]; + g[41] = cpz[1] * g[33]; + g[42] = cpz[2] * g[34]; + g[43] = cpz[3] * g[35]; + g[44] = cpz[0] * g[36] + b00[0] * g[32]; + g[45] = cpz[1] * g[37] + b00[1] * g[33]; + g[46] = cpz[2] * g[38] + b00[2] * g[34]; + g[47] = cpz[3] * g[39] + b00[3] * g[35]; +} + +static inline void _srg0_2d4d_1011(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + double xkxl = envs->rkrl[0]; + double ykyl = envs->rkrl[1]; + double zkzl = envs->rkrl[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[16] = cpx[0]; + g[17] = cpx[1]; + g[18] = cpx[2]; + g[19] = cpx[3]; + g[20] = cpx[0] * c0x[0] + b00[0]; + g[21] = cpx[1] * c0x[1] + b00[1]; + g[22] = cpx[2] * c0x[2] + b00[2]; + g[23] = cpx[3] * c0x[3] + b00[3]; + g[24] = cpx[0] * (xkxl + cpx[0]) + b01[0]; + g[25] = cpx[1] * (xkxl + cpx[1]) + b01[1]; + g[26] = cpx[2] * (xkxl + cpx[2]) + b01[2]; + g[27] = cpx[3] * (xkxl + cpx[3]) + b01[3]; + g[28] = g[20] * (xkxl + cpx[0]) + cpx[0] * b00[0] + b01[0] * c0x[0]; + g[29] = g[21] * (xkxl + cpx[1]) + cpx[1] * b00[1] + b01[1] * c0x[1]; + g[30] = g[22] * (xkxl + cpx[2]) + cpx[2] * b00[2] + b01[2] * c0x[2]; + g[31] = g[23] * (xkxl + cpx[3]) + cpx[3] * b00[3] + b01[3] * c0x[3]; + g[8] = xkxl + cpx[0]; + g[9] = xkxl + cpx[1]; + g[10] = xkxl + cpx[2]; + g[11] = xkxl + cpx[3]; + g[12] = c0x[0] * (xkxl + cpx[0]) + b00[0]; + g[13] = c0x[1] * (xkxl + cpx[1]) + b00[1]; + g[14] = c0x[2] * (xkxl + cpx[2]) + b00[2]; + g[15] = c0x[3] * (xkxl + cpx[3]) + b00[3]; + g[48] = 1; + g[49] = 1; + g[50] = 1; + g[51] = 1; + g[52] = c0y[0]; + g[53] = c0y[1]; + g[54] = c0y[2]; + g[55] = c0y[3]; + g[64] = cpy[0]; + g[65] = cpy[1]; + g[66] = cpy[2]; + g[67] = cpy[3]; + g[68] = cpy[0] * c0y[0] + b00[0]; + g[69] = cpy[1] * c0y[1] + b00[1]; + g[70] = cpy[2] * c0y[2] + b00[2]; + g[71] = cpy[3] * c0y[3] + b00[3]; + g[72] = cpy[0] * (ykyl + cpy[0]) + b01[0]; + g[73] = cpy[1] * (ykyl + cpy[1]) + b01[1]; + g[74] = cpy[2] * (ykyl + cpy[2]) + b01[2]; + g[75] = cpy[3] * (ykyl + cpy[3]) + b01[3]; + g[76] = g[68] * (ykyl + cpy[0]) + cpy[0] * b00[0] + b01[0] * c0y[0]; + g[77] = g[69] * (ykyl + cpy[1]) + cpy[1] * b00[1] + b01[1] * c0y[1]; + g[78] = g[70] * (ykyl + cpy[2]) + cpy[2] * b00[2] + b01[2] * c0y[2]; + g[79] = g[71] * (ykyl + cpy[3]) + cpy[3] * b00[3] + b01[3] * c0y[3]; + g[56] = ykyl + cpy[0]; + g[57] = ykyl + cpy[1]; + g[58] = ykyl + cpy[2]; + g[59] = ykyl + cpy[3]; + g[60] = c0y[0] * (ykyl + cpy[0]) + b00[0]; + g[61] = c0y[1] * (ykyl + cpy[1]) + b00[1]; + g[62] = c0y[2] * (ykyl + cpy[2]) + b00[2]; + g[63] = c0y[3] * (ykyl + cpy[3]) + b00[3]; + //g[96] = w[0]; + //g[97] = w[0]; + //g[98] = w[1]; + //g[99] = w[1]; + g[100] = c0z[0] * g[96]; + g[101] = c0z[1] * g[97]; + g[102] = c0z[2] * g[98]; + g[103] = c0z[3] * g[99]; + g[112] = cpz[0] * g[96]; + g[113] = cpz[1] * g[97]; + g[114] = cpz[2] * g[98]; + g[115] = cpz[3] * g[99]; + g[116] = cpz[0] * g[100] + b00[0] * g[96]; + g[117] = cpz[1] * g[101] + b00[1] * g[97]; + g[118] = cpz[2] * g[102] + b00[2] * g[98]; + g[119] = cpz[3] * g[103] + b00[3] * g[99]; + g[120] = g[112] * (zkzl + cpz[0]) + b01[0] * g[96]; + g[121] = g[113] * (zkzl + cpz[1]) + b01[1] * g[97]; + g[122] = g[114] * (zkzl + cpz[2]) + b01[2] * g[98]; + g[123] = g[115] * (zkzl + cpz[3]) + b01[3] * g[99]; + g[124] = g[116] * (zkzl + cpz[0]) + b01[0] * g[100] + b00[0] * g[112]; + g[125] = g[117] * (zkzl + cpz[1]) + b01[1] * g[101] + b00[1] * g[113]; + g[126] = g[118] * (zkzl + cpz[2]) + b01[2] * g[102] + b00[2] * g[114]; + g[127] = g[119] * (zkzl + cpz[3]) + b01[3] * g[103] + b00[3] * g[115]; + g[104] = g[96] * (zkzl + cpz[0]); + g[105] = g[97] * (zkzl + cpz[1]); + g[106] = g[98] * (zkzl + cpz[2]); + g[107] = g[99] * (zkzl + cpz[3]); + g[108] = g[100] * (zkzl + cpz[0]) + b00[0] * g[96]; + g[109] = g[101] * (zkzl + cpz[1]) + b00[1] * g[97]; + g[110] = g[102] * (zkzl + cpz[2]) + b00[2] * g[98]; + g[111] = g[103] * (zkzl + cpz[3]) + b00[3] * g[99]; +} + +static inline void _srg0_2d4d_1020(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b01 = bc->b01; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[12] = cpx[0] * c0x[0] + b00[0]; + g[13] = cpx[1] * c0x[1] + b00[1]; + g[14] = cpx[2] * c0x[2] + b00[2]; + g[15] = cpx[3] * c0x[3] + b00[3]; + g[16] = cpx[0] * cpx[0] + b01[0]; + g[17] = cpx[1] * cpx[1] + b01[1]; + g[18] = cpx[2] * cpx[2] + b01[2]; + g[19] = cpx[3] * cpx[3] + b01[3]; + g[20] = cpx[0] * (g[12] + b00[0]) + b01[0] * c0x[0]; + g[21] = cpx[1] * (g[13] + b00[1]) + b01[1] * c0x[1]; + g[22] = cpx[2] * (g[14] + b00[2]) + b01[2] * c0x[2]; + g[23] = cpx[3] * (g[15] + b00[3]) + b01[3] * c0x[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = c0y[0]; + g[29] = c0y[1]; + g[30] = c0y[2]; + g[31] = c0y[3]; + g[32] = cpy[0]; + g[33] = cpy[1]; + g[34] = cpy[2]; + g[35] = cpy[3]; + g[36] = cpy[0] * c0y[0] + b00[0]; + g[37] = cpy[1] * c0y[1] + b00[1]; + g[38] = cpy[2] * c0y[2] + b00[2]; + g[39] = cpy[3] * c0y[3] + b00[3]; + g[40] = cpy[0] * cpy[0] + b01[0]; + g[41] = cpy[1] * cpy[1] + b01[1]; + g[42] = cpy[2] * cpy[2] + b01[2]; + g[43] = cpy[3] * cpy[3] + b01[3]; + g[44] = cpy[0] * (g[36] + b00[0]) + b01[0] * c0y[0]; + g[45] = cpy[1] * (g[37] + b00[1]) + b01[1] * c0y[1]; + g[46] = cpy[2] * (g[38] + b00[2]) + b01[2] * c0y[2]; + g[47] = cpy[3] * (g[39] + b00[3]) + b01[3] * c0y[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = c0z[0] * g[48]; + g[53] = c0z[1] * g[49]; + g[54] = c0z[2] * g[50]; + g[55] = c0z[3] * g[51]; + g[56] = cpz[0] * g[48]; + g[57] = cpz[1] * g[49]; + g[58] = cpz[2] * g[50]; + g[59] = cpz[3] * g[51]; + g[60] = cpz[0] * g[52] + b00[0] * g[48]; + g[61] = cpz[1] * g[53] + b00[1] * g[49]; + g[62] = cpz[2] * g[54] + b00[2] * g[50]; + g[63] = cpz[3] * g[55] + b00[3] * g[51]; + g[64] = cpz[0] * g[56] + b01[0] * g[48]; + g[65] = cpz[1] * g[57] + b01[1] * g[49]; + g[66] = cpz[2] * g[58] + b01[2] * g[50]; + g[67] = cpz[3] * g[59] + b01[3] * g[51]; + g[68] = cpz[0] * g[60] + b01[0] * g[52] + b00[0] * g[56]; + g[69] = cpz[1] * g[61] + b01[1] * g[53] + b00[1] * g[57]; + g[70] = cpz[2] * g[62] + b01[2] * g[54] + b00[2] * g[58]; + g[71] = cpz[3] * g[63] + b01[3] * g[55] + b00[3] * g[59]; +} + +static inline void _srg0_2d4d_1100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + double xixj = envs->rirj[0]; + double yiyj = envs->rirj[1]; + double zizj = envs->rirj[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[12] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[13] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[14] = c0x[2] * (xixj + c0x[2]) + b10[2]; + g[15] = c0x[3] * (xixj + c0x[3]) + b10[3]; + g[4] = xixj + c0x[0]; + g[5] = xixj + c0x[1]; + g[6] = xixj + c0x[2]; + g[7] = xixj + c0x[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[32] = c0y[0]; + g[33] = c0y[1]; + g[34] = c0y[2]; + g[35] = c0y[3]; + g[36] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[37] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[38] = c0y[2] * (yiyj + c0y[2]) + b10[2]; + g[39] = c0y[3] * (yiyj + c0y[3]) + b10[3]; + g[28] = yiyj + c0y[0]; + g[29] = yiyj + c0y[1]; + g[30] = yiyj + c0y[2]; + g[31] = yiyj + c0y[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[56] = c0z[0] * g[48]; + g[57] = c0z[1] * g[49]; + g[58] = c0z[2] * g[50]; + g[59] = c0z[3] * g[51]; + g[60] = g[56] * (zizj + c0z[0]) + b10[0] * g[48]; + g[61] = g[57] * (zizj + c0z[1]) + b10[1] * g[49]; + g[62] = g[58] * (zizj + c0z[2]) + b10[2] * g[50]; + g[63] = g[59] * (zizj + c0z[3]) + b10[3] * g[51]; + g[52] = g[48] * (zizj + c0z[0]); + g[53] = g[49] * (zizj + c0z[1]); + g[54] = g[50] * (zizj + c0z[2]); + g[55] = g[51] * (zizj + c0z[3]); +} + +static inline void _srg0_2d4d_1101(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + double xixj = envs->rirj[0]; + double yiyj = envs->rirj[1]; + double zizj = envs->rirj[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[16] = c0x[0]; + g[17] = c0x[1]; + g[18] = c0x[2]; + g[19] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[24] = cpx[0] * c0x[0] + b00[0]; + g[25] = cpx[1] * c0x[1] + b00[1]; + g[26] = cpx[2] * c0x[2] + b00[2]; + g[27] = cpx[3] * c0x[3] + b00[3]; + g[20] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[21] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[22] = c0x[2] * (xixj + c0x[2]) + b10[2]; + g[23] = c0x[3] * (xixj + c0x[3]) + b10[3]; + g[4] = xixj + c0x[0]; + g[5] = xixj + c0x[1]; + g[6] = xixj + c0x[2]; + g[7] = xixj + c0x[3]; + g[28] = g[24] * (xixj + c0x[0]) + c0x[0] * b00[0] + b10[0] * cpx[0]; + g[29] = g[25] * (xixj + c0x[1]) + c0x[1] * b00[1] + b10[1] * cpx[1]; + g[30] = g[26] * (xixj + c0x[2]) + c0x[2] * b00[2] + b10[2] * cpx[2]; + g[31] = g[27] * (xixj + c0x[3]) + c0x[3] * b00[3] + b10[3] * cpx[3]; + g[12] = cpx[0] * (xixj + c0x[0]) + b00[0]; + g[13] = cpx[1] * (xixj + c0x[1]) + b00[1]; + g[14] = cpx[2] * (xixj + c0x[2]) + b00[2]; + g[15] = cpx[3] * (xixj + c0x[3]) + b00[3]; + g[48] = 1; + g[49] = 1; + g[50] = 1; + g[51] = 1; + g[64] = c0y[0]; + g[65] = c0y[1]; + g[66] = c0y[2]; + g[67] = c0y[3]; + g[56] = cpy[0]; + g[57] = cpy[1]; + g[58] = cpy[2]; + g[59] = cpy[3]; + g[72] = cpy[0] * c0y[0] + b00[0]; + g[73] = cpy[1] * c0y[1] + b00[1]; + g[74] = cpy[2] * c0y[2] + b00[2]; + g[75] = cpy[3] * c0y[3] + b00[3]; + g[68] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[69] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[70] = c0y[2] * (yiyj + c0y[2]) + b10[2]; + g[71] = c0y[3] * (yiyj + c0y[3]) + b10[3]; + g[52] = yiyj + c0y[0]; + g[53] = yiyj + c0y[1]; + g[54] = yiyj + c0y[2]; + g[55] = yiyj + c0y[3]; + g[76] = g[72] * (yiyj + c0y[0]) + c0y[0] * b00[0] + b10[0] * cpy[0]; + g[77] = g[73] * (yiyj + c0y[1]) + c0y[1] * b00[1] + b10[1] * cpy[1]; + g[78] = g[74] * (yiyj + c0y[2]) + c0y[2] * b00[2] + b10[2] * cpy[2]; + g[79] = g[75] * (yiyj + c0y[3]) + c0y[3] * b00[3] + b10[3] * cpy[3]; + g[60] = cpy[0] * (yiyj + c0y[0]) + b00[0]; + g[61] = cpy[1] * (yiyj + c0y[1]) + b00[1]; + g[62] = cpy[2] * (yiyj + c0y[2]) + b00[2]; + g[63] = cpy[3] * (yiyj + c0y[3]) + b00[3]; + //g[96] = w[0]; + //g[97] = w[0]; + //g[98] = w[1]; + //g[99] = w[1]; + g[112] = c0z[0] * g[96]; + g[113] = c0z[1] * g[97]; + g[114] = c0z[2] * g[98]; + g[115] = c0z[3] * g[99]; + g[104] = cpz[0] * g[96]; + g[105] = cpz[1] * g[97]; + g[106] = cpz[2] * g[98]; + g[107] = cpz[3] * g[99]; + g[120] = cpz[0] * g[112] + b00[0] * g[96]; + g[121] = cpz[1] * g[113] + b00[1] * g[97]; + g[122] = cpz[2] * g[114] + b00[2] * g[98]; + g[123] = cpz[3] * g[115] + b00[3] * g[99]; + g[116] = g[112] * (zizj + c0z[0]) + b10[0] * g[96]; + g[117] = g[113] * (zizj + c0z[1]) + b10[1] * g[97]; + g[118] = g[114] * (zizj + c0z[2]) + b10[2] * g[98]; + g[119] = g[115] * (zizj + c0z[3]) + b10[3] * g[99]; + g[100] = g[96] * (zizj + c0z[0]); + g[101] = g[97] * (zizj + c0z[1]); + g[102] = g[98] * (zizj + c0z[2]); + g[103] = g[99] * (zizj + c0z[3]); + g[124] = g[120] * (zizj + c0z[0]) + b10[0] * g[104] + b00[0] * g[112]; + g[125] = g[121] * (zizj + c0z[1]) + b10[1] * g[105] + b00[1] * g[113]; + g[126] = g[122] * (zizj + c0z[2]) + b10[2] * g[106] + b00[2] * g[114]; + g[127] = g[123] * (zizj + c0z[3]) + b10[3] * g[107] + b00[3] * g[115]; + g[108] = zizj * g[104] + cpz[0] * g[112] + b00[0] * g[96]; + g[109] = zizj * g[105] + cpz[1] * g[113] + b00[1] * g[97]; + g[110] = zizj * g[106] + cpz[2] * g[114] + b00[2] * g[98]; + g[111] = zizj * g[107] + cpz[3] * g[115] + b00[3] * g[99]; +} + +static inline void _srg0_2d4d_1110(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + double xixj = envs->rirj[0]; + double yiyj = envs->rirj[1]; + double zizj = envs->rirj[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[16] = c0x[0]; + g[17] = c0x[1]; + g[18] = c0x[2]; + g[19] = c0x[3]; + g[8] = cpx[0]; + g[9] = cpx[1]; + g[10] = cpx[2]; + g[11] = cpx[3]; + g[24] = cpx[0] * c0x[0] + b00[0]; + g[25] = cpx[1] * c0x[1] + b00[1]; + g[26] = cpx[2] * c0x[2] + b00[2]; + g[27] = cpx[3] * c0x[3] + b00[3]; + g[20] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[21] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[22] = c0x[2] * (xixj + c0x[2]) + b10[2]; + g[23] = c0x[3] * (xixj + c0x[3]) + b10[3]; + g[4] = xixj + c0x[0]; + g[5] = xixj + c0x[1]; + g[6] = xixj + c0x[2]; + g[7] = xixj + c0x[3]; + g[28] = g[24] * (xixj + c0x[0]) + c0x[0] * b00[0] + b10[0] * cpx[0]; + g[29] = g[25] * (xixj + c0x[1]) + c0x[1] * b00[1] + b10[1] * cpx[1]; + g[30] = g[26] * (xixj + c0x[2]) + c0x[2] * b00[2] + b10[2] * cpx[2]; + g[31] = g[27] * (xixj + c0x[3]) + c0x[3] * b00[3] + b10[3] * cpx[3]; + g[12] = cpx[0] * (xixj + c0x[0]) + b00[0]; + g[13] = cpx[1] * (xixj + c0x[1]) + b00[1]; + g[14] = cpx[2] * (xixj + c0x[2]) + b00[2]; + g[15] = cpx[3] * (xixj + c0x[3]) + b00[3]; + g[48] = 1; + g[49] = 1; + g[50] = 1; + g[51] = 1; + g[64] = c0y[0]; + g[65] = c0y[1]; + g[66] = c0y[2]; + g[67] = c0y[3]; + g[56] = cpy[0]; + g[57] = cpy[1]; + g[58] = cpy[2]; + g[59] = cpy[3]; + g[72] = cpy[0] * c0y[0] + b00[0]; + g[73] = cpy[1] * c0y[1] + b00[1]; + g[74] = cpy[2] * c0y[2] + b00[2]; + g[75] = cpy[3] * c0y[3] + b00[3]; + g[68] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[69] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[70] = c0y[2] * (yiyj + c0y[2]) + b10[2]; + g[71] = c0y[3] * (yiyj + c0y[3]) + b10[3]; + g[52] = yiyj + c0y[0]; + g[53] = yiyj + c0y[1]; + g[54] = yiyj + c0y[2]; + g[55] = yiyj + c0y[3]; + g[76] = g[72] * (yiyj + c0y[0]) + c0y[0] * b00[0] + b10[0] * cpy[0]; + g[77] = g[73] * (yiyj + c0y[1]) + c0y[1] * b00[1] + b10[1] * cpy[1]; + g[78] = g[74] * (yiyj + c0y[2]) + c0y[2] * b00[2] + b10[2] * cpy[2]; + g[79] = g[75] * (yiyj + c0y[3]) + c0y[3] * b00[3] + b10[3] * cpy[3]; + g[60] = cpy[0] * (yiyj + c0y[0]) + b00[0]; + g[61] = cpy[1] * (yiyj + c0y[1]) + b00[1]; + g[62] = cpy[2] * (yiyj + c0y[2]) + b00[2]; + g[63] = cpy[3] * (yiyj + c0y[3]) + b00[3]; + //g[96] = w[0]; + //g[97] = w[0]; + //g[98] = w[1]; + //g[99] = w[1]; + g[112] = c0z[0] * g[96]; + g[113] = c0z[1] * g[97]; + g[114] = c0z[2] * g[98]; + g[115] = c0z[3] * g[99]; + g[104] = cpz[0] * g[96]; + g[105] = cpz[1] * g[97]; + g[106] = cpz[2] * g[98]; + g[107] = cpz[3] * g[99]; + g[120] = cpz[0] * g[112] + b00[0] * g[96]; + g[121] = cpz[1] * g[113] + b00[1] * g[97]; + g[122] = cpz[2] * g[114] + b00[2] * g[98]; + g[123] = cpz[3] * g[115] + b00[3] * g[99]; + g[116] = g[112] * (zizj + c0z[0]) + b10[0] * g[96]; + g[117] = g[113] * (zizj + c0z[1]) + b10[1] * g[97]; + g[118] = g[114] * (zizj + c0z[2]) + b10[2] * g[98]; + g[119] = g[115] * (zizj + c0z[3]) + b10[3] * g[99]; + g[100] = g[96] * (zizj + c0z[0]); + g[101] = g[97] * (zizj + c0z[1]); + g[102] = g[98] * (zizj + c0z[2]); + g[103] = g[99] * (zizj + c0z[3]); + g[124] = g[120] * (zizj + c0z[0]) + b10[0] * g[104] + b00[0] * g[112]; + g[125] = g[121] * (zizj + c0z[1]) + b10[1] * g[105] + b00[1] * g[113]; + g[126] = g[122] * (zizj + c0z[2]) + b10[2] * g[106] + b00[2] * g[114]; + g[127] = g[123] * (zizj + c0z[3]) + b10[3] * g[107] + b00[3] * g[115]; + g[108] = zizj * g[104] + cpz[0] * g[112] + b00[0] * g[96]; + g[109] = zizj * g[105] + cpz[1] * g[113] + b00[1] * g[97]; + g[110] = zizj * g[106] + cpz[2] * g[114] + b00[2] * g[98]; + g[111] = zizj * g[107] + cpz[3] * g[115] + b00[3] * g[99]; +} + +static inline void _srg0_2d4d_1200(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + double xixj = envs->rirj[0]; + double yiyj = envs->rirj[1]; + double zizj = envs->rirj[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[8] = c0x[0]; + g[9] = c0x[1]; + g[10] = c0x[2]; + g[11] = c0x[3]; + g[16] = c0x[0] * c0x[0] + b10[0]; + g[17] = c0x[1] * c0x[1] + b10[1]; + g[18] = c0x[2] * c0x[2] + b10[2]; + g[19] = c0x[3] * c0x[3] + b10[3]; + g[20] = g[16] * (xixj + c0x[0]) + c0x[0] * 2 * b10[0]; + g[21] = g[17] * (xixj + c0x[1]) + c0x[1] * 2 * b10[1]; + g[22] = g[18] * (xixj + c0x[2]) + c0x[2] * 2 * b10[2]; + g[23] = g[19] * (xixj + c0x[3]) + c0x[3] * 2 * b10[3]; + g[12] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[13] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[14] = c0x[2] * (xixj + c0x[2]) + b10[2]; + g[15] = c0x[3] * (xixj + c0x[3]) + b10[3]; + g[4] = xixj + c0x[0]; + g[5] = xixj + c0x[1]; + g[6] = xixj + c0x[2]; + g[7] = xixj + c0x[3]; + g[32] = 1; + g[33] = 1; + g[34] = 1; + g[35] = 1; + g[40] = c0y[0]; + g[41] = c0y[1]; + g[42] = c0y[2]; + g[43] = c0y[3]; + g[48] = c0y[0] * c0y[0] + b10[0]; + g[49] = c0y[1] * c0y[1] + b10[1]; + g[50] = c0y[2] * c0y[2] + b10[2]; + g[51] = c0y[3] * c0y[3] + b10[3]; + g[52] = g[48] * (yiyj + c0y[0]) + c0y[0] * 2 * b10[0]; + g[53] = g[49] * (yiyj + c0y[1]) + c0y[1] * 2 * b10[1]; + g[54] = g[50] * (yiyj + c0y[2]) + c0y[2] * 2 * b10[2]; + g[55] = g[51] * (yiyj + c0y[3]) + c0y[3] * 2 * b10[3]; + g[44] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[45] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[46] = c0y[2] * (yiyj + c0y[2]) + b10[2]; + g[47] = c0y[3] * (yiyj + c0y[3]) + b10[3]; + g[36] = yiyj + c0y[0]; + g[37] = yiyj + c0y[1]; + g[38] = yiyj + c0y[2]; + g[39] = yiyj + c0y[3]; + //g[64] = w[0]; + //g[65] = w[0]; + //g[66] = w[1]; + //g[67] = w[1]; + g[72] = c0z[0] * g[64]; + g[73] = c0z[1] * g[65]; + g[74] = c0z[2] * g[66]; + g[75] = c0z[3] * g[67]; + g[80] = c0z[0] * g[72] + b10[0] * g[64]; + g[81] = c0z[1] * g[73] + b10[1] * g[65]; + g[82] = c0z[2] * g[74] + b10[2] * g[66]; + g[83] = c0z[3] * g[75] + b10[3] * g[67]; + g[84] = g[80] * (zizj + c0z[0]) + 2 * b10[0] * g[72]; + g[85] = g[81] * (zizj + c0z[1]) + 2 * b10[1] * g[73]; + g[86] = g[82] * (zizj + c0z[2]) + 2 * b10[2] * g[74]; + g[87] = g[83] * (zizj + c0z[3]) + 2 * b10[3] * g[75]; + g[76] = g[72] * (zizj + c0z[0]) + b10[0] * g[64]; + g[77] = g[73] * (zizj + c0z[1]) + b10[1] * g[65]; + g[78] = g[74] * (zizj + c0z[2]) + b10[2] * g[66]; + g[79] = g[75] * (zizj + c0z[3]) + b10[3] * g[67]; + g[68] = g[64] * (zizj + c0z[0]); + g[69] = g[65] * (zizj + c0z[1]); + g[70] = g[66] * (zizj + c0z[2]); + g[71] = g[67] * (zizj + c0z[3]); +} + +static inline void _srg0_2d4d_2000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = 1; + g[13] = 1; + g[14] = 1; + g[15] = 1; + g[16] = c0y[0]; + g[17] = c0y[1]; + g[18] = c0y[2]; + g[19] = c0y[3]; + g[20] = c0y[0] * c0y[0] + b10[0]; + g[21] = c0y[1] * c0y[1] + b10[1]; + g[22] = c0y[2] * c0y[2] + b10[2]; + g[23] = c0y[3] * c0y[3] + b10[3]; + //g[24] = w[0]; + //g[25] = w[0]; + //g[26] = w[1]; + //g[27] = w[1]; + g[28] = c0z[0] * g[24]; + g[29] = c0z[1] * g[25]; + g[30] = c0z[2] * g[26]; + g[31] = c0z[3] * g[27]; + g[32] = c0z[0] * g[28] + b10[0] * g[24]; + g[33] = c0z[1] * g[29] + b10[1] * g[25]; + g[34] = c0z[2] * g[30] + b10[2] * g[26]; + g[35] = c0z[3] * g[31] + b10[3] * g[27]; +} + +static inline void _srg0_2d4d_2001(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = cpx[0]; + g[13] = cpx[1]; + g[14] = cpx[2]; + g[15] = cpx[3]; + g[16] = cpx[0] * c0x[0] + b00[0]; + g[17] = cpx[1] * c0x[1] + b00[1]; + g[18] = cpx[2] * c0x[2] + b00[2]; + g[19] = cpx[3] * c0x[3] + b00[3]; + g[20] = c0x[0] * (g[16] + b00[0]) + b10[0] * cpx[0]; + g[21] = c0x[1] * (g[17] + b00[1]) + b10[1] * cpx[1]; + g[22] = c0x[2] * (g[18] + b00[2]) + b10[2] * cpx[2]; + g[23] = c0x[3] * (g[19] + b00[3]) + b10[3] * cpx[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = c0y[0]; + g[29] = c0y[1]; + g[30] = c0y[2]; + g[31] = c0y[3]; + g[32] = c0y[0] * c0y[0] + b10[0]; + g[33] = c0y[1] * c0y[1] + b10[1]; + g[34] = c0y[2] * c0y[2] + b10[2]; + g[35] = c0y[3] * c0y[3] + b10[3]; + g[36] = cpy[0]; + g[37] = cpy[1]; + g[38] = cpy[2]; + g[39] = cpy[3]; + g[40] = cpy[0] * c0y[0] + b00[0]; + g[41] = cpy[1] * c0y[1] + b00[1]; + g[42] = cpy[2] * c0y[2] + b00[2]; + g[43] = cpy[3] * c0y[3] + b00[3]; + g[44] = c0y[0] * (g[40] + b00[0]) + b10[0] * cpy[0]; + g[45] = c0y[1] * (g[41] + b00[1]) + b10[1] * cpy[1]; + g[46] = c0y[2] * (g[42] + b00[2]) + b10[2] * cpy[2]; + g[47] = c0y[3] * (g[43] + b00[3]) + b10[3] * cpy[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = c0z[0] * g[48]; + g[53] = c0z[1] * g[49]; + g[54] = c0z[2] * g[50]; + g[55] = c0z[3] * g[51]; + g[56] = c0z[0] * g[52] + b10[0] * g[48]; + g[57] = c0z[1] * g[53] + b10[1] * g[49]; + g[58] = c0z[2] * g[54] + b10[2] * g[50]; + g[59] = c0z[3] * g[55] + b10[3] * g[51]; + g[60] = cpz[0] * g[48]; + g[61] = cpz[1] * g[49]; + g[62] = cpz[2] * g[50]; + g[63] = cpz[3] * g[51]; + g[64] = cpz[0] * g[52] + b00[0] * g[48]; + g[65] = cpz[1] * g[53] + b00[1] * g[49]; + g[66] = cpz[2] * g[54] + b00[2] * g[50]; + g[67] = cpz[3] * g[55] + b00[3] * g[51]; + g[68] = c0z[0] * g[64] + b10[0] * g[60] + b00[0] * g[52]; + g[69] = c0z[1] * g[65] + b10[1] * g[61] + b00[1] * g[53]; + g[70] = c0z[2] * g[66] + b10[2] * g[62] + b00[2] * g[54]; + g[71] = c0z[3] * g[67] + b10[3] * g[63] + b00[3] * g[55]; +} + +static inline void _srg0_2d4d_2010(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *cpx = bc->c0px; + double *cpy = bc->c0py; + double *cpz = bc->c0pz; + double *b00 = bc->b00; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = cpx[0]; + g[13] = cpx[1]; + g[14] = cpx[2]; + g[15] = cpx[3]; + g[16] = cpx[0] * c0x[0] + b00[0]; + g[17] = cpx[1] * c0x[1] + b00[1]; + g[18] = cpx[2] * c0x[2] + b00[2]; + g[19] = cpx[3] * c0x[3] + b00[3]; + g[20] = c0x[0] * (g[16] + b00[0]) + b10[0] * cpx[0]; + g[21] = c0x[1] * (g[17] + b00[1]) + b10[1] * cpx[1]; + g[22] = c0x[2] * (g[18] + b00[2]) + b10[2] * cpx[2]; + g[23] = c0x[3] * (g[19] + b00[3]) + b10[3] * cpx[3]; + g[24] = 1; + g[25] = 1; + g[26] = 1; + g[27] = 1; + g[28] = c0y[0]; + g[29] = c0y[1]; + g[30] = c0y[2]; + g[31] = c0y[3]; + g[32] = c0y[0] * c0y[0] + b10[0]; + g[33] = c0y[1] * c0y[1] + b10[1]; + g[34] = c0y[2] * c0y[2] + b10[2]; + g[35] = c0y[3] * c0y[3] + b10[3]; + g[36] = cpy[0]; + g[37] = cpy[1]; + g[38] = cpy[2]; + g[39] = cpy[3]; + g[40] = cpy[0] * c0y[0] + b00[0]; + g[41] = cpy[1] * c0y[1] + b00[1]; + g[42] = cpy[2] * c0y[2] + b00[2]; + g[43] = cpy[3] * c0y[3] + b00[3]; + g[44] = c0y[0] * (g[40] + b00[0]) + b10[0] * cpy[0]; + g[45] = c0y[1] * (g[41] + b00[1]) + b10[1] * cpy[1]; + g[46] = c0y[2] * (g[42] + b00[2]) + b10[2] * cpy[2]; + g[47] = c0y[3] * (g[43] + b00[3]) + b10[3] * cpy[3]; + //g[48] = w[0]; + //g[49] = w[0]; + //g[50] = w[1]; + //g[51] = w[1]; + g[52] = c0z[0] * g[48]; + g[53] = c0z[1] * g[49]; + g[54] = c0z[2] * g[50]; + g[55] = c0z[3] * g[51]; + g[56] = c0z[0] * g[52] + b10[0] * g[48]; + g[57] = c0z[1] * g[53] + b10[1] * g[49]; + g[58] = c0z[2] * g[54] + b10[2] * g[50]; + g[59] = c0z[3] * g[55] + b10[3] * g[51]; + g[60] = cpz[0] * g[48]; + g[61] = cpz[1] * g[49]; + g[62] = cpz[2] * g[50]; + g[63] = cpz[3] * g[51]; + g[64] = cpz[0] * g[52] + b00[0] * g[48]; + g[65] = cpz[1] * g[53] + b00[1] * g[49]; + g[66] = cpz[2] * g[54] + b00[2] * g[50]; + g[67] = cpz[3] * g[55] + b00[3] * g[51]; + g[68] = c0z[0] * g[64] + b10[0] * g[60] + b00[0] * g[52]; + g[69] = c0z[1] * g[65] + b10[1] * g[61] + b00[1] * g[53]; + g[70] = c0z[2] * g[66] + b10[2] * g[62] + b00[2] * g[54]; + g[71] = c0z[3] * g[67] + b10[3] * g[63] + b00[3] * g[55]; +} + +static inline void _srg0_2d4d_2100(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + double xixj = envs->rirj[0]; + double yiyj = envs->rirj[1]; + double zizj = envs->rirj[2]; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[24] = g[8] * (xixj + c0x[0]) + c0x[0] * 2 * b10[0]; + g[25] = g[9] * (xixj + c0x[1]) + c0x[1] * 2 * b10[1]; + g[26] = g[10] * (xixj + c0x[2]) + c0x[2] * 2 * b10[2]; + g[27] = g[11] * (xixj + c0x[3]) + c0x[3] * 2 * b10[3]; + g[20] = c0x[0] * (xixj + c0x[0]) + b10[0]; + g[21] = c0x[1] * (xixj + c0x[1]) + b10[1]; + g[22] = c0x[2] * (xixj + c0x[2]) + b10[2]; + g[23] = c0x[3] * (xixj + c0x[3]) + b10[3]; + g[16] = xixj + c0x[0]; + g[17] = xixj + c0x[1]; + g[18] = xixj + c0x[2]; + g[19] = xixj + c0x[3]; + g[32] = 1; + g[33] = 1; + g[34] = 1; + g[35] = 1; + g[36] = c0y[0]; + g[37] = c0y[1]; + g[38] = c0y[2]; + g[39] = c0y[3]; + g[40] = c0y[0] * c0y[0] + b10[0]; + g[41] = c0y[1] * c0y[1] + b10[1]; + g[42] = c0y[2] * c0y[2] + b10[2]; + g[43] = c0y[3] * c0y[3] + b10[3]; + g[56] = g[40] * (yiyj + c0y[0]) + c0y[0] * 2 * b10[0]; + g[57] = g[41] * (yiyj + c0y[1]) + c0y[1] * 2 * b10[1]; + g[58] = g[42] * (yiyj + c0y[2]) + c0y[2] * 2 * b10[2]; + g[59] = g[43] * (yiyj + c0y[3]) + c0y[3] * 2 * b10[3]; + g[52] = c0y[0] * (yiyj + c0y[0]) + b10[0]; + g[53] = c0y[1] * (yiyj + c0y[1]) + b10[1]; + g[54] = c0y[2] * (yiyj + c0y[2]) + b10[2]; + g[55] = c0y[3] * (yiyj + c0y[3]) + b10[3]; + g[48] = yiyj + c0y[0]; + g[49] = yiyj + c0y[1]; + g[50] = yiyj + c0y[2]; + g[51] = yiyj + c0y[3]; + //g[64] = w[0]; + //g[65] = w[0]; + //g[66] = w[1]; + //g[67] = w[1]; + g[68] = c0z[0] * g[64]; + g[69] = c0z[1] * g[65]; + g[70] = c0z[2] * g[66]; + g[71] = c0z[3] * g[67]; + g[72] = c0z[0] * g[68] + b10[0] * g[64]; + g[73] = c0z[1] * g[69] + b10[1] * g[65]; + g[74] = c0z[2] * g[70] + b10[2] * g[66]; + g[75] = c0z[3] * g[71] + b10[3] * g[67]; + g[88] = g[72] * (zizj + c0z[0]) + 2 * b10[0] * g[68]; + g[89] = g[73] * (zizj + c0z[1]) + 2 * b10[1] * g[69]; + g[90] = g[74] * (zizj + c0z[2]) + 2 * b10[2] * g[70]; + g[91] = g[75] * (zizj + c0z[3]) + 2 * b10[3] * g[71]; + g[84] = g[68] * (zizj + c0z[0]) + b10[0] * g[64]; + g[85] = g[69] * (zizj + c0z[1]) + b10[1] * g[65]; + g[86] = g[70] * (zizj + c0z[2]) + b10[2] * g[66]; + g[87] = g[71] * (zizj + c0z[3]) + b10[3] * g[67]; + g[80] = g[64] * (zizj + c0z[0]); + g[81] = g[65] * (zizj + c0z[1]); + g[82] = g[66] * (zizj + c0z[2]); + g[83] = g[67] * (zizj + c0z[3]); +} + +static inline void _srg0_2d4d_3000(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + double *c0x = bc->c00x; + double *c0y = bc->c00y; + double *c0z = bc->c00z; + double *b10 = bc->b10; + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] = c0x[0]; + g[5] = c0x[1]; + g[6] = c0x[2]; + g[7] = c0x[3]; + g[8] = c0x[0] * c0x[0] + b10[0]; + g[9] = c0x[1] * c0x[1] + b10[1]; + g[10] = c0x[2] * c0x[2] + b10[2]; + g[11] = c0x[3] * c0x[3] + b10[3]; + g[12] = c0x[0] * (g[8] + 2 * b10[0]); + g[13] = c0x[1] * (g[9] + 2 * b10[1]); + g[14] = c0x[2] * (g[10] + 2 * b10[2]); + g[15] = c0x[3] * (g[11] + 2 * b10[3]); + g[16] = 1; + g[17] = 1; + g[18] = 1; + g[19] = 1; + g[20] = c0y[0]; + g[21] = c0y[1]; + g[22] = c0y[2]; + g[23] = c0y[3]; + g[24] = c0y[0] * c0y[0] + b10[0]; + g[25] = c0y[1] * c0y[1] + b10[1]; + g[26] = c0y[2] * c0y[2] + b10[2]; + g[27] = c0y[3] * c0y[3] + b10[3]; + g[28] = c0y[0] * (g[24] + 2 * b10[0]); + g[29] = c0y[1] * (g[25] + 2 * b10[1]); + g[30] = c0y[2] * (g[26] + 2 * b10[2]); + g[31] = c0y[3] * (g[27] + 2 * b10[3]); + //g[32] = w[0]; + //g[33] = w[0]; + //g[34] = w[1]; + //g[35] = w[1]; + g[36] = c0z[0] * g[32]; + g[37] = c0z[1] * g[33]; + g[38] = c0z[2] * g[34]; + g[39] = c0z[3] * g[35]; + g[40] = c0z[0] * g[36] + b10[0] * g[32]; + g[41] = c0z[1] * g[37] + b10[1] * g[33]; + g[42] = c0z[2] * g[38] + b10[2] * g[34]; + g[43] = c0z[3] * g[39] + b10[3] * g[35]; + g[44] = c0z[0] * g[40] + 2 * b10[0] * g[36]; + g[45] = c0z[1] * g[41] + 2 * b10[1] * g[37]; + g[46] = c0z[2] * g[42] + 2 * b10[2] * g[38]; + g[47] = c0z[3] * g[43] + 2 * b10[3] * g[39]; +} + +void CINTsrg0_2e_2d4d_unrolled(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) +{ + int type_ijkl = ((envs->li_ceil << 6) | (envs->lj_ceil << 4) | + (envs->lk_ceil << 2) | (envs->ll_ceil)); + switch (type_ijkl) { + case 0b00000000: _srg0_2d4d_0000(g, bc, envs); return; + case 0b00000001: _srg0_2d4d_0001(g, bc, envs); return; + case 0b00000010: _srg0_2d4d_0002(g, bc, envs); return; + case 0b00000011: _srg0_2d4d_0003(g, bc, envs); return; + case 0b00000100: _srg0_2d4d_0010(g, bc, envs); return; + case 0b00000101: _srg0_2d4d_0011(g, bc, envs); return; + case 0b00000110: _srg0_2d4d_0012(g, bc, envs); return; + case 0b00001000: _srg0_2d4d_0020(g, bc, envs); return; + case 0b00001001: _srg0_2d4d_0021(g, bc, envs); return; + case 0b00001100: _srg0_2d4d_0030(g, bc, envs); return; + case 0b00010000: _srg0_2d4d_0100(g, bc, envs); return; + case 0b00010001: _srg0_2d4d_0101(g, bc, envs); return; + case 0b00010010: _srg0_2d4d_0102(g, bc, envs); return; + case 0b00010100: _srg0_2d4d_0110(g, bc, envs); return; + case 0b00010101: _srg0_2d4d_0111(g, bc, envs); return; + case 0b00011000: _srg0_2d4d_0120(g, bc, envs); return; + case 0b00100000: _srg0_2d4d_0200(g, bc, envs); return; + case 0b00100001: _srg0_2d4d_0201(g, bc, envs); return; + case 0b00100100: _srg0_2d4d_0210(g, bc, envs); return; + case 0b00110000: _srg0_2d4d_0300(g, bc, envs); return; + case 0b01000000: _srg0_2d4d_1000(g, bc, envs); return; + case 0b01000001: _srg0_2d4d_1001(g, bc, envs); return; + case 0b01000010: _srg0_2d4d_1002(g, bc, envs); return; + case 0b01000100: _srg0_2d4d_1010(g, bc, envs); return; + case 0b01000101: _srg0_2d4d_1011(g, bc, envs); return; + case 0b01001000: _srg0_2d4d_1020(g, bc, envs); return; + case 0b01010000: _srg0_2d4d_1100(g, bc, envs); return; + case 0b01010001: _srg0_2d4d_1101(g, bc, envs); return; + case 0b01010100: _srg0_2d4d_1110(g, bc, envs); return; + case 0b01100000: _srg0_2d4d_1200(g, bc, envs); return; + case 0b10000000: _srg0_2d4d_2000(g, bc, envs); return; + case 0b10000001: _srg0_2d4d_2001(g, bc, envs); return; + case 0b10000100: _srg0_2d4d_2010(g, bc, envs); return; + case 0b10010000: _srg0_2d4d_2100(g, bc, envs); return; + case 0b11000000: _srg0_2d4d_3000(g, bc, envs); return; + } + fprintf(stderr, "Dimension error for CINTg0_2e_lj2d4d: iklj = %d %d %d %d", + (int)envs->li_ceil, (int)envs->lk_ceil, + (int)envs->ll_ceil, (int)envs->lj_ceil); +} + +void CINTg0_2e_lj2d4d(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { CINTg0_2e_2d(g, bc, envs); CINTg0_lj2d_4d(g, envs); } -void CINTg0_2e_kj2d4d(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_kj2d4d(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { CINTg0_2e_2d(g, bc, envs); CINTg0_kj2d_4d(g, envs); } -void CINTg0_2e_ik2d4d(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_ik2d4d(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { CINTg0_2e_2d(g, bc, envs); CINTg0_ik2d_4d(g, envs); } -void CINTg0_2e_il2d4d(double *restrict g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_il2d4d(double *restrict g, Rys2eT *bc, CINTEnvVars *envs) { CINTg0_2e_2d(g, bc, envs); CINTg0_il2d_4d(g, envs); @@ -1982,28 +4438,47 @@ FINT CINTg0_2e(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars * a1 = aij * akl; a0 = a1 / (aij + akl); - -#ifdef WITH_RANGE_COULOMB + fac1 = sqrt(a0 / (a1 * a1 * a1)) * envs->fac[0]; + x = a0 * rr; const double omega = envs->env[PTR_RANGE_OMEGA]; double theta = 0; if (omega == 0.) { - x = a0 * rr; CINTrys_roots(nroots, x, u, w); } else if (omega < 0.) { // short-range part of range-separated Coulomb theta = omega * omega / (omega * omega + a0); - x = a0 * rr; // very small erfc() leads to ~0 weights. They can cause - // numerical issue in sr_rys_roots + // numerical issue in sr_rys_roots. if (theta * x > cutoff || theta * x > EXPCUTOFF_SR) { return 0; } - CINTsr_rys_roots(nroots, x, sqrt(theta), u, w); + int rorder = envs->rys_order; + if (rorder == nroots) { + CINTsr_rys_roots(nroots, x, sqrt(theta), u, w); + } else { + double sqrt_theta = -sqrt(theta); + CINTrys_roots(rorder, x, u, w); + CINTrys_roots(rorder, theta*x, u+rorder, w+rorder); + if (envs->g_size == 2) { + g[0] = 1; + g[1] = 1; + g[2] = 1; + g[3] = 1; + g[4] *= fac1; + g[5] *= fac1 * sqrt_theta; + return 1; + } + for (irys = rorder; irys < nroots; irys++) { + double ut = u[irys] * theta; + u[irys] = ut / (u[irys]+1.-ut); + w[irys] *= sqrt_theta; + } + } } else { // omega > 0. // long-range part of range-separated Coulomb theta = omega * omega / (omega * omega + a0); - a0 *= theta; - x = a0 * rr; + x *= theta; + fac1 *= sqrt(theta); CINTrys_roots(nroots, x, u, w); /* u[:] = tau^2 / (1 - tau^2) * omega^2u^2 = a0 * tau^2 / (theta^-1 - tau^2) @@ -2011,14 +4486,10 @@ FINT CINTg0_2e(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars * * so the rest code can be reused. */ for (irys = 0; irys < nroots; irys++) { - u[irys] /= u[irys] + 1 - u[irys] * theta; + double ut = u[irys] * theta; + u[irys] = ut / (u[irys]+1.-ut); } } -#else - x = a0 * rr; - CINTrys_roots(nroots, x, u, w); -#endif - fac1 = sqrt(a0 / (a1 * a1 * a1)) * envs->fac[0]; if (envs->g_size == 1) { g[0] = 1; g[1] = 1; @@ -2027,22 +4498,24 @@ FINT CINTg0_2e(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars * } double u2, tmp1, tmp2, tmp3, tmp4, tmp5; - double rijrx[3]; - double rklrx[3]; - rijrx[0] = rij[0] - envs->rx_in_rijrx[0]; - rijrx[1] = rij[1] - envs->rx_in_rijrx[1]; - rijrx[2] = rij[2] - envs->rx_in_rijrx[2]; - rklrx[0] = rkl[0] - envs->rx_in_rklrx[0]; - rklrx[1] = rkl[1] - envs->rx_in_rklrx[1]; - rklrx[2] = rkl[2] - envs->rx_in_rklrx[2]; - struct _BC bc; - double *c00 = bc.c00; - double *c0p = bc.c0p; + double rijrx = rij[0] - envs->rx_in_rijrx[0]; + double rijry = rij[1] - envs->rx_in_rijrx[1]; + double rijrz = rij[2] - envs->rx_in_rijrx[2]; + double rklrx = rkl[0] - envs->rx_in_rklrx[0]; + double rklry = rkl[1] - envs->rx_in_rklrx[1]; + double rklrz = rkl[2] - envs->rx_in_rklrx[2]; + Rys2eT bc; double *b00 = bc.b00; double *b10 = bc.b10; double *b01 = bc.b01; + double *c00x = bc.c00x; + double *c00y = bc.c00y; + double *c00z = bc.c00z; + double *c0px = bc.c0px; + double *c0py = bc.c0py; + double *c0pz = bc.c0pz; - for (irys = 0; irys < nroots; irys++, c00+=3, c0p+=3) { + for (irys = 0; irys < nroots; irys++) { /* *u(irys) = t2/(1-t2) *t2 = u(irys)/(1+u(irys)) @@ -2057,12 +4530,12 @@ FINT CINTg0_2e(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars * b00[irys] = tmp5; b10[irys] = tmp5 + tmp4 * akl; b01[irys] = tmp5 + tmp4 * aij; - c00[0] = rijrx[0] - tmp2 * xij_kl; - c00[1] = rijrx[1] - tmp2 * yij_kl; - c00[2] = rijrx[2] - tmp2 * zij_kl; - c0p[0] = rklrx[0] + tmp3 * xij_kl; - c0p[1] = rklrx[1] + tmp3 * yij_kl; - c0p[2] = rklrx[2] + tmp3 * zij_kl; + c00x[irys] = rijrx - tmp2 * xij_kl; + c00y[irys] = rijry - tmp2 * yij_kl; + c00z[irys] = rijrz - tmp2 * zij_kl; + c0px[irys] = rklrx + tmp3 * xij_kl; + c0py[irys] = rklry + tmp3 * yij_kl; + c0pz[irys] = rklrz + tmp3 * zij_kl; w[irys] *= fac1; } diff --git a/src/g2e.h b/src/g2e.h index 780f3d44..49ae6220 100644 --- a/src/g2e.h +++ b/src/g2e.h @@ -7,15 +7,19 @@ #include "config.h" #include "g1e.h" -#ifndef HAVE_BC -#define HAVE_BC -struct _BC { - double c00[MXRYSROOTS*3]; - double c0p[MXRYSROOTS*3]; +#ifndef HAVE_RYS2E +#define HAVE_RYS2E +typedef struct { + double c00x[MXRYSROOTS]; + double c00y[MXRYSROOTS]; + double c00z[MXRYSROOTS]; + double c0px[MXRYSROOTS]; + double c0py[MXRYSROOTS]; + double c0pz[MXRYSROOTS]; double b01[MXRYSROOTS]; double b00[MXRYSROOTS]; double b10[MXRYSROOTS]; -}; +} Rys2eT; #endif void CINTg2e_index_xyz(FINT *idx, const CINTEnvVars *envs); @@ -28,13 +32,13 @@ void CINTinit_int2c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); FINT CINTg0_2e(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); -void CINTg0_2e_2d(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTg0_2e_2d4d_unrolled(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTsrg0_2e_2d4d_unrolled(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTg0_2e_lj2d4d(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTg0_2e_kj2d4d(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTg0_2e_il2d4d(double *g, struct _BC *bc, CINTEnvVars *envs); -void CINTg0_2e_ik2d4d(double *g, struct _BC *bc, CINTEnvVars *envs); +void CINTg0_2e_2d(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTg0_2e_2d4d_unrolled(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTsrg0_2e_2d4d_unrolled(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTg0_2e_lj2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTg0_2e_kj2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTg0_2e_il2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs); +void CINTg0_2e_ik2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs); void CINTg0_lj2d_4d(double *g, CINTEnvVars *envs); void CINTg0_kj2d_4d(double *g, CINTEnvVars *envs); @@ -80,15 +84,6 @@ void CINTinit_int2e_yp_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); #endif -#ifdef WITH_GTG -void CINTinit_int2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -void CINTinit_int3c2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -void CINTinit_int2c2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -#endif - #define G2E_D_I(f, g, li, lj, lk, ll) CINTnabla1i_2e(f, g, li, lj, lk, ll, envs) #define G2E_D_J(f, g, li, lj, lk, ll) CINTnabla1j_2e(f, g, li, lj, lk, ll, envs) diff --git a/src/g2e_coulerf.c b/src/g2e_coulerf.c deleted file mode 100644 index 419bbf82..00000000 --- a/src/g2e_coulerf.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - * - * Attenuated coulomb operator erf(-w r_{12}) / r_{12} - */ - -#include -#include -#include -#include -#include "config.h" -#include "cint_bas.h" -#include "rys_roots.h" -#include "g2e.h" - -FINT CINTg0_2e_coulerf(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); - -void CINTinit_int2e_coulerf_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - CINTinit_int2e_EnvVars(envs, ng, shls, atm, natm, bas, nbas, env); - envs->f_g0_2e = &CINTg0_2e_coulerf; -} - -/* - * g[i,k,l,j] = < ik | lj > = ( i j | k l ) - */ -FINT CINTg0_2e_coulerf(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs) -{ - double aij = envs->ai[0] + envs->aj[0]; - double akl = envs->ak[0] + envs->al[0]; - double omega = envs->env[PTR_RANGE_OMEGA]; - double a0, a1, fac1, x; - double u[MXRYSROOTS]; - double *w = g + envs->g_size * 2; // ~ gz - double rijrkl[3]; - rijrkl[0] = rij[0] - rkl[0]; - rijrkl[1] = rij[1] - rkl[1]; - rijrkl[2] = rij[2] - rkl[2]; - - a1 = aij * akl; - a0 = a1 / (aij + akl); - - double theta = 0; - if (omega > 0) { -// For long-range part of range-separated Coulomb operator - theta = omega * omega / (omega * omega + a0); - a0 *= theta; - } - - fac1 = sqrt(a0 / (a1 * a1 * a1)) * envs->fac[0]; - x = a0 *(rijrkl[0] * rijrkl[0] - + rijrkl[1] * rijrkl[1] - + rijrkl[2] * rijrkl[2]); - CINTrys_roots(envs->nrys_roots, x, u, w); - if (envs->g_size == 1) { - g[0] = 1; - g[1] = 1; - g[2] *= fac1; - return 1; - } - - FINT irys; - if (omega > 0) { - /* u[:] = tau^2 / (1 - tau^2) - * transform u[:] to theta^-1 tau^2 / (theta^-1 - tau^2) - * so the rest code can be reused. - */ - for (irys = 0; irys < envs->nrys_roots; irys++) { - u[irys] /= u[irys] + 1 - u[irys] * theta; - } - } - - double u2, div, tmp1, tmp2, tmp3, tmp4; - double rijrx[3]; - double rklrx[3]; - rijrx[0] = rij[0] - envs->rx_in_rijrx[0]; - rijrx[1] = rij[1] - envs->rx_in_rijrx[1]; - rijrx[2] = rij[2] - envs->rx_in_rijrx[2]; - rklrx[0] = rkl[0] - envs->rx_in_rklrx[0]; - rklrx[1] = rkl[1] - envs->rx_in_rklrx[1]; - rklrx[2] = rkl[2] - envs->rx_in_rklrx[2]; - struct _BC bc; - double *c00 = bc.c00; - double *c0p = bc.c0p; - - for (irys = 0; irys < envs->nrys_roots; irys++, c00+=3, c0p+=3) { - /* - *t2 = u(irys)/(1+u(irys)) - *u2 = aij*akl/(aij+akl)*t2/(1-t2) - */ - u2 = a0 * u[irys]; - div = 1 / (u2 * (aij + akl) + a1); - tmp1 = u2 * div; - tmp2 = tmp1 * akl; - tmp3 = tmp1 * aij; - tmp4 = .5 * div; - bc.b00[irys] = 0.5 * tmp1; - bc.b10[irys] = bc.b00[irys] + tmp4 * akl; - bc.b01[irys] = bc.b00[irys] + tmp4 * aij; - c00[0] = rijrx[0] - tmp2 * rijrkl[0]; - c00[1] = rijrx[1] - tmp2 * rijrkl[1]; - c00[2] = rijrx[2] - tmp2 * rijrkl[2]; - c0p[0] = rklrx[0] + tmp3 * rijrkl[0]; - c0p[1] = rklrx[1] + tmp3 * rijrkl[1]; - c0p[2] = rklrx[2] + tmp3 * rijrkl[2]; - w[irys] *= fac1; - } - - (*envs->f_g0_2d4d)(g, &bc, envs); - return 1; -} diff --git a/src/g2e_f12.c b/src/g2e_f12.c index 2b38a80f..fcc892f5 100644 --- a/src/g2e_f12.c +++ b/src/g2e_f12.c @@ -16,7 +16,7 @@ FINT CINTg0_2e_stg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); FINT CINTg0_2e_yp(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); -void CINTg0_2e_stg_lj2d4d(double *g, struct _BC *bc, CINTEnvVars *envs); +void CINTg0_2e_stg_lj2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs); void CINTinit_int2e_yp_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) @@ -152,7 +152,7 @@ void CINTinit_int2e_stg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, } -void CINTg0_2e_stg_lj2d4d(double *g, struct _BC *bc, CINTEnvVars *envs) +void CINTg0_2e_stg_lj2d4d(double *g, Rys2eT *bc, CINTEnvVars *envs) { CINTg0_2e_2d(g, bc, envs); CINTg0_lj2d_4d(g, envs); @@ -162,12 +162,11 @@ FINT CINTg0_2e_yp(double *g, double *rij, double *rkl, double cutoff, CINTEnvVar { double aij, akl, a0, a1, fac1, x; double ua = 0; - double rijrkl[3]; double u[MXRYSROOTS]; double *w = g + envs->g_size * 2; // ~ gz double zeta = envs->env[PTR_F12_ZETA]; FINT nroots = envs->nrys_roots; - FINT i; + FINT irys; aij = envs->ai[0] + envs->aj[0]; akl = envs->ak[0] + envs->al[0]; @@ -181,12 +180,11 @@ FINT CINTg0_2e_yp(double *g, double *rij, double *rkl, double cutoff, CINTEnvVar ua = .25 * zeta * zeta / a0; } - rijrkl[0] = rij[0] - rkl[0]; - rijrkl[1] = rij[1] - rkl[1]; - rijrkl[2] = rij[2] - rkl[2]; - x = a0 *(rijrkl[0] * rijrkl[0] - + rijrkl[1] * rijrkl[1] - + rijrkl[2] * rijrkl[2]); + double xij_kl = rij[0] - rkl[0]; + double yij_kl = rij[1] - rkl[1]; + double zij_kl = rij[2] - rkl[2]; + double rr = xij_kl * xij_kl + yij_kl * yij_kl + zij_kl * zij_kl; + x = a0 * rr; if (zeta > 0) { CINTstg_roots(nroots, x, ua, u, w); } else { @@ -196,9 +194,9 @@ FINT CINTg0_2e_yp(double *g, double *rij, double *rkl, double cutoff, CINTEnvVar if (zeta > 0) { //:w *= t; //:u -> t/(1-t); - for (i = 0; i < nroots; i++) { - w[i] *= u[i]; - u[i] = u[i] / (1 - u[i]); + for (irys = 0; irys < nroots; irys++) { + w[irys] *= u[irys]; + u[irys] = u[irys] / (1 - u[irys]); } } @@ -209,41 +207,46 @@ FINT CINTg0_2e_yp(double *g, double *rij, double *rkl, double cutoff, CINTEnvVar return 1; } - double u2, div, tmp1, tmp2, tmp3, tmp4; - double rijrx[3]; - double rklrx[3]; - rijrx[0] = envs->rij[0] - envs->rx_in_rijrx[0]; - rijrx[1] = envs->rij[1] - envs->rx_in_rijrx[1]; - rijrx[2] = envs->rij[2] - envs->rx_in_rijrx[2]; - rklrx[0] = envs->rkl[0] - envs->rx_in_rklrx[0]; - rklrx[1] = envs->rkl[1] - envs->rx_in_rklrx[1]; - rklrx[2] = envs->rkl[2] - envs->rx_in_rklrx[2]; - struct _BC bc; - double *c00 = bc.c00; - double *c0p = bc.c0p; - - for (i = 0; i < nroots; i++, c00+=3, c0p+=3) { + double u2, tmp1, tmp2, tmp3, tmp4, tmp5; + double rijrx = rij[0] - envs->rx_in_rijrx[0]; + double rijry = rij[1] - envs->rx_in_rijrx[1]; + double rijrz = rij[2] - envs->rx_in_rijrx[2]; + double rklrx = rkl[0] - envs->rx_in_rklrx[0]; + double rklry = rkl[1] - envs->rx_in_rklrx[1]; + double rklrz = rkl[2] - envs->rx_in_rklrx[2]; + Rys2eT bc; + double *b00 = bc.b00; + double *b10 = bc.b10; + double *b01 = bc.b01; + double *c00x = bc.c00x; + double *c00y = bc.c00y; + double *c00z = bc.c00z; + double *c0px = bc.c0px; + double *c0py = bc.c0py; + double *c0pz = bc.c0pz; + + for (irys = 0; irys < nroots; irys++) { /* - *u(i) = t2/(1-t2) - *t2 = u(i)/(1+u(i)) + *u(irys) = t2/(1-t2) + *t2 = u(irys)/(1+u(irys)) *u2 = aij*akl/(aij+akl)*t2/(1-t2) */ - u2 = a0 * u[i]; - div = 1 / (u2 * (aij + akl) + a1); - tmp1 = u2 * div; + u2 = a0 * u[irys]; + tmp4 = .5 / (u2 * (aij + akl) + a1); + tmp5 = u2 * tmp4; + tmp1 = 2. * tmp5; tmp2 = tmp1 * akl; tmp3 = tmp1 * aij; - tmp4 = .5 * div; - bc.b00[i] = 0.5 * tmp1; - bc.b10[i] = bc.b00[i] + tmp4 * akl; - bc.b01[i] = bc.b00[i] + tmp4 * aij; - c00[0] = rijrx[0] - tmp2 * rijrkl[0]; - c00[1] = rijrx[1] - tmp2 * rijrkl[1]; - c00[2] = rijrx[2] - tmp2 * rijrkl[2]; - c0p[0] = rklrx[0] + tmp3 * rijrkl[0]; - c0p[1] = rklrx[1] + tmp3 * rijrkl[1]; - c0p[2] = rklrx[2] + tmp3 * rijrkl[2]; - w[i] *= fac1; + b00[irys] = tmp5; + b10[irys] = tmp5 + tmp4 * akl; + b01[irys] = tmp5 + tmp4 * aij; + c00x[irys] = rijrx - tmp2 * xij_kl; + c00y[irys] = rijry - tmp2 * yij_kl; + c00z[irys] = rijrz - tmp2 * zij_kl; + c0px[irys] = rklrx + tmp3 * xij_kl; + c0py[irys] = rklry + tmp3 * yij_kl; + c0pz[irys] = rklrz + tmp3 * zij_kl; + w[irys] *= fac1; } (*envs->f_g0_2d4d)(g, &bc, envs); @@ -255,12 +258,11 @@ FINT CINTg0_2e_stg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVa { double aij, akl, a0, a1, fac1, x; double ua = 0; - double rijrkl[3]; double u[MXRYSROOTS]; double *w = g + envs->g_size * 2; // ~ gz double zeta = envs->env[PTR_F12_ZETA]; FINT nroots = envs->nrys_roots; - FINT i; + FINT irys; aij = envs->ai[0] + envs->aj[0]; akl = envs->ak[0] + envs->al[0]; @@ -274,12 +276,11 @@ FINT CINTg0_2e_stg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVa ua = .25 * zeta * zeta / a0; } - rijrkl[0] = rij[0] - rkl[0]; - rijrkl[1] = rij[1] - rkl[1]; - rijrkl[2] = rij[2] - rkl[2]; - x = a0 *(rijrkl[0] * rijrkl[0] - + rijrkl[1] * rijrkl[1] - + rijrkl[2] * rijrkl[2]); + double xij_kl = rij[0] - rkl[0]; + double yij_kl = rij[1] - rkl[1]; + double zij_kl = rij[2] - rkl[2]; + double rr = xij_kl * xij_kl + yij_kl * yij_kl + zij_kl * zij_kl; + x = a0 * rr; if (zeta > 0) { CINTstg_roots(nroots, x, ua, u, w); } else { @@ -290,9 +291,9 @@ FINT CINTg0_2e_stg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVa //:w *= (1-t) * 2*ua/zeta; //:u -> t/(1-t); double ua2 = 2. * ua / zeta; - for (i = 0; i < nroots; i++) { - w[i] *= (1-u[i]) * ua2; - u[i] = u[i] / (1 - u[i]); + for (irys = 0; irys < nroots; irys++) { + w[irys] *= (1-u[irys]) * ua2; + u[irys] = u[irys] / (1 - u[irys]); } } @@ -303,41 +304,46 @@ FINT CINTg0_2e_stg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVa return 1; } - double u2, div, tmp1, tmp2, tmp3, tmp4; - double rijrx[3]; - double rklrx[3]; - rijrx[0] = envs->rij[0] - envs->rx_in_rijrx[0]; - rijrx[1] = envs->rij[1] - envs->rx_in_rijrx[1]; - rijrx[2] = envs->rij[2] - envs->rx_in_rijrx[2]; - rklrx[0] = envs->rkl[0] - envs->rx_in_rklrx[0]; - rklrx[1] = envs->rkl[1] - envs->rx_in_rklrx[1]; - rklrx[2] = envs->rkl[2] - envs->rx_in_rklrx[2]; - struct _BC bc; - double *c00 = bc.c00; - double *c0p = bc.c0p; - - for (i = 0; i < nroots; i++, c00+=3, c0p+=3) { + double u2, tmp1, tmp2, tmp3, tmp4, tmp5; + double rijrx = rij[0] - envs->rx_in_rijrx[0]; + double rijry = rij[1] - envs->rx_in_rijrx[1]; + double rijrz = rij[2] - envs->rx_in_rijrx[2]; + double rklrx = rkl[0] - envs->rx_in_rklrx[0]; + double rklry = rkl[1] - envs->rx_in_rklrx[1]; + double rklrz = rkl[2] - envs->rx_in_rklrx[2]; + Rys2eT bc; + double *b00 = bc.b00; + double *b10 = bc.b10; + double *b01 = bc.b01; + double *c00x = bc.c00x; + double *c00y = bc.c00y; + double *c00z = bc.c00z; + double *c0px = bc.c0px; + double *c0py = bc.c0py; + double *c0pz = bc.c0pz; + + for (irys = 0; irys < nroots; irys++) { /* - *u(i) = t2/(1-t2) - *t2 = u(i)/(1+u(i)) + *u(irys) = t2/(1-t2) + *t2 = u(irys)/(1+u(irys)) *u2 = aij*akl/(aij+akl)*t2/(1-t2) */ - u2 = a0 * u[i]; - div = 1 / (u2 * (aij + akl) + a1); - tmp1 = u2 * div; + u2 = a0 * u[irys]; + tmp4 = .5 / (u2 * (aij + akl) + a1); + tmp5 = u2 * tmp4; + tmp1 = 2. * tmp5; tmp2 = tmp1 * akl; tmp3 = tmp1 * aij; - tmp4 = .5 * div; - bc.b00[i] = 0.5 * tmp1; - bc.b10[i] = bc.b00[i] + tmp4 * akl; - bc.b01[i] = bc.b00[i] + tmp4 * aij; - c00[0] = rijrx[0] - tmp2 * rijrkl[0]; - c00[1] = rijrx[1] - tmp2 * rijrkl[1]; - c00[2] = rijrx[2] - tmp2 * rijrkl[2]; - c0p[0] = rklrx[0] + tmp3 * rijrkl[0]; - c0p[1] = rklrx[1] + tmp3 * rijrkl[1]; - c0p[2] = rklrx[2] + tmp3 * rijrkl[2]; - w[i] *= fac1; + b00[irys] = tmp5; + b10[irys] = tmp5 + tmp4 * akl; + b01[irys] = tmp5 + tmp4 * aij; + c00x[irys] = rijrx - tmp2 * xij_kl; + c00y[irys] = rijry - tmp2 * yij_kl; + c00z[irys] = rijrz - tmp2 * zij_kl; + c0px[irys] = rklrx + tmp3 * xij_kl; + c0py[irys] = rklry + tmp3 * yij_kl; + c0pz[irys] = rklrz + tmp3 * zij_kl; + w[irys] *= fac1; } (*envs->f_g0_2d4d)(g, &bc, envs); diff --git a/src/g2e_gtg.c b/src/g2e_gtg.c deleted file mode 100644 index d6f1254b..00000000 --- a/src/g2e_gtg.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2013- Qiming Sun - * - */ - -#include -#include -#include -#include -#include "config.h" -#include "cint_bas.h" -#include "misc.h" -#include "g2e.h" - -void CINTg0_2e_lj2d4d_regular(double *g, struct _BC *bc, const CINTEnvVars *envs); -FINT CINTg0_2e_gtg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); - -void CINTinit_int2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - envs->natm = natm; - envs->nbas = nbas; - envs->atm = atm; - envs->bas = bas; - envs->env = env; - envs->shls = shls; - - const FINT i_sh = shls[0]; - const FINT j_sh = shls[1]; - const FINT k_sh = shls[2]; - const FINT l_sh = shls[3]; - envs->i_l = bas(ANG_OF, i_sh); - envs->j_l = bas(ANG_OF, j_sh); - envs->k_l = bas(ANG_OF, k_sh); - envs->l_l = bas(ANG_OF, l_sh); - envs->x_ctr[0] = bas(NCTR_OF, i_sh); - envs->x_ctr[1] = bas(NCTR_OF, j_sh); - envs->x_ctr[2] = bas(NCTR_OF, k_sh); - envs->x_ctr[3] = bas(NCTR_OF, l_sh); - envs->nfi = (envs->i_l+1)*(envs->i_l+2)/2; - envs->nfj = (envs->j_l+1)*(envs->j_l+2)/2; - envs->nfk = (envs->k_l+1)*(envs->k_l+2)/2; - envs->nfl = (envs->l_l+1)*(envs->l_l+2)/2; - envs->nf = envs->nfi * envs->nfk * envs->nfl * envs->nfj; - - envs->ri = env + atm(PTR_COORD, bas(ATOM_OF, i_sh)); - envs->rj = env + atm(PTR_COORD, bas(ATOM_OF, j_sh)); - envs->rk = env + atm(PTR_COORD, bas(ATOM_OF, k_sh)); - envs->rl = env + atm(PTR_COORD, bas(ATOM_OF, l_sh)); - - envs->common_factor = (M_PI*M_PI*M_PI) - * CINTcommon_fac_sp(envs->i_l) * CINTcommon_fac_sp(envs->j_l) - * CINTcommon_fac_sp(envs->k_l) * CINTcommon_fac_sp(envs->l_l); - if (env[PTR_EXPCUTOFF] == 0) { - envs->expcutoff = EXPCUTOFF; - } else { - envs->expcutoff = MAX(MIN_EXPCUTOFF, env[PTR_EXPCUTOFF]); - } - - envs->gbits = ng[GSHIFT]; - envs->ncomp_e1 = ng[POS_E1]; - envs->ncomp_e2 = ng[POS_E2]; - envs->ncomp_tensor = ng[TENSOR]; - - envs->li_ceil = envs->i_l + ng[IINC]; - envs->lj_ceil = envs->j_l + ng[JINC]; - envs->lk_ceil = envs->k_l + ng[KINC]; - envs->ll_ceil = envs->l_l + ng[LINC]; - envs->nrys_roots = 1; - - assert(i_sh < SHLS_MAX); - assert(j_sh < SHLS_MAX); - assert(k_sh < SHLS_MAX); - assert(l_sh < SHLS_MAX); - assert(envs->i_l < ANG_MAX); - assert(envs->j_l < ANG_MAX); - assert(envs->k_l < ANG_MAX); - assert(envs->l_l < ANG_MAX); - assert(bas(ATOM_OF,i_sh) >= 0); - assert(bas(ATOM_OF,j_sh) >= 0); - assert(bas(ATOM_OF,k_sh) >= 0); - assert(bas(ATOM_OF,l_sh) >= 0); - assert(bas(ATOM_OF,i_sh) < natm); - assert(bas(ATOM_OF,j_sh) < natm); - assert(bas(ATOM_OF,k_sh) < natm); - assert(bas(ATOM_OF,l_sh) < natm); - assert(envs->nrys_roots < MXRYSROOTS); - - FINT dli, dlj, dlk, dll; - FINT ibase = envs->li_ceil > envs->lj_ceil; - FINT kbase = envs->lk_ceil > envs->ll_ceil; - - if (kbase) { - dlk = envs->lk_ceil + envs->ll_ceil + 1; - dll = envs->ll_ceil + 1; - } else { - dlk = envs->lk_ceil + 1; - dll = envs->lk_ceil + envs->ll_ceil + 1; - } - - if (ibase) { - dli = envs->li_ceil + envs->lj_ceil + 1; - dlj = envs->lj_ceil + 1; - } else { - dli = envs->li_ceil + 1; - dlj = envs->li_ceil + envs->lj_ceil + 1; - } - envs->g_stride_i = envs->nrys_roots; - envs->g_stride_k = envs->nrys_roots * dli; - envs->g_stride_l = envs->nrys_roots * dli * dlk; - envs->g_stride_j = envs->nrys_roots * dli * dlk * dll; - envs->g_size = envs->nrys_roots * dli * dlk * dll * dlj; - - if (kbase) { - envs->g2d_klmax = envs->g_stride_k; - envs->rx_in_rklrx = envs->rk; - envs->rkrl[0] = envs->rk[0] - envs->rl[0]; - envs->rkrl[1] = envs->rk[1] - envs->rl[1]; - envs->rkrl[2] = envs->rk[2] - envs->rl[2]; - } else { - envs->g2d_klmax = envs->g_stride_l; - envs->rx_in_rklrx = envs->rl; - envs->rkrl[0] = envs->rl[0] - envs->rk[0]; - envs->rkrl[1] = envs->rl[1] - envs->rk[1]; - envs->rkrl[2] = envs->rl[2] - envs->rk[2]; - } - - if (ibase) { - envs->g2d_ijmax = envs->g_stride_i; - envs->rx_in_rijrx = envs->ri; - envs->rirj[0] = envs->ri[0] - envs->rj[0]; - envs->rirj[1] = envs->ri[1] - envs->rj[1]; - envs->rirj[2] = envs->ri[2] - envs->rj[2]; - } else { - envs->g2d_ijmax = envs->g_stride_j; - envs->rx_in_rijrx = envs->rj; - envs->rirj[0] = envs->rj[0] - envs->ri[0]; - envs->rirj[1] = envs->rj[1] - envs->ri[1]; - envs->rirj[2] = envs->rj[2] - envs->ri[2]; - } - - if (kbase) { - if (ibase) { - envs->f_g0_2d4d = &CINTg0_2e_ik2d4d; - } else { - envs->f_g0_2d4d = &CINTg0_2e_kj2d4d; - } - } else { - if (ibase) { - envs->f_g0_2d4d = &CINTg0_2e_il2d4d; - } else { - envs->f_g0_2d4d = &CINTg0_2e_lj2d4d_regular; - } - } - envs->f_g0_2e = &CINTg0_2e_gtg; -} - - -void CINTg0_2e_lj2d4d_regular(double *g, struct _BC *bc, const CINTEnvVars *envs) -{ - CINTg0_2e_2d(g, bc, envs); - CINTg0_lj2d_4d(g, envs); - return; -} - -/* - * g[i,k,l,j] = < ik | lj > = ( i j | k l ) - */ -FINT CINTg0_2e_gtg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs) -{ - double aij = envs->ai[0] + envs->aj[0]; - double akl = envs->ak[0] + envs->al[0]; - double *env = envs->env; - double zeta = env[PTR_GTG_ZETA]; - double a0, a1, fac1, x, t; - double *gz = g + envs->g_size * 2; - double rijrkl[3]; - rijrkl[0] = envs->rij[0] - envs->rkl[0]; - rijrkl[1] = envs->rij[1] - envs->rkl[1]; - rijrkl[2] = envs->rij[2] - envs->rkl[2]; - - a1 = aij * akl; - a0 = a1 / (aij + akl); - t = zeta / (zeta + a0); - x = a0 *(rijrkl[0] * rijrkl[0] - + rijrkl[1] * rijrkl[1] - + rijrkl[2] * rijrkl[2]); - fac1 = (1-t) / a1; - gz[0] = fac1*sqrt(fac1) * exp(-t * x) * envs->fac[0]; - if (envs->g_size == 1) { - g[0] = 1; - g[1] = 1; - return 1; - } - - double div, tmp1, tmp2, tmp3, tmp4; - double rijrx[3]; - double rklrx[3]; - rijrx[0] = envs->rij[0] - envs->rx_in_rijrx[0]; - rijrx[1] = envs->rij[1] - envs->rx_in_rijrx[1]; - rijrx[2] = envs->rij[2] - envs->rx_in_rijrx[2]; - rklrx[0] = envs->rkl[0] - envs->rx_in_rklrx[0]; - rklrx[1] = envs->rkl[1] - envs->rx_in_rklrx[1]; - rklrx[2] = envs->rkl[2] - envs->rx_in_rklrx[2]; - struct _BC bc; - double *c00 = bc.c00; - double *c0p = bc.c0p; - double *b00 = bc.b00; - double *b10 = bc.b10; - double *b01 = bc.b01; - - div = 1 / (zeta * (aij + akl) + a1); - tmp1 = zeta * div; - tmp2 = tmp1 * akl; - tmp3 = tmp1 * aij; - tmp4 = .5 * div; - b00[0] = 0.5 * tmp1; - b10[0] = b00[0] + tmp4 * akl; - b01[0] = b00[0] + tmp4 * aij; - c00[0] = rijrx[0] - tmp2 * rijrkl[0]; - c00[1] = rijrx[1] - tmp2 * rijrkl[1]; - c00[2] = rijrx[2] - tmp2 * rijrkl[2]; - c0p[0] = rklrx[0] + tmp3 * rijrkl[0]; - c0p[1] = rklrx[1] + tmp3 * rijrkl[1]; - c0p[2] = rklrx[2] + tmp3 * rijrkl[2]; - - (*envs->f_g0_2d4d)(g, &bc, envs); - return 1; -} - diff --git a/src/g3c2e.c b/src/g3c2e.c index 914d0fd4..57473fdc 100644 --- a/src/g3c2e.c +++ b/src/g3c2e.c @@ -67,7 +67,13 @@ void CINTinit_int3c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->lj_ceil = envs->j_l + ng[JINC]; envs->lk_ceil = 0; // to reuse CINTg0_2e_lj2d4d envs->ll_ceil = envs->k_l + ng[KINC]; - int nrys_roots =(envs->li_ceil + envs->lj_ceil + envs->ll_ceil)/2 + 1; + int rys_order =(envs->li_ceil + envs->lj_ceil + envs->ll_ceil)/2 + 1; + int nrys_roots = rys_order; + double omega = env[PTR_RANGE_OMEGA]; + if (omega < 0 && rys_order <= 3) { + nrys_roots *= 2; + } + envs->rys_order = rys_order; envs->nrys_roots = nrys_roots; FINT dli, dlj, dlk; @@ -112,8 +118,11 @@ void CINTinit_int3c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, envs->rirj[2] = envs->rj[2] - envs->ri[2]; } - if (nrys_roots <= 2) { + if (rys_order <= 2) { envs->f_g0_2d4d = &CINTg0_2e_2d4d_unrolled; + if (rys_order != nrys_roots) { + envs->f_g0_2d4d = &CINTsrg0_2e_2d4d_unrolled; + } } else if (ibase) { envs->f_g0_2d4d = &CINTg0_2e_il2d4d; } else { @@ -121,112 +130,3 @@ void CINTinit_int3c2e_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, } envs->f_g0_2e = &CINTg0_2e; } - - -#ifdef WITH_GTG -void CINTg0_2e_lj2d4d_regular(double *g, struct _BC *bc, const CINTEnvVars *envs); -FINT CINTg0_2e_gtg(double *g, double *rij, double *rkl, double cutoff, CINTEnvVars *envs); - -void CINTinit_int3c2e_gtg_EnvVars(CINTEnvVars *envs, FINT *ng, FINT *shls, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - envs->natm = natm; - envs->nbas = nbas; - envs->atm = atm; - envs->bas = bas; - envs->env = env; - envs->shls = shls; - - const FINT i_sh = shls[0]; - const FINT j_sh = shls[1]; - const FINT k_sh = shls[2]; - envs->i_l = bas(ANG_OF, i_sh); - envs->j_l = bas(ANG_OF, j_sh); - envs->k_l = bas(ANG_OF, k_sh); - envs->l_l = 0; - envs->x_ctr[0] = bas(NCTR_OF, i_sh); - envs->x_ctr[1] = bas(NCTR_OF, j_sh); - envs->x_ctr[2] = bas(NCTR_OF, k_sh); - envs->x_ctr[3] = 1; - envs->nfi = (envs->i_l+1)*(envs->i_l+2)/2; - envs->nfj = (envs->j_l+1)*(envs->j_l+2)/2; - envs->nfk = (envs->k_l+1)*(envs->k_l+2)/2; - envs->nfl = 1; - envs->nf = envs->nfi * envs->nfk * envs->nfj; - - envs->ri = env + atm(PTR_COORD, bas(ATOM_OF, i_sh)); - envs->rj = env + atm(PTR_COORD, bas(ATOM_OF, j_sh)); - envs->rk = env + atm(PTR_COORD, bas(ATOM_OF, k_sh)); - - envs->common_factor = (M_PI*M_PI*M_PI) - * CINTcommon_fac_sp(envs->i_l) * CINTcommon_fac_sp(envs->j_l) - * CINTcommon_fac_sp(envs->k_l); - if (env[PTR_EXPCUTOFF] == 0) { - envs->expcutoff = EXPCUTOFF; - } else { - // +1 to ensure accuracy. See comments in function CINT2e_loop_nopt - envs->expcutoff = MAX(MIN_EXPCUTOFF, env[PTR_EXPCUTOFF]) + 1; - } - - envs->gbits = ng[GSHIFT]; - envs->ncomp_e1 = ng[POS_E1]; - envs->ncomp_e2 = ng[POS_E2]; - envs->ncomp_tensor = ng[TENSOR]; - - envs->li_ceil = envs->i_l + ng[IINC]; - envs->lj_ceil = envs->j_l + ng[JINC]; - envs->lk_ceil = 0; // to reuse CINTg0_2e_lj2d4d - envs->ll_ceil = envs->k_l + ng[KINC]; - envs->nrys_roots = 1; - - FINT dli, dlj, dlk; - FINT ibase = envs->li_ceil > envs->lj_ceil; - - if (ibase) { - dli = envs->li_ceil + envs->lj_ceil + 1; - dlj = envs->lj_ceil + 1; - } else { - dli = envs->li_ceil + 1; - dlj = envs->li_ceil + envs->lj_ceil + 1; - } - dlk = envs->ll_ceil + 1; - - envs->g_stride_i = envs->nrys_roots; - envs->g_stride_k = envs->nrys_roots * dli; - envs->g_stride_l = envs->nrys_roots * dli; - envs->g_stride_j = envs->nrys_roots * dli * dlk; - envs->g_size = envs->nrys_roots * dli * dlk * dlj; - - envs->al[0] = 0; - envs->rkl[0] = envs->rk[0]; - envs->rkl[1] = envs->rk[1]; - envs->rkl[2] = envs->rk[2]; - envs->g2d_klmax = envs->g_stride_k; - envs->rkrl[0] = envs->rk[0]; - envs->rkrl[1] = envs->rk[1]; - envs->rkrl[2] = envs->rk[2]; - // in g0_2d rklrx = rkl - rx = 0 => rkl = rx - envs->rx_in_rklrx = envs->rk; - - if (ibase) { - envs->g2d_ijmax = envs->g_stride_i; - envs->rx_in_rijrx = envs->ri; - envs->rirj[0] = envs->ri[0] - envs->rj[0]; - envs->rirj[1] = envs->ri[1] - envs->rj[1]; - envs->rirj[2] = envs->ri[2] - envs->rj[2]; - } else { - envs->g2d_ijmax = envs->g_stride_j; - envs->rx_in_rijrx = envs->rj; - envs->rirj[0] = envs->rj[0] - envs->ri[0]; - envs->rirj[1] = envs->rj[1] - envs->ri[1]; - envs->rirj[2] = envs->rj[2] - envs->ri[2]; - } - - if (ibase) { - envs->f_g0_2d4d = &CINTg0_2e_il2d4d; - } else { - envs->f_g0_2d4d = &CINTg0_2e_lj2d4d_regular; - } - envs->f_g0_2e = &CINTg0_2e_gtg; -} -#endif diff --git a/src/optimizer.c b/src/optimizer.c index b461964a..3baf843a 100644 --- a/src/optimizer.c +++ b/src/optimizer.c @@ -245,38 +245,6 @@ void CINTall_2e_stg_optimizer(CINTOpt **opt, FINT *ng, } #endif -#ifdef WITH_GTG -void CINTall_2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - CINTinit_2e_optimizer(opt, atm, natm, bas, nbas, env); - CINTOpt_setij(*opt, ng, atm, natm, bas, nbas, env); - CINTOpt_set_non0coeff(*opt, atm, natm, bas, nbas, env); - gen_idx(*opt, &CINTinit_int2e_gtg_EnvVars, &CINTg2e_index_xyz, - 4, 6, ng, atm, natm, bas, nbas, env); -} - -void CINTall_3c2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - CINTinit_2e_optimizer(opt, atm, natm, bas, nbas, env); - CINTOpt_setij(*opt, ng, atm, natm, bas, nbas, env); - CINTOpt_set_non0coeff(*opt, atm, natm, bas, nbas, env); - gen_idx(*opt, &CINTinit_int3c2e_gtg_EnvVars, &CINTg2e_index_xyz, - 3, 12, ng, atm, natm, bas, nbas, env); -} - -void CINTall_2c2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env) -{ - CINTinit_2e_optimizer(opt, atm, natm, bas, nbas, env); - CINTOpt_set_log_maxc(*opt, atm, natm, bas, nbas, env); - CINTOpt_set_non0coeff(*opt, atm, natm, bas, nbas, env); - gen_idx(*opt, &CINTinit_int2c2e_gtg_EnvVars, &CINTg1e_index_xyz, - 2, ANG_MAX, ng, atm, natm, bas, nbas, env); -} -#endif - void CINTOpt_log_max_pgto_coeff(double *log_maxc, double *coeff, FINT nprim, FINT nctr) { FINT i, ip; @@ -332,10 +300,9 @@ FINT CINTset_pairdata(PairData *pairdata, double *ai, double *aj, double *ri, do // <~ (d+1/sqrt(aij))^(li+lj) * (pi/aij)^1.5 aij = ai[iprim-1] + aj[jprim-1]; double log_rr_ij = 1.7 - 1.5 * approx_log(aij); - double dist_ij = sqrt(rr_ij); int lij = li_ceil + lj_ceil; if (lij > 0) { -#ifdef WITH_RANGE_COULOMB + double dist_ij = sqrt(rr_ij); double omega = env[PTR_RANGE_OMEGA]; if (omega < 0) { double r_guess = 8.; @@ -345,9 +312,6 @@ FINT CINTset_pairdata(PairData *pairdata, double *ai, double *aj, double *ri, do } else { log_rr_ij += lij * approx_log(dist_ij + 1.); } -#else - log_rr_ij += lij * approx_log(dist_ij + 1.); -#endif } PairData *pdata; diff --git a/src/optimizer.h b/src/optimizer.h index ebe187fe..495dae4d 100644 --- a/src/optimizer.h +++ b/src/optimizer.h @@ -58,15 +58,6 @@ void CINTall_2e_stg_optimizer(CINTOpt **opt, FINT *ng, FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); #endif -#ifdef WITH_GTG -void CINTall_2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -void CINTall_3c2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -void CINTall_2c2e_gtg_optimizer(CINTOpt **opt, FINT *ng, - FINT *atm, FINT natm, FINT *bas, FINT nbas, double *env); -#endif - #ifndef HAVE_DEFINED_APPROX_LOG #define HAVE_DEFINED_APPROX_LOG #ifdef __X86__ diff --git a/src/rys_roots.c b/src/rys_roots.c index 7ca833e3..45cf7c8c 100644 --- a/src/rys_roots.c +++ b/src/rys_roots.c @@ -121,7 +121,6 @@ void CINTrys_roots(int nroots, double x, double *u, double *w) } } -#ifdef WITH_RANGE_COULOMB /* * lower is the lower bound of the sr integral */ @@ -266,7 +265,6 @@ void CINTsr_rys_roots(int nroots, double x, double lower, double *u, double *w) #endif } } -#endif static int rys_root1(double X, double *roots, double *weights) { diff --git a/testsuite/test_f12_with_aft.py b/testsuite/test_f12_with_aft.py index ba1f69bb..ac36d6bf 100644 --- a/testsuite/test_f12_with_aft.py +++ b/testsuite/test_f12_with_aft.py @@ -198,41 +198,6 @@ def get_eri_2c2e(mydf): print('laplacian', abs(eri0-eri1.trace()).max(), abs(eri0).max()) -#def weighted_gtg_coul(kpt=numpy.zeros(3), exx=False, mesh=None): -# if mesh is None: -# mesh = self.mesh -# Gv, Gvbase, kws = cell.get_Gv_weights(mesh) -# G2 = numpy.einsum('gx,gx->g', Gv, Gv) -# G = numpy.sqrt(G2) -# coulG = 4*numpy.pi / (G*numpy.sqrt(zeta)) * scipy.special.dawsn(G/(2*numpy.sqrt(zeta))) -# coulG *= kws -# return coulG -# -#mydf.weighted_coulG = weighted_gtg_coul -#eri0 = get_eri(mydf) - -zeta = .4 -def weighted_gtg(kpt=numpy.zeros(3), exx=False, mesh=None): - if mesh is None: - mesh = self.mesh - Gv, Gvbase, kws = cell.get_Gv_weights(mesh) - G2 = numpy.einsum('gx,gx->g', Gv, Gv) - coulG = (numpy.pi/zeta)**1.5 * numpy.exp(G2/(-4*zeta)) - coulG *= kws - return coulG -mydf.weighted_coulG = weighted_gtg -cell._env[10] = zeta -eri0 = get_eri(mydf) -eri1 = cell.intor('int2e_gtg_sph', aosym='s4', comp=1) -print('int2e_gtg', abs(eri0-eri1).max(), abs(eri0).max()) -eri0 = get_eri_2c2e(mydf) -eri1 = cell.intor('int2c2e_gtg_sph', aosym='s1', comp=1) -print('int2c2e_gtg', abs(eri0-eri1).max(), abs(eri0).max()) -eri0 = get_eri_3c2e(mydf) -eri1 = cell.intor('int3c2e_gtg_sph', aosym='s2ij', comp=1) -print('int3c2e_gtg', abs(eri0-eri1).max(), abs(eri0).max()) - - omega = 0.2 def weighted_rsh(kpt=numpy.zeros(3), exx=False, mesh=None): if mesh is None: @@ -246,5 +211,5 @@ def weighted_rsh(kpt=numpy.zeros(3), exx=False, mesh=None): mydf.weighted_coulG = weighted_rsh eri0 = get_eri(mydf) with cell.with_range_coulomb(omega): - eri1 = cell.intor('int2e_coulerf_sph', aosym='s4', comp=1) -print('int2e_coulerf', abs(eri0-eri1).max(), abs(eri0).max()) + eri1 = cell.intor('int2e_sph', aosym='s4', comp=1) +print('int2e', abs(eri0-eri1).max(), abs(eri0).max()) diff --git a/testsuite/test_int2e_f12_etc.py b/testsuite/test_int2e_f12_etc.py index e30ed9ac..0b32159f 100644 --- a/testsuite/test_int2e_f12_etc.py +++ b/testsuite/test_int2e_f12_etc.py @@ -38,8 +38,6 @@ def make_cintopt(atm, bas, env, intor): fn1 = getattr(_cint, 'cint2e_sph') fn2 = getattr(_cint, 'cint2e_yp_sph') -fn3 = getattr(_cint, 'cint2e_coulerf_sph') -fn4 = getattr(_cint, 'cint2e_coul_gtg_sph') cintopt1 = lib.c_null_ptr() cintopt1 = make_cintopt(mol._atm, mol._bas, mol._env, 'cint2e_yp_sph') @@ -74,20 +72,4 @@ def make_cintopt(atm, bas, env, intor): if err > 1e-3: print('yp', i, j, k, l, numpy.linalg.norm(ref-buf)/numpy.linalg.norm(ref)) #exit() - fn3(buf.ctypes.data_as(ctypes.c_void_p), - (ctypes.c_int*4)(i,j,k,l), - mol._atm.ctypes.data_as(ctypes.c_void_p), ctypes.c_int(mol.natm), - mol._bas.ctypes.data_as(ctypes.c_void_p), ctypes.c_int(mol.nbas), - mol._env.ctypes.data_as(ctypes.c_void_p), lib.c_null_ptr()) - if numpy.linalg.norm(ref-buf) > 1e-5: - print('coulerf', i, j, k, l, numpy.linalg.norm(ref-buf)) - exit() - fn4(buf.ctypes.data_as(ctypes.c_void_p), - (ctypes.c_int*4)(i,j,k,l), - mol._atm.ctypes.data_as(ctypes.c_void_p), ctypes.c_int(mol.natm), - mol._bas.ctypes.data_as(ctypes.c_void_p), ctypes.c_int(mol.nbas), - mol._env.ctypes.data_as(ctypes.c_void_p), lib.c_null_ptr()) - if numpy.linalg.norm(ref-buf) > 1e-3: - print('coul_gtg', i, j, k, l, numpy.linalg.norm(ref-buf)) - exit() print(max(yp_err))