Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/sunqm/qcint
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Apr 25, 2018
2 parents c8a9730 + 824ccc7 commit ef49e8a
Show file tree
Hide file tree
Showing 7 changed files with 700 additions and 48 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 2.6)
project (qcint C)
set(qcint_VERSION "3.0.6")
set(qcint_VERSION "3.0.11")

if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
Expand Down
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Version 3.0.11 (2018-03-23):
* Export breit integrals
Version 3.0.10 (2018-03-20):
* New integrals
<i | r p | j>,
<i | r r p | j>,
<i | r p r | j> and
<i | r r r | j>
Version 3.0.9 (2018-03-08):
* New integrals (i |nabla j) and -1/2 *(i | nabla^2 j)
Version 3.0.8 (2018-02-14):
* Fix Fortran APIs
Version 3.0.7 (2018-01-15):
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ qcint (quick libcint)

An optimized libcint branch for X86 platform

version 3.0.8
version 3.0.11

2018-02-14
2018-03-23


What is qcint
Expand Down
6 changes: 6 additions & 0 deletions scripts/auto_intor.cl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
'("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_irrr" ( \| rc rc rc \| ))
)

(gen-cint "intor2.c"
Expand Down Expand Up @@ -109,7 +113,9 @@

(gen-cint "grad1.c"
'("int1e_ipovlp" (nabla \|))
'("int1e_ovlpip" (\| nabla))
'("int1e_ipkin" (.5 nabla \| p dot p))
'("int1e_kinip" (.5 \| p dot p nabla))
'("int1e_ipnuc" (nabla \| nuc \|))
'("int1e_iprinv" (nabla \| rinv \|))
'("int1e_rinv" (\| rinv \|))
Expand Down
145 changes: 145 additions & 0 deletions src/autocode/grad1.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,59 @@ return CINT1e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_1e);
} // int1e_ipovlp_spinor
ALL_CINT1E(int1e_ipovlp)
//ALL_CINT1E_FORTRAN_(cint1e_ipovlp)
/* <i|OVLP |NABLA j> */
static void CINTgout1e_int1e_ovlpip(double *gout, double *g, int *idx, CINTEnvVars *envs, int count) {
CINTg1e_ovlp(g, envs, count);
int nf = envs->nf;
int nfc = nf * 3;
int ix, iy, iz, n;
DECLARE_GOUT;
double *RESTRICT g0 = g;
double *RESTRICT g1 = g0 + envs->g_size * 3 * SIMDD;
__MD r1;
__MD rs[3];
G1E_D_J(g1, g0, envs->i_l+0, envs->j_l+0, 0);
for (n = 0; n < nf; n++) {
ix = idx[0+n*3];
iy = idx[1+n*3];
iz = idx[2+n*3];
rs[0] = MM_LOAD(g1+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[1] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g1+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[2] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g1+iz*SIMDD);
r1 = + rs[0]; GOUT_SCATTER(gout, n*3+0, r1);
r1 = + rs[1]; GOUT_SCATTER(gout, n*3+1, r1);
r1 = + rs[2]; GOUT_SCATTER(gout, n*3+2, r1);
}}
void int1e_ovlpip_optimizer(CINTOpt **opt, int *atm, int natm, int *bas, int nbas, double *env) {
int ng[] = {0, 1, 0, 0, 1, 1, 1, 3};
CINTall_1e_optimizer(opt, ng, atm, natm, bas, nbas, env);
}
int int1e_ovlpip_cart(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 1, 0, 0, 1, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_ovlpip;
return CINT1e_drv(out, dims, &envs, opt, cache, &c2s_cart_1e);
} // int1e_ovlpip_cart
int int1e_ovlpip_sph(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 1, 0, 0, 1, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_ovlpip;
return CINT1e_drv(out, dims, &envs, opt, cache, &c2s_sph_1e);
} // int1e_ovlpip_sph
int int1e_ovlpip_spinor(double complex *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 1, 0, 0, 1, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_ovlpip;
return CINT1e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_1e);
} // int1e_ovlpip_spinor
ALL_CINT1E(int1e_ovlpip)
//ALL_CINT1E_FORTRAN_(cint1e_ovlpip)
/* <NABLA i|OVLP |P DOT P j> */
static void CINTgout1e_int1e_ipkin(double *gout, double *g, int *idx, CINTEnvVars *envs, int count) {
CINTg1e_ovlp(g, envs, count);
Expand Down Expand Up @@ -177,6 +230,98 @@ return CINT1e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_1e);
} // int1e_ipkin_spinor
ALL_CINT1E(int1e_ipkin)
//ALL_CINT1E_FORTRAN_(cint1e_ipkin)
/* <i|OVLP |P DOT P NABLA j> */
static void CINTgout1e_int1e_kinip(double *gout, double *g, int *idx, CINTEnvVars *envs, int count) {
CINTg1e_ovlp(g, envs, count);
int nf = envs->nf;
int nfc = nf * 3;
int ix, iy, iz, n;
DECLARE_GOUT;
double *RESTRICT g0 = g;
double *RESTRICT g1 = g0 + envs->g_size * 3 * SIMDD;
double *RESTRICT g2 = g1 + envs->g_size * 3 * SIMDD;
double *RESTRICT g3 = g2 + envs->g_size * 3 * SIMDD;
double *RESTRICT g4 = g3 + envs->g_size * 3 * SIMDD;
double *RESTRICT g5 = g4 + envs->g_size * 3 * SIMDD;
double *RESTRICT g6 = g5 + envs->g_size * 3 * SIMDD;
double *RESTRICT g7 = g6 + envs->g_size * 3 * SIMDD;
__MD r1;
__MD rs[27];
G1E_D_J(g1, g0, envs->i_l+0, envs->j_l+0, 0);
G1E_D_J(g2, g0, envs->i_l+0, envs->j_l+1, 0);
G1E_D_J(g3, g2, envs->i_l+0, envs->j_l+0, 0);
G1E_D_J(g4, g0, envs->i_l+0, envs->j_l+2, 0);
G1E_D_J(g5, g4, envs->i_l+0, envs->j_l+0, 0);
G1E_D_J(g6, g4, envs->i_l+0, envs->j_l+1, 0);
G1E_D_J(g7, g6, envs->i_l+0, envs->j_l+0, 0);
for (n = 0; n < nf; n++) {
ix = idx[0+n*3];
iy = idx[1+n*3];
iz = idx[2+n*3];
rs[0] = MM_LOAD(g7+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[1] = MM_LOAD(g6+ix*SIMDD) * MM_LOAD(g1+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[2] = MM_LOAD(g6+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g1+iz*SIMDD);
rs[3] = MM_LOAD(g5+ix*SIMDD) * MM_LOAD(g2+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[4] = MM_LOAD(g4+ix*SIMDD) * MM_LOAD(g3+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[5] = MM_LOAD(g4+ix*SIMDD) * MM_LOAD(g2+iy*SIMDD) * MM_LOAD(g1+iz*SIMDD);
rs[6] = MM_LOAD(g5+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g2+iz*SIMDD);
rs[7] = MM_LOAD(g4+ix*SIMDD) * MM_LOAD(g1+iy*SIMDD) * MM_LOAD(g2+iz*SIMDD);
rs[8] = MM_LOAD(g4+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g3+iz*SIMDD);
rs[9] = MM_LOAD(g3+ix*SIMDD) * MM_LOAD(g4+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[10] = MM_LOAD(g2+ix*SIMDD) * MM_LOAD(g5+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[11] = MM_LOAD(g2+ix*SIMDD) * MM_LOAD(g4+iy*SIMDD) * MM_LOAD(g1+iz*SIMDD);
rs[12] = MM_LOAD(g1+ix*SIMDD) * MM_LOAD(g6+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[13] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g7+iy*SIMDD) * MM_LOAD(g0+iz*SIMDD);
rs[14] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g6+iy*SIMDD) * MM_LOAD(g1+iz*SIMDD);
rs[15] = MM_LOAD(g1+ix*SIMDD) * MM_LOAD(g4+iy*SIMDD) * MM_LOAD(g2+iz*SIMDD);
rs[16] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g5+iy*SIMDD) * MM_LOAD(g2+iz*SIMDD);
rs[17] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g4+iy*SIMDD) * MM_LOAD(g3+iz*SIMDD);
rs[18] = MM_LOAD(g3+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g4+iz*SIMDD);
rs[19] = MM_LOAD(g2+ix*SIMDD) * MM_LOAD(g1+iy*SIMDD) * MM_LOAD(g4+iz*SIMDD);
rs[20] = MM_LOAD(g2+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g5+iz*SIMDD);
rs[21] = MM_LOAD(g1+ix*SIMDD) * MM_LOAD(g2+iy*SIMDD) * MM_LOAD(g4+iz*SIMDD);
rs[22] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g3+iy*SIMDD) * MM_LOAD(g4+iz*SIMDD);
rs[23] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g2+iy*SIMDD) * MM_LOAD(g5+iz*SIMDD);
rs[24] = MM_LOAD(g1+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g6+iz*SIMDD);
rs[25] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g1+iy*SIMDD) * MM_LOAD(g6+iz*SIMDD);
rs[26] = MM_LOAD(g0+ix*SIMDD) * MM_LOAD(g0+iy*SIMDD) * MM_LOAD(g7+iz*SIMDD);
r1 = - rs[0] - rs[12] - rs[24]; GOUT_SCATTER(gout, n*3+0, r1);
r1 = - rs[1] - rs[13] - rs[25]; GOUT_SCATTER(gout, n*3+1, r1);
r1 = - rs[2] - rs[14] - rs[26]; GOUT_SCATTER(gout, n*3+2, r1);
}}
void int1e_kinip_optimizer(CINTOpt **opt, int *atm, int natm, int *bas, int nbas, double *env) {
int ng[] = {0, 3, 0, 0, 3, 1, 1, 3};
CINTall_1e_optimizer(opt, ng, atm, natm, bas, nbas, env);
}
int int1e_kinip_cart(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 3, 0, 0, 3, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_kinip;
envs.common_factor *= 0.5;
return CINT1e_drv(out, dims, &envs, opt, cache, &c2s_cart_1e);
} // int1e_kinip_cart
int int1e_kinip_sph(double *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 3, 0, 0, 3, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_kinip;
envs.common_factor *= 0.5;
return CINT1e_drv(out, dims, &envs, opt, cache, &c2s_sph_1e);
} // int1e_kinip_sph
int int1e_kinip_spinor(double complex *out, int *dims, int *shls,
int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache) {
int ng[] = {0, 3, 0, 0, 3, 1, 1, 3};
CINTEnvVars envs;
CINTinit_int1e_EnvVars(&envs, ng, shls, atm, natm, bas, nbas, env);
envs.f_gout = &CINTgout1e_int1e_kinip;
envs.common_factor *= 0.5;
return CINT1e_spinor_drv(out, dims, &envs, opt, cache, &c2s_sf_1e);
} // int1e_kinip_spinor
ALL_CINT1E(int1e_kinip)
//ALL_CINT1E_FORTRAN_(cint1e_kinip)
/* <NABLA i|NUC |j> */
static void CINTgout1e_int1e_ipnuc(double *gout, double *g, int *idx, CINTEnvVars *envs, int count) {
int nf = envs->nf;
Expand Down
Loading

0 comments on commit ef49e8a

Please sign in to comment.