From 26b22b13683d38a5b328df7f645bb94f6871a107 Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Sat, 30 Nov 2019 22:00:12 -0800 Subject: [PATCH] Support fractional nuclear charges --- ChangeLog | 2 ++ README.md | 4 ++-- include/cint.h.in | 2 ++ src/cint_const.h | 2 ++ src/g1e.c | 4 ++++ src/g3c1e.c | 4 ++++ 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 031d84b..5e2312e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +Version 3.0.19 (2019-11-30): + * support fractional nuclear charges Version 3.0.18 (2019-07-02): * Fix undefined varialbe in nabla-rinv integral * Add integral < i | nabla-rinv | j > diff --git a/README.md b/README.md index 7407419..ae369b5 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ qcint (quick libcint) An optimized libcint branch for X86 platform -version 3.0.18 +version 3.0.19 -2019-07-02 +2019-11-30 What is qcint diff --git a/include/cint.h.in b/include/cint.h.in index 1156f0a..377cbce 100644 --- a/include/cint.h.in +++ b/include/cint.h.in @@ -38,6 +38,7 @@ #define PTR_COORD 1 #define NUC_MOD_OF 2 #define PTR_ZETA 3 +#define PTR_FRAC_CHARGE 3 #define RESERVE_ATMLOT1 4 #define RESERVE_ATMLOT2 5 #define ATM_SLOTS 6 @@ -94,6 +95,7 @@ #define ANG_MAX 12 // l = 0..11 #define POINT_NUC 1 #define GAUSSIAN_NUC 2 +#define FRAC_CHARGE_NUC 3 #define bas(SLOT,I) bas[BAS_SLOTS * (I) + (SLOT)] #define atm(SLOT,I) atm[ATM_SLOTS * (I) + (SLOT)] diff --git a/src/cint_const.h b/src/cint_const.h index 1779069..34e871d 100644 --- a/src/cint_const.h +++ b/src/cint_const.h @@ -36,6 +36,7 @@ #define PTR_COORD 1 #define NUC_MOD_OF 2 #define PTR_ZETA 3 +#define PTR_FRAC_CHARGE 3 #define RESERVE_ATMLOT1 4 #define RESERVE_ATMLOT2 5 #define ATM_SLOTS 6 @@ -131,3 +132,4 @@ #define POINT_NUC 1 #define GAUSSIAN_NUC 2 +#define FRAC_CHARGE_NUC 3 diff --git a/src/g1e.c b/src/g1e.c index 175dfad..e7a8aa0 100644 --- a/src/g1e.c +++ b/src/g1e.c @@ -291,6 +291,10 @@ void CINTg1e_nuc(double *g, CINTEnvVars *envs, int count, int nuc_id) if (nuc_id < 0) { fac1 = MM_SET1(2*M_PI) * MM_LOAD(envs->fac) * MM_LOAD(tau) / aij; cr = env + PTR_RINV_ORIG; + } else if (atm(NUC_MOD_OF,nuc_id) == FRAC_CHARGE_NUC) { + fac1 = MM_SET1(2*M_PI) * MM_SET1(-env[atm[PTR_FRAC_CHARGE+nuc_id*ATM_SLOTS]]); + fac1 = fac1 * MM_LOAD(envs->fac) * MM_LOAD(tau) / aij; + cr = env + atm(PTR_COORD, nuc_id); } else { fac1 = MM_SET1(2*M_PI) * MM_SET1(-fabs(atm[CHARGE_OF+nuc_id*ATM_SLOTS])); fac1 = fac1 * MM_LOAD(envs->fac) * MM_LOAD(tau) / aij; diff --git a/src/g3c1e.c b/src/g3c1e.c index be80ab5..ad0e5c6 100644 --- a/src/g3c1e.c +++ b/src/g3c1e.c @@ -229,6 +229,10 @@ void CINTg3c1e_nuc(double *g, CINTEnvVars *envs, int count, int nuc_id) if (nuc_id < 0) { fac1 = 2./SQRTPI * MM_LOAD(envs->fac) * MM_LOAD(tau) / aijk; cr = env + PTR_RINV_ORIG; + } else if (atm(NUC_MOD_OF,nuc_id) == FRAC_CHARGE_NUC) { + fac1 = 2./SQRTPI * MM_SET1(-env[atm[PTR_FRAC_CHARGE+nuc_id*ATM_SLOTS]]); + fac1 = fac1 * MM_LOAD(envs->fac) * MM_LOAD(tau) / aijk; + cr = env + atm(PTR_COORD, nuc_id); } else { fac1 = 2./SQRTPI * MM_SET1(-fabs(atm[CHARGE_OF+nuc_id*ATM_SLOTS])); fac1 = fac1 * MM_LOAD(envs->fac) * MM_LOAD(tau) / aijk;