Skip to content

Commit

Permalink
New integrals
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Sep 25, 2018
1 parent 66a2fed commit 9a7f731
Show file tree
Hide file tree
Showing 4 changed files with 771 additions and 85 deletions.
10 changes: 8 additions & 2 deletions scripts/auto_intor.cl
Expand Up @@ -36,16 +36,21 @@
'("int1e_prinvp" (p* \| rinv dot p \| ))
'("int1e_prinvxp" (p* \| rinv cross p \| ))
'("int1e_pnucxp" (p* \| nuc cross p \| ))
'("int2e_p1vxp1" (p* \, cross p \| \, )) ; SSO
'("int1e_irp" ( \| rc nabla \| ))
'("int1e_irrp" ( \| rc rc nabla \| ))
'("int1e_irpr" ( \| rc nabla rc \| ))
'("int1e_ggovlp" ( \| g g \|))
'("int1e_ggkin" (.5 \| g g nabla dot nabla \|))
'("int1e_ggnuc" ( \| g g nuc \|))
'("int1e_grjxp" ( \| g r cross p \|))
)

(gen-cint "intor2.c"
;'("int2e" ( \, \| \, ))
'("int2e_ig1" (#C(0 1) g \, \| \, ))
'("int2e_ig1ig2" (-1 g \, \| g \, ))
'("int2e_gg1" (g g \, \| \, ))
'("int2e_g1g2" (-1 g \, \| g \, ))
'("int2e_p1vxp1" (p* \, cross p \| \, )) ; SSO
'("int2e_ip1v_rc1" ( \, rc \| nabla-r12 \| \, ))
'("int2e_ip1v_r1" ( \, r \| nabla-r12 \| \, ))
'("int2e_ipvg1_xp1" (g \, \| nabla-r12 cross p \| \, ))
Expand Down Expand Up @@ -196,6 +201,7 @@
'("int3c2e_ipip1" ( nabla nabla \, \| ))
'("int3c2e_ipvip1" ( nabla \, nabla \| ))
'("int3c2e_ip1ip2" ( nabla \, \| nabla ))
'("int2c2e_ipip1" ( nabla nabla \| r12 \|))
'("int2c2e_ip1ip2" ( nabla \| r12 \| nabla))
)

Expand Down
81 changes: 81 additions & 0 deletions src/autocode/int3c2e.c
Expand Up @@ -1137,6 +1137,87 @@ return CINT3c2e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_3c2e1, 0);
} // int3c2e_ip1ip2_spinor
ALL_CINT(int3c2e_ip1ip2)
ALL_CINT_FORTRAN_(int3c2e_ip1ip2)
/* (NABLA NABLA i |R12 |j) */
static void CINTgout2e_int2c2e_ipip1(double *gout,
double *g, int *idx, CINTEnvVars *envs, int gout_empty) {
int nf = envs->nf;
int nrys_roots = envs->nrys_roots;
int ix, iy, iz, i, n;
double *g0 = g;
double *g1 = g0 + envs->g_size * 3;
double *g2 = g1 + envs->g_size * 3;
double *g3 = g2 + envs->g_size * 3;
G2E_D_I(g1, g0, envs->i_l+1, 0, envs->k_l, 0);
G2E_D_I(g2, g0, envs->i_l+0, 0, envs->k_l, 0);
G2E_D_I(g3, g1, envs->i_l+0, 0, envs->k_l, 0);
double s[9];
for (n = 0; n < nf; n++) {
ix = idx[0+n*3];
iy = idx[1+n*3];
iz = idx[2+n*3];
for (i = 0; i < 9; i++) { s[i] = 0; }
for (i = 0; i < nrys_roots; i++) {
s[0] += g3[ix+i] * g0[iy+i] * g0[iz+i];
s[1] += g2[ix+i] * g1[iy+i] * g0[iz+i];
s[2] += g2[ix+i] * g0[iy+i] * g1[iz+i];
s[3] += g1[ix+i] * g2[iy+i] * g0[iz+i];
s[4] += g0[ix+i] * g3[iy+i] * g0[iz+i];
s[5] += g0[ix+i] * g2[iy+i] * g1[iz+i];
s[6] += g1[ix+i] * g0[iy+i] * g2[iz+i];
s[7] += g0[ix+i] * g1[iy+i] * g2[iz+i];
s[8] += g0[ix+i] * g0[iy+i] * g3[iz+i];
}
if (gout_empty) {
gout[n*9+0] = + s[0];
gout[n*9+1] = + s[3];
gout[n*9+2] = + s[6];
gout[n*9+3] = + s[1];
gout[n*9+4] = + s[4];
gout[n*9+5] = + s[7];
gout[n*9+6] = + s[2];
gout[n*9+7] = + s[5];
gout[n*9+8] = + s[8];
} else {
gout[n*9+0] += + s[0];
gout[n*9+1] += + s[3];
gout[n*9+2] += + s[6];
gout[n*9+3] += + s[1];
gout[n*9+4] += + s[4];
gout[n*9+5] += + s[7];
gout[n*9+6] += + s[2];
gout[n*9+7] += + s[5];
gout[n*9+8] += + s[8];
}}}
void int2c2e_ipip1_optimizer(CINTOpt **opt, int *atm, int natm, int *bas, int nbas, double *env) {
int ng[] = {2, 0, 0, 0, 2, 1, 1, 9};
CINTall_2c2e_optimizer(opt, ng, atm, natm, bas, nbas, env);
}
int int2c2e_ipip1_cart(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {2, 0, 0, 0, 2, 1, 1, 9};
CINTEnvVars envs;
CINTinit_int2c2e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout2e_int2c2e_ipip1;
return CINT2c2e_cart_drv(out, dims, &envs, opt, cache);
} // int2c2e_ipip1_cart
int int2c2e_ipip1_sph(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {2, 0, 0, 0, 2, 1, 1, 9};
CINTEnvVars envs;
CINTinit_int2c2e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout2e_int2c2e_ipip1;
return CINT2c2e_spheric_drv(out, dims, &envs, opt, cache);
} // int2c2e_ipip1_sph
int int2c2e_ipip1_spinor(double complex *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {2, 0, 0, 0, 2, 1, 1, 9};
CINTEnvVars envs;
CINTinit_int2c2e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout2e_int2c2e_ipip1;
return CINT2c2e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_1e);
} // int2c2e_ipip1_spinor
ALL_CINT(int2c2e_ipip1)
ALL_CINT_FORTRAN_(int2c2e_ipip1)
/* (NABLA i |R12 |NABLA j) */
static void CINTgout2e_int2c2e_ip1ip2(double *gout,
double *g, int *idx, CINTEnvVars *envs, int gout_empty) {
Expand Down

0 comments on commit 9a7f731

Please sign in to comment.