diff --git a/ChangeLog b/ChangeLog index 04057dbe..c0398091 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 b/README index 3a4d73c3..8424fb81 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ libcint ======= -version 3.0.18 -2019-07-02 +version 3.0.19 +2019-11-30 What is libcint diff --git a/include/cint.h.in b/include/cint.h.in index 49446902..1845741d 100644 --- a/include/cint.h.in +++ b/include/cint.h.in @@ -87,6 +87,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/cint1e.c b/src/cint1e.c index b74de0ca..d749d51b 100644 --- a/src/cint1e.c +++ b/src/cint1e.c @@ -230,6 +230,7 @@ FINT CINT1e_drv(double *out, FINT *dims, CINTEnvVars *envs, FINT n; FINT has_value = 0; FINT *atm = envs->atm; + double *env = envs->env; double charge_fac; CINTdset0(nc*n_comp, gctr); @@ -245,8 +246,14 @@ FINT CINT1e_drv(double *out, FINT *dims, CINTEnvVars *envs, break; default: for (n = 0; n < envs->natm; n++) { - if (atm(CHARGE_OF,n) != 0) { + if (atm(NUC_MOD_OF,n) == FRAC_CHARGE_NUC) { + charge_fac = -env[atm(PTR_FRAC_CHARGE,n)]; + } else if (atm(CHARGE_OF,n) != 0) { charge_fac = -abs(atm(CHARGE_OF,n)); + } else { + charge_fac = 0; + } + if (charge_fac != 0) { has_value = CINT1e_nuc_loop(gctr, envs, charge_fac, n, cache) || has_value; } diff --git a/src/cint3c1e.c b/src/cint3c1e.c index 2306f451..99b5ce4e 100644 --- a/src/cint3c1e.c +++ b/src/cint3c1e.c @@ -382,14 +382,22 @@ FINT CINT3c1e_cart_drv(double *out, FINT *dims, CINTEnvVars *envs, CINTOpt *opt, FINT buf_filled; double fac; double *buf; + double *env = envs->env; MALLOC_INSTACK(gctr, double, nc*n_comp); MALLOC_INSTACK(buf, double, nc*n_comp); for (i = 0; i < nc*n_comp; i++) { gctr[i] = 0; } for (n = 0; n < envs->natm; n++) { - if (atm(CHARGE_OF,n) != 0) { + if (atm(NUC_MOD_OF,n) == FRAC_CHARGE_NUC) { + fac = -env[atm(PTR_FRAC_CHARGE,n)]; + } else if (atm(CHARGE_OF,n) != 0) { fac = -abs(atm(CHARGE_OF,n)); + } else { + fac = 0; + } + + if (fac != 0) { buf_filled = CINT3c1e_nuc_loop_nopt(buf, envs, fac, n, cache); if (buf_filled) { for (i = 0; i < nc*n_comp; i++) { diff --git a/src/cint_const.h b/src/cint_const.h index ac2039f4..14a15075 100644 --- a/src/cint_const.h +++ b/src/cint_const.h @@ -23,6 +23,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 @@ -113,3 +114,4 @@ #define POINT_NUC 1 #define GAUSSIAN_NUC 2 +#define FRAC_CHARGE_NUC 3