72#ifndef MADNESS_CHEM_NUCLEARCORRELATIONFACTOR_H_
73#define MADNESS_CHEM_NUCLEARCORRELATIONFACTOR_H_
90 typedef std::shared_ptr< FunctionFunctorInterface<double,3> >
functorT;
132 .functor(U1f).truncate_on_project());
139 .functor(U2f).truncate_on_project();
145 .functor(U3f).truncate_on_project();
175 .functor(Rf).truncate_on_project();
183 .functor(r).truncate_on_project();
194 .functor(
func).truncate_on_project();
202 .functor(r).truncate_on_project();
212 std::vector<real_function_3d>
U1vec()
const {
213 std::vector<real_function_3d> uvec(3);
251 virtual double S(
const double& r,
const double&
Z)
const = 0;
269 virtual double Spp_div_S(
const double& r,
const double&
Z)
const = 0;
281 virtual double Sr_div_S(
const double& r,
const double&
Z)
const = 0;
290 return std::numeric_limits<double>::infinity();
300 std::vector<size_t>
atoms_near(
const double* x,
const double* y,
const double* z,
const int npts)
const {
301 coord_3d lo{x[0],y[0],z[0]}, hi{x[0],y[0],z[0]};
303 lo[0]=std::min(
lo[0],x[
p]); hi[0]=std::max(hi[0],x[
p]);
304 lo[1]=std::min(
lo[1],y[
p]); hi[1]=std::max(hi[1],y[
p]);
305 lo[2]=std::min(
lo[2],z[
p]); hi[2]=std::max(hi[2],z[
p]);
308 for (
int d=0;
d<3; ++
d) {
309 center[
d]=0.5*(
lo[
d]+hi[
d]);
310 half[
d]=0.5*(hi[
d]-
lo[
d]);
312 const double radius=half.
normf();
313 std::vector<size_t> near;
329 virtual double Srr_div_S(
const double& r,
const double&
Z)
const = 0;
339 virtual double Srrr_div_S(
const double& r,
const double&
Z)
const = 0;
356 print(
"you can't compute the Hessian matrix");
357 print(
"U2X_spherical is not implemented for the nuclear correlation factor");
383 smoothing=sqrt(smoothing);
384 const double r=xyz.
normf();
385 const double rs=r/smoothing;
388 double erfrs_div_r=2.0/(smoothing*sqrtpi)-2.0/3.0*rs*rs/(sqrtpi*smoothing);
389 return erfrs_div_r*xyz;
391 return erf(rs)/r*xyz;
399 if (smoothing==0.0) smoothing=
eprec;
403 const double r=xyz.
normf();
404 const double cutoff=smoothing;
415 const double xi=r/cutoff;
416 const double xi2=
xi*
xi;
417 const double xi3=
xi*
xi*
xi;
419 const double nu22=0.5 + 1./64.*(105*
xi - 175 *xi3 + 147* xi2*xi3 - 45* xi3*xi3*
xi);
421 const double kk=2.*nu22-1.0;
445 double smoothing=0.0)
const {
447 const double r=xyz.
normf();
449 if (smoothing==0.0) smoothing=
eprec;
455 smoothing=sqrt(smoothing);
457 const double rs=r/smoothing;
459 const double sqrtpis3=sqrtpi*smoothing*smoothing*smoothing;
463 double p=-4.0/(3.0*sqrtpis3) + 4.0*rs*rs/(5.0*sqrtpis3);
465 double erfrs_div_r=2.0/(smoothing*sqrtpi)-2.0/3.0*rs*rs/(sqrtpi*smoothing);
466 result=xyz*xyz[
axis]*
p;
467 result[
axis]+=erfrs_div_r;
470 const double erfrs_div_r=erf(rs)/r;
471 const double term1=2.0*exp(-rs*rs)/(sqrtpi*r*r*smoothing);
472 result=xyz*xyz[
axis]*(term1-erfrs_div_r/(r*r));
473 result[
axis]+=erfrs_div_r;
477 double s2=smoothing*smoothing;
478 double s7=s2*s2*s2*smoothing;
481 double fac_offdiag=-(((135. *
r2*
r2 - 294.*
r2 *s2
482 + 175.*s2*s2))/(16.* s7));
483 double fac_diag=-((45.*
r2*
r2*
r2 - 147.*
r2*
r2* s2
484 + 175.*
r2*s2*s2 - 105.* s2*s2*s2 + 270.*
r2*
r2* x2
485 - 588.*
r2* s2* x2 + 350.*s2* s2 *x2)/(32.* s7));
487 result[0]=fac_offdiag*xyz[0]*xyz[
axis];
488 result[1]=fac_offdiag*xyz[1]*xyz[
axis];
489 result[2]=fac_offdiag*xyz[2]*xyz[
axis];
490 result[
axis]=fac_diag;
494 result=xyz*(-xyz[
axis]/(r*r*r));
511 return eval(xyz,
ncf->all_atoms());
515 const std::vector<size_t> near=
ncf->atoms_near(xv[0],xv[1],xv[2],
npts);
518 fv[
p]=
eval(xyz,near);
522 double eval(
const coord_3d& xyz,
const std::vector<size_t>& atoms)
const {
524 for (
const size_t i : atoms) {
525 const Atom& atom=
ncf->molecule.get_atom(i);
527 const double r=vr1A.
normf();
528 result*=
ncf->S(r,atom.
q);
530 if (
exponent==-1)
return 1.0/result;
531 else if (
exponent==2)
return result*result;
532 else if (
exponent==1)
return result;
534 return std::pow(result,
double(
exponent));
539 return ncf->molecule.get_all_coords_vec();
559 return eval(xyz,
ncf->all_atoms());
563 const std::vector<size_t> near=
ncf->atoms_near(xv[0],xv[1],xv[2],
npts);
566 fv[
p]=
eval(xyz,near);
569 double eval(
const coord_3d& xyz,
const std::vector<size_t>& atoms)
const {
571 for (
const size_t i : atoms) {
572 const Atom& atom=
ncf->molecule.get_atom(i);
574 const double r=vr1A.
normf();
575 const double&
Z=atom.
q;
577 result-=
ncf->Sr_div_S(r,
Z)*
ncf->smoothed_unitvec(vr1A)[
axis];
582 return ncf->molecule.get_all_coords_vec();
606 const double r=vr1A.
normf();
607 const double&
Z=atom.
q;
608 return ncf->Sr_div_S(r,
Z)*
ncf->smoothed_unitvec(vr1A)[
axis];
612 std::vector< madness::Vector<double,3> >
c(1);
637 return eval(xyz,
ncf->all_atoms());
641 const std::vector<size_t> near=
ncf->atoms_near(xv[0],xv[1],xv[2],
npts);
644 fv[
p]=
eval(xyz,near);
647 double eval(
const coord_3d& xyz,
const std::vector<size_t>& atoms)
const {
654 for (
const size_t i : atoms) {
655 const Atom& atom=
ncf->molecule.get_atom(i);
657 const double d=
ncf->Sr_div_S(vr1A.
normf(),atom.
q);
671 return ncf->molecule.get_all_coords_vec();
683 return eval(xyz,
ncf->all_atoms());
687 const std::vector<size_t> near=
ncf->atoms_near(xv[0],xv[1],xv[2],
npts);
690 fv[
p]=
eval(xyz,near);
694 double eval(
const coord_3d& xyz,
const std::vector<size_t>& near)
const {
697 for (
size_t i=0; i<
ncf->molecule.natom(); ++i) {
698 const Atom& atom=
ncf->molecule.get_atom(i);
700 const double r=vr1A.
normf();
701 if (
k<near.size() and near[
k]==i) {
703 result+=
ncf->Spp_div_S(r,atom.
q);
711 return ncf->molecule.get_all_coords_vec();
722 return eval(xyz,
ncf->all_atoms());
726 const std::vector<size_t> near=
ncf->atoms_near(xv[0],xv[1],xv[2],
npts);
729 fv[
p]=
eval(xyz,near);
732 double eval(
const coord_3d& xyz,
const std::vector<size_t>& atoms)
const {
737 for (
const size_t i : atoms) {
738 const Atom& atom=
ncf->molecule.get_atom(i);
748 return -0.5*(sum2-diag);
751 return ncf->molecule.get_all_coords_vec();
769 const double r=vr1A.
normf();
770 return ncf->Spp_div_S(r,atom.
q);
774 std::vector< madness::Vector<double,3> >
c(1);
797 const double rA=vr1A.
normf();
799 double Sr_div_SA=
ncf->Sr_div_S(rA,atomA.
q);
803 for (
size_t i=0; i<
ncf->molecule.natom(); ++i) {
804 if (i==
iatom)
continue;
806 const Atom& atomB=
ncf->molecule.get_atom(i);
808 const double rB=vr1B.
normf();
810 double Sr_div_SB=
ncf->Sr_div_S(rB,atomB.
q);
812 double dot=nA[0]*nB[0] + nA[1]*nB[1] + nA[2]*nB[2];
813 result+=Sr_div_SB*Sr_div_SA*
dot;
819 std::vector< madness::Vector<double,3> >
c(1);
834 const Molecule& mol,
const size_t iatom1)
840 for (
size_t i=0; i<
ncf->molecule.natom(); ++i) {
841 const Atom& atom=
ncf->molecule.get_atom(i);
843 const double r=vr1A.
normf();
844 result*=
ncf->S(r,atom.
q);
847 iatom, xyz[0], xyz[1], xyz[2]);
848 return result*result*
V;
852 return ncf->molecule.get_all_coords_vec();
864 const Molecule& molecule1,
const size_t atom1,
const int axis1)
870 for (
size_t i=0; i<
ncf->molecule.natom(); ++i) {
871 const Atom& atom=
ncf->molecule.get_atom(i);
873 const double r=vr1A.
normf();
874 result*=
ncf->S(r,atom.
q);
878 return result*result*Vprime;
882 return ncf->molecule.get_all_coords_vec();
913 for (
size_t i=0; i<
ncf->molecule.natom(); ++i) {
914 const Atom& atom=
ncf->molecule.get_atom(i);
916 const double r=vr1A.
normf();
917 result*=
ncf->S(r,atom.
q);
919 if (
exponent==2) result=result*result;
925 const double r=vr1A.
normf();
927 const double S1=-
ncf->Sr_div_S(r,
Z)
935 return ncf->molecule.get_all_coords_vec();
967 const double r=vr1A.
normf();
969 const double S1=
ncf->Sr_div_S(r,
Z);
970 const double S2=
ncf->Srr_div_S(r,
Z);
975 return drhodx*(S2-S1*S1)*
ncf->smoothed_unitvec(vr1A)[
U1axis]
980 std::vector< madness::Vector<double,3> >
c(1);
999 double lo=1.0/atom.
q;
1007 const double r=vr1A.
normf();
1008 const double&
Z=atom.
q;
1013 const double drhodx=-
ncf->smoothed_unitvec(vr1A)[
axis];
1014 return drhodx*
ncf->U2X_spherical(r,
Z,
rcut);
1018 std::vector< madness::Vector<double,3> >
c(1);
1052 const double r1A=vr1A.
normf();
1053 const double& ZA=atomA.
q;
1055 double S1A=
ncf->Sr_div_S(r1A,ZA);
1056 double S2A=
ncf->Srr_div_S(r1A,ZA);
1057 double termA=S2A-S1A*S1A;
1064 const double drhodx=-nA[
axis];
1067 for (
size_t jatom=0; jatom<
ncf->molecule.natom(); ++jatom) {
1068 if (
iatom==jatom)
continue;
1070 const Atom& atomB=
ncf->molecule.get_atom(jatom);
1072 const double r1B=vr1B.
normf();
1073 const double& ZB=atomB.
q;
1075 double S1B=
ncf->Sr_div_S(r1B,ZB);
1080 for (
int i=0; i<3; ++i) {
1084 term+=(+drhodx*termA*S1B*
dot + S1A*S1B*ddot);
1092 return ncf->molecule.get_all_coords_vec();
1115 print(
"constructed nuclear correlation factor of the form");
1116 print(
" R = Prod_A S_A");
1117 print(
" S_A = exp(-Z_A r_{1A}) + (1 - exp(-Z_A^2*r_{1A}^2))");
1119 print(
"which is of Gaussian-Slater type\n");
1129 double S(
const double& r,
const double&
Z)
const {
1130 const double rho=r*
Z;
1131 return exp(-rho)+(1.0-exp(-(rho*rho)));
1137 const double r=sqrt(vr1A[0]*vr1A[0] +
1138 vr1A[1]*vr1A[1] + vr1A[2]*vr1A[2]);
1140 const double eA=exp(-
Z*r);
1141 const double gA=exp(-
Z*
Z*r*r);
1150 const double rho=
Z*r;
1152 return Z*
Z*(-3.5 - 4.0*rho + 6.0*rho*rho + 12.0*rho*rho*rho);
1154 const double e=exp(-rho);
1155 const double g=exp(-rho*rho);
1156 const double term1=-
Z/r*(1.0-
g);
1157 const double term2=-
g*
Z*
Z*(3.0-2.0*
Z*
Z*r*r) -
Z*
Z/2.0*
e;
1158 const double S_inv=exp(-rho)+(1.0-exp(-(rho*rho)));
1159 return (term1+term2)/S_inv;
1164 const double Zr=r*
Z;
1165 const double eA=exp(-Zr);
1166 const double gA=exp(-Zr*Zr);
1167 const double num=
Z*(2.0*Zr*gA-eA);
1168 const double denom=1.0+eA-gA;
1173 const double Zr=r*
Z;
1174 const double eA=exp(-Zr);
1175 const double gA=exp(-Zr*Zr);
1176 const double num=
Z*
Z*(eA+gA*(2.0-4.0*Zr*Zr));
1177 const double denom=1.0+eA-gA;
1182 const double Zr=r*
Z;
1183 const double eA=exp(-Zr);
1184 const double gA=exp(-Zr*Zr);
1185 const double num=
Z*
Z*
Z*(-eA - 12.0*gA*Zr + 8.0*gA*Zr*Zr*Zr);
1186 const double denom=1.0+eA-gA;
1207 const double ZZ=
Z*
Z;
1208 const double ZZZ=ZZ*
Z;
1209 const double Z4=ZZ*ZZ;
1210 const double r0=-4.0*ZZZ;
1211 const double r1=12.0*Z4;
1212 const double r2=36*Z4*
Z;
1213 const double r3=-67.0/6.0*Z4*ZZ;
1214 result=(r0 + r*r1 + r*r*
r2 + r*r*r*r3);
1220 const double term1=-0.5*(S3-S1*S2);
1221 const double term2=(S1+
Z)/(r*r);
1222 const double term3=(S2-S1*S1)/r;
1223 result=term1+term2-term3;
1247 print(
"constructed nuclear correlation factor of the form");
1248 print(
" R = Prod_A S_A");
1249 print(
" S_A = 1/sqrt{Z} exp(-Z_A r_{1A}) + (1 - exp(-a^2*Z_A^2*r_{1A}^2))");
1252 print(
"which is of Gradiental Gaussian-Slater type\n");
1264 double S(
const double& r,
const double&
Z)
const {
1265 const double rho=r*
Z;
1266 return 1/sqrt(
Z) * exp(-rho)+(1.0-exp(-(
a*
a*rho*rho)));
1272 const double r=sqrt(vr1A[0]*vr1A[0] +
1273 vr1A[1]*vr1A[1] + vr1A[2]*vr1A[2]);
1275 const double rho=
Z*r;
1276 const double sqrtz=sqrt(
Z);
1277 const double term=-exp(-rho)*sqrtz + 2.0*
a*
a*exp(-
a*
a*rho*rho)*
Z*rho;
1285 const double rho=
Z*r;
1286 const double sqrtz=sqrt(
Z);
1288 const double zfivehalf=
Z*
Z*sqrtz;
1289 const double a2=
a*
a;
1290 const double a4=
a2*
a2;
1292 - 3. *
a2 * zfivehalf
1293 - 4.*
a2 *rho* zfivehalf
1294 - 2. *
a2 * rho*rho*zfivehalf
1295 + 5. *a4 *rho*rho*zfivehalf
1296 + 3. *a4 *rho*rho*
Z*
Z*
Z
1297 -0.5 *
a2 *rho*rho*rho*zfivehalf
1298 +5.5 *a4 *rho*rho*rho*zfivehalf
1299 +7. *a4 *rho*rho*rho*
Z*
Z*
Z;
1301 const double e=exp(-rho);
1302 const double g=exp(-
a*
a*rho*rho);
1303 const double poly=(2.0-6.0*
a*
a*rho + 4.0*
a*
a*
a*
a*rho*rho*rho);
1304 const double num=
Z*(-2.0 -
e*r*sqrtz +
g*poly);
1305 const double denom=2.0*r*(1.0-
g+
e/sqrtz);
1311 const double rZ=r*
Z;
1312 const double e=exp(-rZ);
1313 const double g=exp(-
a*
a*rZ*rZ);
1314 const double sqrtz=sqrt(
Z);
1315 const double num=-sqrtz*
e + 2.0*
a*
a*
g*
Z*rZ;
1316 const double denom=1.0-
g+
e/sqrtz;
1321 const double rZ=r*
Z;
1322 const double e=exp(-rZ);
1323 const double g=exp(-
a*
a*rZ*rZ);
1324 const double sqrtz=sqrt(
Z);
1326 const double denom=1.0-
g+
e/sqrtz;
1331 const double rZ=r*
Z;
1332 const double e=exp(-rZ);
1333 const double g=exp(-
a*
a*rZ*rZ);
1334 const double sqrtz=sqrt(
Z);
1337 const double denom=
e+sqrtz-
g*sqrtz;
1345 const double sqrtz=sqrt(
Z);
1346 const double Z2=
Z*
Z;
1347 const double Z4=
Z2*
Z2;
1348 const double Z5=Z4*
Z;
1349 const double Z6=Z5*
Z;
1350 const double Z7=Z6*
Z;
1351 const double a2=
a*
a;
1352 const double a4=
a2*
a2;
1354 const double r0=-4.*
a2* sqrt(Z7);
1355 const double r1=2.* (-2.*
a2*
Z*sqrt(Z7)+ 5.* a4*
Z*sqrt(Z7) + 3.* a4 *Z5) *r;
1356 const double r2=1.5 * (-
a2* sqrtz*Z5 + 11.* a4* sqrtz*Z5 + 14.*a4* Z6)* r*r;
1357 const double r3=1./6.* (-
a2* sqrtz*Z6 + 66.* a4*sqrtz*Z6 - 84.*
a2*a4* sqrtz*Z6 +
1358 180. *a4* Z7 - 156.*
a2*a4* Z7 - 72.*
a2*a4*sqrtz*Z7) *r*r*r;
1359 result=(r0 + r1 +
r2 + r3);
1365 const double term1=-0.5*(S3-S1*S2);
1366 const double term2=(S1+
Z)/(r*r);
1367 const double term3=(S2-S1*S1)/r;
1368 result=term1+term2-term3;
1393 print(
"constructed nuclear correlation factor of the form");
1394 print(
" S_A = -Z_A r_{1A} exp(-Z_A r_{1A}) + 1");
1397 print(
"which is of linear Slater type\n");
1411 double S(
const double& r,
const double&
Z)
const {
1412 const double rho=r*
Z;
1413 const double b=a_param();
1414 return (-rho)*exp(-
b*rho)+1.0;
1420 const double b=a_param();
1421 const double r=sqrt(vr1A[0]*vr1A[0] +
1422 vr1A[1]*vr1A[1] + vr1A[2]*vr1A[2]);
1424 const double ebrz=exp(-
b*r*
Z);
1434 const double b=a_param();
1435 const double rho=
Z*r;
1437 const double O0=1.0- 3.0*
b;
1438 const double O1=
Z - 4.0*
b*
Z + 3.0*
b*
b*
Z;
1439 const double O2=
Z*
Z - 5.0*
b*
Z*
Z + 6.5*
b*
b*
Z*
Z - 5.0/3.0*
b*
b*
b*
Z*
Z;
1440 return Z*
Z*(O0 + O1*r + O2*r*r);
1443 const double ebrz=exp(-
b*rho);
1444 const double num=
Z* (ebrz - 1.0 + 0.5*ebrz*rho* (2.0 +
b*(
b*rho-4.0)));
1445 const double denom=r*(rho*ebrz-1.0);
1451 const double&
a=a_param();
1452 const double earz=exp(-
a*r*
Z);
1453 return Z*earz*(
a*r*
Z-1.0)/(1.0-r*
Z*earz);
1457 const double&
a=a_param();
1458 const double earz=exp(-
a*r*
Z);
1459 return a*
Z*
Z*earz*(
a*r*
Z-2.0)/(-1.0+r*
Z*earz);
1463 const double&
a=a_param();
1464 const double earz=exp(-
a*r*
Z);
1465 return a*
a*
Z*
Z*
Z*earz*(
a*r*
Z-3.0)/(1.0-r*
Z*earz);
1485 print(
"\nconstructed nuclear correlation factor of the form");
1486 print(
" S_A = 1/(a-1) exp(-a Z_A r_{1A}) + 1");
1488 print(
"with eprec ",eprec_);
1489 print(
"which is of Slater type\n");
1506 const double a=a_param();
1507 return std::log(
a*
Z*
a*
Z/((
a-1.0)*1.e-14))/(
a*
Z);
1515 double Sr_div_S(
const double& r,
const double&
Z)
const override {
1516 const double&
a=a_param();
1517 return -
a*
Z/(1.0+(
a-1.0)*exp(
a*r*
Z));
1525 double Srr_div_S(
const double& r,
const double&
Z)
const override {
1526 const double&
a=a_param();
1527 const double aZ=
a*
Z;
1528 return aZ*aZ/(1.0+(
a-1.0)*exp(r*aZ));
1537 const double&
a=a_param();
1538 const double aZ=
a*
Z;
1539 return -aZ*aZ*aZ/(1.0+(
a-1.0)*exp(r*aZ));
1543 double S(
const double& r,
const double&
Z)
const override {
1544 const double a=a_param();
1546 return 1.0+1.0/(
a-1.0) * exp(-
a*
Z*r);
1555 const double a=a_param();
1556 const double r=vr1A.
normf();
1561 double Spp_div_S(
const double& r,
const double&
Z)
const override {
1562 const double a=a_param();
1565 const double O0=1.0-(1.5*
a);
1566 const double O1=(
a-1.0)*(
a-1.0)*
Z;
1567 const double O2=(1.0/12.0 * (
a-1.0)*(12.0+
a*(5*
a-18.0)))*
Z*
Z;
1568 return Z*
Z*(O0 + O1*r + O2*r*r);
1571 const double earz=exp(-
a*r*
Z);
1572 const double num=
Z*(-earz +
a*earz - (
a-1.0) - 0.5*
a*
a*r*
Z*earz);
1573 const double denom=(r*earz + (
a-1.0) * r);
1592 const double a=a_param();
1596 const double ZZ=
Z*
Z;
1597 const double ZZZ=ZZ*
Z;
1598 const double a2=
a*
a;
1599 const double a4=
a2*
a2;
1600 const double r0=ZZZ*(1. - 2.*
a +
a2);
1601 const double r1=ZZ*ZZ/6.* (12.0 - 30.*
a + 23. *
a2 - 5.*
a*
a2);
1602 const double r2=1./8.*ZZ*ZZZ* (24. - 72.*
a + 74.*
a2 - 29.*
a2*
a + 3.*a4);
1603 const double r3=1./60.*ZZZ*ZZZ* (240. - 840.*
a + 1080.*
a2 - 610.*
a2*
a
1604 + 137.*
a2*
a2 - 7.*a4*
a);
1605 result=(r0 + r*r1 + r*r*
r2 + r*r*r*r3);
1611 const double term1=-0.5*(S3-S1*S2);
1612 const double term2=(S1+
Z)/(r*r);
1613 const double term3=(S2-S1*S1)/r;
1614 result=term1+term2-term3;
1635 print(
"\nconstructed nuclear correlation factor of the form");
1636 print(
" S_A = 1 + (a0 + a1 arZ + a2 (arZ)^2 + a3 (arZ)^3 + a4 (arZ)^4) erfc(arZ)");
1638 print(
"with eprec ",eprec_);
1639 print(
"which is of poly4erfc type\n");
1646 a0=0.5083397721116242769;
1647 a1=-2.4430795355664112811;
1648 a2=3.569312300653802680;
1649 a3=-1.9812471972342746507;
1650 a4=0.3641705622093696564;
1651 }
else if (
a==1.0) {
1652 a0=0.20265985404508529127;
1653 a1=-0.9739826967339938056;
1654 a2=1.4229779953809877198;
1655 a3=-0.7898639647077711196;
1656 a4=0.14518390461225107425;
1659 print(
"invalid parameter a for poly4erfc: only 0.5 and 1.0 implemented");
1687 result=(-17.97663543396820624361586474 + x*(32.78290319470982346841067868 +
1688 x*(-18.158574783628271659713638233 +
1689 x*(2.472138984374094343735335913 +
1690 x*(0.5516975358315341628276502285 +
1691 x*(-0.008573693952875097234391220137 +
1692 x*(-0.05596791202351071993748992739 +
1693 (0.002673799219133696315436690424 +
1694 0.0013386538660557369902632289083*x)*x)))))))/
1695 (17.976635433967702922140233083 + x*
1696 (-13.062204300852085089323266568 +
1697 x*(16.397871971437618641239835027 + x*(-5.383337491559214163188757918 + 1.*x))));
1699 result=(-16.53370050883888159389958126 + x*(30.04151304875517461538549269 +
1700 x*(-16.692529697855029750948871179 +
1701 x*(2.50341008323651011875249567 +
1702 x*(0.3106921665634860719234742532 +
1703 x*(0.08721948207311506458903445571 +
1704 x*(-0.10041387133168708232852057948 +
1705 (0.02000987266876476192949541524 - 0.0012508983745483161308604975792*x)*
1707 (16.532205048243702951212522516 + x*
1708 (-11.89273747187279634240347945 +
1709 x*(15.157537549656745468895369276 + x*(-4.9102960292797655978798640519 + 1.*x))));
1711 result=(-2352.191894900273554810118278 + x*(5782.846962269399174183661793 +
1712 x*(-5653.246084369776756298278851 +
1713 x*(2948.18046377483570925427449 +
1714 x*(-913.4583247839311453090142452 +
1715 x*(174.39391722588915386106331206 +
1716 x*(-20.22035127074332315930567933 +
1717 (1.3107321165711966663791114988 - 0.03655666729452579098523876463*x)*x))
1719 (886.4859678528423041797649741 + x*(269.17746130370931387996124706 +
1720 x*(-130.21383548057958115685397713 + x*(37.644499985765056273193347388 + 1.*x))));
1722 result=(2.2759176275121988686860433041 + x*(-1.8014283464827425541637211503 +
1723 x*(0.60570955276433317373251991152 +
1724 x*(-0.11235368819003308411943926239 +
1725 x*(0.01243211635244600976892077538 +
1726 x*(-0.0008211800260491381826149891865 +
1727 x*(0.000029973534470203049782417744015 +
1728 (-4.6423722605763162431293872646e-7 -
1729 1.3224615425412157194986675329e-10*x)*x)))))))/
1730 (1039.800013929971888016478838 + x*(-702.5378531848183775210948787 +
1731 x*(183.17476380259879599459789974 + x*(-21.74106003575315304073197254 + 1.*x))));
1735 }
else if (
a==1.0) {
1737 result=(-1.6046958001953006847027538457 + x*(5.948945186367159977879486279 +
1738 x*(-6.884321742840291285733040882 +
1739 x*(2.296896506418919905405783368 +
1740 x*(0.616939354810622973212914089 +
1741 x*(-0.13679830198890803519235207564 +
1742 x*(-0.3356576872066501398893403439 +
1743 (0.14876798925798674488426727928 - 0.016049886728185297028755535226*x)*x
1745 (1.6046957999975126909719683196 + x*
1746 (-0.8234878506688316215458988304 +
1747 x*(3.4607641859010551501639903314 + x*(-1.8955210085531557309609670978 + 1.*x))));
1749 result=(-7.143856421301985019580778813 + x*(33.35568129248075086686087865 +
1750 x*(-60.0412343766569246898209957 +
1751 x*(55.46407913315151830247939138 +
1752 x*(-28.7874770749840240158264326 +
1753 x*(8.379317837934083469035061852 +
1754 x*(-1.2103278392957399092107317741 +
1755 (0.04275186003977071121074860478 + 0.005247730112126140726731063205*x)*x
1757 (5.4509691924562038998044993827 + x*
1758 (-2.2732931206867811068721699796 +
1759 x*(4.1530634219989859344450742259 + x*(-2.0183662125874366044951391259 + 1.*x))));
1761 result=(-0.4869290414611847276899694883 + x*(1.0513417728218375522016338562 +
1762 x*(-0.9694851629317255156038942437 +
1763 x*(0.5007460889402078102011673774 +
1764 x*(-0.15897436623286639052954575417 +
1765 x*(0.03185042477631079356985872518 +
1766 x*(-0.003940899912654543218183049969 +
1767 (0.0002757919409481032696079686825 -
1768 8.369138363906178282041501561e-6*x)*x)))))))/
1769 (30.81121613134246115634780413 + x*(-49.989974505724725146933397436 +
1770 x*(31.455643953462635691568128729 + x*(-8.992097794824270871044305786 + 1.*x))));
1799 double S(
const double& r,
const double&
Z)
const {
1800 const double arZ=
a*r*
Z;
1801 const double arZ2=
a*
a*r*r*
Z*
Z;
1803 return 1.0 + (a0 +
a1* arZ+
a2 * arZ2 + a3*arZ*arZ2 + + a4*arZ2*arZ2) *erfc(
a*r*
Z);
1818 result=(-37.75186842343823465059 + x*(21.3476988467348903615 +
1819 x*(0.014608707333424946750026 +
1820 x*(-3.704945314726273312722 +
1821 x*(0.08808104845382944292252 +
1822 x*(0.3362428305409206967066 +
1823 x*(-0.02288039625102549092766 +
1824 (-0.017240056622850307571001 + 0.002412740490618117536527*x)*x)))))))/
1825 (17.595611361287293183447 + x*(-12.421065066789808273295 +
1826 x*(15.957564552156320207938 + x*(-5.0239100389132464317907 + 1.*x))));
1828 result=(-35.46082798344982189328 + x*(20.3565414350879797493 +
1829 x*(-0.3046488975234456455871 +
1830 x*(-3.298067641731523613442 +
1831 x*(-0.10712268902574947466554 +
1832 x*(0.4829111116912435121877 +
1833 x*(-0.10089023589818206760275 +
1834 (0.0013899828749998182176948 + 0.0008305150868988335610678*x)*x)))))))/
1835 (16.526499668833810286111 + x*(-11.79820182874024593006 +
1836 x*(15.115407083582433322342 + x*(-4.8449266197426825174319 + 1.*x))));
1838 result=(-414.5311559516023264104 + x*(615.8720414166440747539 +
1839 x*(-422.5938440932793094888 + x*
1840 (159.72497494584873155352 +
1841 x*(-35.6790348104188081907 +
1842 x*(4.658777521872728594702 +
1843 x*(-0.328305094433759490678 +
1844 (0.009162754689309596905172 + 0.00005047926659010755662873*x)*x)))))))/
1845 (112.7044543272820830484 + x*(-56.072518762714727894479 +
1846 x*(28.188843903409059322224 + x*(-6.519554545057610040741 + 1.*x))));
1847 }
else if (x<10.0) {
1848 result=(-146.68256559112012287314 + x*(188.52807059353309478385 +
1849 x*(-82.07176992590032524431 + x*
1850 (18.107697718347802322776 +
1851 x*(-2.3221393933622638466979 +
1852 x*(0.18681223946803275939642 +
1853 x*(-0.009601011427143648072501 +
1854 (0.00028623295732553770894583 - 3.77364531155112782235e-6*x)*x)))))))/
1855 (633.1319105785227043552 + x*(-574.29230199331494406798 +
1856 x*(171.872612865808639376 + x*(-21.906495121260483674385 + 1.*x))));
1860 }
else if (
a==1.0) {
1862 result=(-8.85288955131414420808 + x*(11.359434597010419928515 +
1863 x*(-2.982094072176256165405 + x*
1864 (-4.924201512880445076103 +
1865 x*(0.6773928043289287907009 +
1866 x*(2.061680233090141287213 +
1867 x*(-0.5528612000728412913713 +
1868 (-0.3024276764350212595121 + 0.10765958646570631264003*x)*x)))))))/
1869 (1.6731803922436094206275 + x*(-0.8242052614481793487834 +
1870 x*(3.5912910648514747558597 + x*(-1.9146644266104277222142 + 1.*x))));
1872 result=(-8.538839434207355205544 + x*(-37.85611260277589742674 +
1873 x*(155.08466711228234382211 + x*
1874 (-241.1247881821171613212 +
1875 x*(199.33293375918859716585 +
1876 x*(-96.80750216221383928113 +
1877 x*(27.71704080319043943288 +
1878 (-4.354251431065185902435 + 0.2906781051124817624589*x)*x)))))))/
1879 (2.2233877901091612794108 + x*(3.2084406367698851844258 +
1880 x*(1.021615116328133792993 + x*(-0.9819667717342250528772 + 1.*x))));
1882 result=(-7.338671998425412491091 + x*(18.593867285988629508481 +
1883 x*(-19.15344657249203844577 + x*
1884 (10.072359942912659732126 +
1885 x*(-2.99771628023376895151 +
1886 x*(0.5324416109232007541639 +
1887 x*(-0.05993976172902101376555 +
1888 (0.003887110757665478374745 - 0.00011079212872583089652945*x)*x)))))))/
1889 (13.273604111590967002999 + x*(-28.012330064250556933961 +
1890 x*(22.161347591665727407914 + x*(-7.617582259533338164664 + 1.*x))));
1892 result=(132.78397650676876308801 + x*(-78.01898251977413923271 +
1893 x*(15.292039515801252996504 + x*
1894 (-1.000000154745351328125 +
1895 x*(1.950300262619412492847e-8 +
1896 x*(-1.6337541591423364318692e-9 +
1897 x*(8.771557330523968791519e-11 +
1898 (-2.7388800346031121159372e-12 + 3.7894572289998844980568e-14*x)*x))))))
1899 )/(-4.724326520908917985827e-6 + x*
1900 (-132.78397108375581258096 + x*(78.01897976124964688489 +
1901 x*(-15.292038699709498552356 + 1.*x))));
1935template<std::
size_t N>
1946 a_=(2. + (-2. + sqrt(-1. +
N))*
N)/(-2. +
N);
1951 print(
"constructed nuclear correlation factor of the form");
1952 print(
" R = Prod_A S_A");
1953 print(
" S_A = 1 + a (r/b -1)^N if r<b, with b= (N*a)/((1+a) Z)");
1954 print(
" = 1 else ");
1956 print(
"which is of polynomial type with exponent N = ",
N);
1973 double S(
const double& r,
const double&
Z)
const {
1975 const double rho=r*
Z;
1980 const double arg=-1.0 + rho/
b;
1981 return 1.0 + power<N>(-1.0) *
a*power<N>(
arg);
1991 const double r=vr1A.
normf();
1992 const double rho=r*
Z;
2007 const double rho=r*
Z;
2012 const double ap1=1.0+
a;
2013 const double c0=((3. *(1. +
a) - (3. +
a) *
N))/(2.*
a*
N);
2014 const double c1=((2.* ap1*ap1 - ap1* (3. +
a)*
N +
N*
N)*
Z)/(
a*
a*
N*
N);
2015 const double c2=((30.*ap1*ap1*ap1- ap1*ap1* (55 + 18*
a)*
N +
2017 return Z*
Z*(c0 + c1*r + c2*r*r);
2021 const double num=
Z* (2 + (power<N>(-1)*
a* power<N>(-1 + rho/
b)
2022 * (-2 *
a*
N*
N + (1 +
a) *
N* (1 +
a *(-3 +
static_cast<int>(
N)) +
N)* rho +
2025 const double denom=2.* (r + power<N>(-1) *
a* r* power<N>(-1 + rho/
b));
2034 const double rho=r*
Z;
2039 const double negn= power<N>(-1.0);
2040 const double num=(negn*(1 +
a)*
Z*power<N-1>(-1 + ((1 +
a)*r*
Z)/(
a*
N)));
2041 const double denom=(1 + negn*
a*power<N>(-1 + ((1 +
a)*r*
Z)/(
a*
N)));
2050 const double rho=r*
Z;
2055 const double negn= power<N>(-1.0);
2057 (
a*
N*(1 + negn*
a*power<N>(-1 + ((1 +
a)*r*
Z)/(
a*
N))));
2064 const double rho=r*
Z;
2069 const double negn= power<N>(-1.0);
2070 return (negn*
power<3>(1 +
a)*(-2 +
static_cast<int>(
N))*(-1 +
static_cast<int>(
N))*
power<3>(
Z)*power<N-3>(-1 + ((1 +
a)*r*
Z)/(
a*
N)))/
2078 const double a=a_param();
2079 const double aopt=(2. + (-2. + sqrt(-1. +
N))*
N)/(-2. +
N);
2080 if (fabs(
a-aopt)>1.e-10) {
2086 const double rn=sqrt(
N-1);
2087 const double r0=0.0;
2088 const double r1=((2.*(-8. + 9.*rn) +
N*(25. + 10.*rn +
N))*r*
power<4>(
Z))/
2089 (6.*
power<2>(-2 +
static_cast<int>(
N))*rn);
2090 const double r2=((-4*(17 + 9*rn) +
N*(92 + 80*rn +
2092 (8.*
power<3>(-2 +
static_cast<int>(
N))*(-1 +
static_cast<int>(
N))*rn);
2093 result=(r0 + r*r1 + r*r*
r2);
2099 const double term1=-0.5*(S3-S1*S2);
2100 const double term2=(S1+
Z)/(r*r);
2101 const double term3=(S2-S1*S1)/r;
2102 result=term1+term2-term3;
2117 const std::shared_ptr<PotentialManager> pot,
const double fac)
2119 eprec(mol.get_eprec()), fac(fac) {
2121 if (world.
rank()==0) {
2122 print(
"constructed nuclear correlation factor of the form");
2125 print(
"which means it's (nearly) a conventional calculation\n");
2142 return potentialmanager->vnuclear();
2162 double Sr_div_S(
const double& r,
const double&
Z)
const {
return 0.0;}
2164 double Srr_div_S(
const double& r,
const double&
Z)
const {
return 0.0;}
2166 double Srrr_div_S(
const double& r,
const double&
Z)
const {
return 0.0;}
2169 double S(
const double& r,
const double&
Z)
const {
2201 const std::vector<real_function_3d>& U1)
2207 if (world.
rank()==0) {
2208 print(
"constructed ad hoc nuclear correlation factor");
2232 double S(
const double& r,
const double&
Z)
const {
2251std::shared_ptr<NuclearCorrelationFactor>
2254 const std::shared_ptr<PotentialManager> pm,
2255 const std::string inputline);
2257std::shared_ptr<NuclearCorrelationFactor>
2260 const std::shared_ptr<PotentialManager> pm,
2261 const std::pair<std::string,double>&
ncf);
Declaration of utility class and functions for atom.
this ncf has no information about itself, only U2 and U1 assigned
Definition correlationfactor.h:2193
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:2244
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2216
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:2238
corrfactype type() const
Definition correlationfactor.h:2212
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2221
AdhocNuclearCorrelationFactor(World &world, const real_function_3d U2, const std::vector< real_function_3d > &U1)
ctor
Definition correlationfactor.h:2200
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:2232
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2226
double y
Definition molecule.h:62
double x
Definition molecule.h:62
double z
Definition molecule.h:62
madness::Vector< double, 3 > get_coords() const
Definition molecule.h:106
double q
Coordinates and charge in atomic units.
Definition molecule.h:62
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:101
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
void set_length_scale(double lo)
adapt the special level to resolve the smallest length scale
Definition function_interface.h:80
double thresh() const
Returns value of truncation threshold. No communication.
Definition mra.h:673
void set_thresh(double value, bool fence=true)
Sets the value of the truncation threshold. Optional global fence.
Definition mra.h:683
Function< T, NDIM > & truncate(double tol=0.0, bool fence=true)
Truncate the function with optional fence. Compresses with fence if not compressed.
Definition mra.h:708
const Function< T, NDIM > & compress(bool fence=true) const
Compresses the function, transforming into wavelet basis. Possible non-blocking comm.
Definition mra.h:882
A nuclear correlation factor class.
Definition correlationfactor.h:1105
GaussSlater(World &world, const Molecule &mol)
ctor
Definition correlationfactor.h:1111
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1172
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:1129
double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt X (scalar part)
Definition correlationfactor.h:1203
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1181
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:1149
corrfactype type() const
Definition correlationfactor.h:1124
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1135
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1163
A nuclear correlation factor class.
Definition correlationfactor.h:1237
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1320
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:1264
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1270
double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt nuclear coordinate X (spherical part)
Definition correlationfactor.h:1341
const double a
Definition correlationfactor.h:1261
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1330
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:1284
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1310
GradientalGaussSlater(World &world, const Molecule &mol, const double a)
ctor
Definition correlationfactor.h:1243
corrfactype type() const
Definition correlationfactor.h:1257
A nuclear correlation factor class.
Definition correlationfactor.h:1381
LinearSlater(World &world, const Molecule &mol, const double a)
ctor
Definition correlationfactor.h:1387
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1456
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1418
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:1411
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1450
double a_param() const
Definition correlationfactor.h:1408
double a_
the length scale parameter a
Definition correlationfactor.h:1406
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:1462
corrfactype type() const
Definition correlationfactor.h:1401
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:1432
Definition molecule.h:129
double atomic_attraction_potential(int iatom, double x, double y, double z) const
nuclear attraction potential for a specific atom in the molecule
Definition molecule.cc:1112
const Atom & get_atom(unsigned int i) const
Definition molecule.cc:502
size_t natom() const
Definition molecule.h:463
double get_eprec() const
Definition molecule.h:495
double nuclear_attraction_potential_derivative(int atom, int axis, double x, double y, double z) const
Definition molecule.cc:1125
compute the derivative of R wrt the displacement of atom A, coord axis
Definition correlationfactor.h:887
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:908
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:934
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:888
const Atom & thisatom
Definition correlationfactor.h:889
const int derivativeaxis
Definition correlationfactor.h:890
RX_functor(const NuclearCorrelationFactor *ncf, const Atom &atom1, const int daxis, const int exponent)
1 or 2 -> R^X or R^X R
Definition correlationfactor.h:894
const int exponent
direction of the derivative operator
Definition correlationfactor.h:891
RX_functor(const NuclearCorrelationFactor *ncf, const int iatom, const int daxis, const int exponent)
Definition correlationfactor.h:900
Definition correlationfactor.h:501
R_functor(const NuclearCorrelationFactor *ncf, const int e=1)
Definition correlationfactor.h:505
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:510
int exponent
Definition correlationfactor.h:503
bool supports_vectorized() const override
Does the interface support a vectorized operator()?
Definition correlationfactor.h:513
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:502
double eval(const coord_3d &xyz, const std::vector< size_t > &atoms) const
an atom beyond its screening radius contributes the factor 1
Definition correlationfactor.h:522
void operator()(const Vector< double *, 3 > &xv, double *fv, int npts) const override
Definition correlationfactor.h:514
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:538
compute the derivative of U1 wrt the displacement of atom A, coord axis
Definition correlationfactor.h:942
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:943
const int U1axis
Definition correlationfactor.h:945
U1X_functor(const NuclearCorrelationFactor *ncf, const int iatom, const int U1axis, const int daxis)
Definition correlationfactor.h:955
U1X_functor(const NuclearCorrelationFactor *ncf, const Atom &atom1, const int U1axis, const int daxis)
direction of the derivative operator
Definition correlationfactor.h:948
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:965
const Atom & thisatom
Definition correlationfactor.h:944
const int derivativeaxis
U1x/U1y/U1z potential?
Definition correlationfactor.h:946
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:979
U1 functor for a specific atom.
Definition correlationfactor.h:593
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:603
const size_t iatom
Definition correlationfactor.h:596
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:611
U1_atomic_functor(const NuclearCorrelationFactor *ncf, const size_t atom, const int axis)
Definition correlationfactor.h:600
const int axis
Definition correlationfactor.h:597
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:595
functor for a local U1 dot U1 potential
Definition correlationfactor.h:628
void operator()(const Vector< double *, 3 > &xv, double *fv, int npts) const override
Definition correlationfactor.h:640
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:636
double eval(const coord_3d &xyz, const std::vector< size_t > &atoms) const
Definition correlationfactor.h:647
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:670
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:630
U1_dot_U1_functor(const NuclearCorrelationFactor *ncf)
Definition correlationfactor.h:633
bool supports_vectorized() const override
Does the interface support a vectorized operator()?
Definition correlationfactor.h:639
functor for the local part of the U1 potential – NOTE THE SIGN
Definition correlationfactor.h:546
void operator()(const Vector< double *, 3 > &xv, double *fv, int npts) const override
Definition correlationfactor.h:562
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:581
double eval(const coord_3d &xyz, const std::vector< size_t > &atoms) const
Definition correlationfactor.h:569
bool supports_vectorized() const override
Does the interface support a vectorized operator()?
Definition correlationfactor.h:561
const int axis
Definition correlationfactor.h:549
U1_functor(const NuclearCorrelationFactor *ncf, const int axis)
Definition correlationfactor.h:552
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:558
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:548
compute the derivative of U2 wrt the displacement of atom A
Definition correlationfactor.h:991
const int iatom
Definition correlationfactor.h:993
const int axis
Definition correlationfactor.h:994
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:1017
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:992
U2X_functor(const NuclearCorrelationFactor *ncf, const int &atom1, const int axis)
Definition correlationfactor.h:996
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:1004
U2 functor for a specific atom.
Definition correlationfactor.h:756
const size_t iatom
Definition correlationfactor.h:759
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:766
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:773
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:758
U2_atomic_functor(const NuclearCorrelationFactor *ncf, const size_t atom)
Definition correlationfactor.h:762
Definition correlationfactor.h:676
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:682
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:677
double eval(const coord_3d &xyz, const std::vector< size_t > &near) const
the atoms in near (ascending) exactly, the others through the Coulomb tail of S''/S
Definition correlationfactor.h:694
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:710
bool supports_vectorized() const override
Does the interface support a vectorized operator()?
Definition correlationfactor.h:685
U2_functor(const NuclearCorrelationFactor *ncf)
Definition correlationfactor.h:679
void operator()(const Vector< double *, 3 > &xv, double *fv, int npts) const override
Definition correlationfactor.h:686
compute the derivative of U3 wrt the displacement of atom A, coord axis
Definition correlationfactor.h:1040
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:1091
U3X_functor(const NuclearCorrelationFactor *ncf, const size_t iatom, const int axis)
Definition correlationfactor.h:1045
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:1041
const int axis
Definition correlationfactor.h:1043
const size_t iatom
Definition correlationfactor.h:1042
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:1049
U3 functor for a specific atom.
Definition correlationfactor.h:784
const size_t iatom
Definition correlationfactor.h:787
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:786
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:794
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:818
U3_atomic_functor(const NuclearCorrelationFactor *ncf, const int atom)
Definition correlationfactor.h:790
Definition correlationfactor.h:715
void operator()(const Vector< double *, 3 > &xv, double *fv, int npts) const override
Definition correlationfactor.h:725
double eval(const coord_3d &xyz, const std::vector< size_t > &atoms) const
Definition correlationfactor.h:732
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:716
U3_functor(const NuclearCorrelationFactor *ncf)
Definition correlationfactor.h:718
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:721
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:750
bool supports_vectorized() const override
Does the interface support a vectorized operator()?
Definition correlationfactor.h:724
Definition correlationfactor.h:857
const int axis
Definition correlationfactor.h:861
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:881
const Molecule & molecule
Definition correlationfactor.h:859
const size_t iatom
Definition correlationfactor.h:860
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:858
square_times_V_derivative_functor(const NuclearCorrelationFactor *ncf, const Molecule &molecule1, const size_t atom1, const int axis1)
Definition correlationfactor.h:863
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:868
Definition correlationfactor.h:828
const size_t iatom
Definition correlationfactor.h:831
const NuclearCorrelationFactor * ncf
Definition correlationfactor.h:829
square_times_V_functor(const NuclearCorrelationFactor *ncf, const Molecule &mol, const size_t iatom1)
Definition correlationfactor.h:833
double operator()(const coord_3d &xyz) const override
Definition correlationfactor.h:838
std::vector< coord_3d > special_points() const override
Override this to return list of special points to be refined more deeply.
Definition correlationfactor.h:851
const Molecule & molecule
Definition correlationfactor.h:830
ABC for the nuclear correlation factors.
Definition correlationfactor.h:86
double eprec
smoothing of the potential/step function
Definition correlationfactor.h:232
std::shared_ptr< FunctionFunctorInterface< double, 3 > > functorT
Definition correlationfactor.h:90
virtual const real_function_3d U2() const
return the U2 term of the correlation function
Definition correlationfactor.h:221
virtual real_function_3d square() const
return the square of the nuclear correlation factor
Definition correlationfactor.h:180
virtual double screening_radius(const double) const
distance from nucleus A beyond which its contributions to the functors are negligible
Definition correlationfactor.h:289
double vtol
the threshold for initial projection
Definition correlationfactor.h:229
virtual double Srrr_div_S(const double &r, const double &Z) const =0
virtual real_function_3d function() const
return the nuclear correlation factor
Definition correlationfactor.h:172
coord_3d smoothed_unitvec(const coord_3d &xyz, double smoothing=0.0) const
smoothed unit vector for the computation of the U1 potential
Definition correlationfactor.h:376
const Molecule & molecule
the molecule
Definition correlationfactor.h:235
virtual real_function_3d apply_U(const real_function_3d &rhs) const
apply the regularized potential U_nuc on a given function rhs
Definition correlationfactor.h:154
virtual real_function_3d inverse() const
return the inverse nuclear correlation factor
Definition correlationfactor.h:199
virtual double Spp_div_S(const double &r, const double &Z) const =0
the regularized potential wrt a given atom wrt the cartesian coordinate
World & world
the world
Definition correlationfactor.h:226
real_function_3d U2_function
the purely local U2 potential, having absorbed the nuclear pot V_nuc
Definition correlationfactor.h:243
std::vector< size_t > all_atoms_
Definition correlationfactor.h:236
virtual ~NuclearCorrelationFactor()
virtual destructor
Definition correlationfactor.h:103
virtual double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt nuclear coordinate X (spherical part)
Definition correlationfactor.h:354
std::vector< size_t > atoms_near(const double *x, const double *y, const double *z, const int npts) const
atoms whose screening sphere meets the bounding sphere of a set of points
Definition correlationfactor.h:300
virtual double S(const double &r, const double &Z) const =0
the correlation factor S wrt a given atom
virtual real_function_3d square_times_V_derivative(const int iatom, const int axis) const
Definition correlationfactor.h:191
void initialize(const double vtol1)
initialize the regularized potentials U1 and U2
Definition correlationfactor.h:113
virtual coord_3d Sp(const coord_3d &vr1A, const double &Z) const =0
the partial derivative of correlation factor S' wrt the cartesian coordinates
virtual const real_function_3d U1(const int axis) const
return the U1 term of the correlation function
Definition correlationfactor.h:207
NuclearCorrelationFactor(World &world, const Molecule &mol)
ctor
Definition correlationfactor.h:96
std::vector< real_function_3d > U1_function
the three components of the U1 potential
Definition correlationfactor.h:240
virtual corrfactype type() const =0
std::vector< real_function_3d > U1vec() const
return the U1 functions in a vector
Definition correlationfactor.h:212
coord_3d dsmoothed_unitvec(const coord_3d &xyz, const int axis, double smoothing=0.0) const
derivative of smoothed unit vector wrt the electronic coordinate
Definition correlationfactor.h:444
static constexpr int ncf_special_level
projection depth of the factor's functions at the nuclei
Definition correlationfactor.h:110
virtual double Srr_div_S(const double &r, const double &Z) const =0
corrfactype
Definition correlationfactor.h:88
@ Two
Definition correlationfactor.h:89
@ LinearSlater
Definition correlationfactor.h:88
@ GradientalGaussSlater
Definition correlationfactor.h:88
@ poly4erfc
Definition correlationfactor.h:89
@ Slater
Definition correlationfactor.h:89
@ Adhoc
Definition correlationfactor.h:89
@ GaussSlater
Definition correlationfactor.h:88
@ None
Definition correlationfactor.h:88
@ Polynomial
Definition correlationfactor.h:89
virtual double Sr_div_S(const double &r, const double &Z) const =0
const std::vector< size_t > & all_atoms() const
indices of all atoms
Definition correlationfactor.h:294
A nuclear correlation factor class.
Definition correlationfactor.h:1936
double a_
length scale parameter a, default chosen that linear terms in U2 vanish
Definition correlationfactor.h:1965
Polynomial(World &world, const Molecule &mol, const double a)
ctor
Definition correlationfactor.h:1942
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1989
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:2005
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:1973
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2063
double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt nuclear coordinate X (spherical part)
Definition correlationfactor.h:2077
corrfactype type() const
Definition correlationfactor.h:1960
double a_param() const
Definition correlationfactor.h:1967
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2049
static double b_param(const double &a)
the cutoff
Definition correlationfactor.h:1970
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2033
Definition correlationfactor.h:2109
double Srrr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2166
double eprec
Definition correlationfactor.h:2157
corrfactype type() const
Definition correlationfactor.h:2131
std::shared_ptr< PotentialManager > potentialmanager
underlying potential (=molecule)
Definition correlationfactor.h:2156
real_function_3d apply_U(const real_function_3d &rhs) const
apply the regularized potential U_nuc on a given function rhs
Definition correlationfactor.h:2148
double Srr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2164
const double fac
the factor of the correlation factor: R=fac;
Definition correlationfactor.h:2160
double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt nuclear coordinate X (spherical part)
Definition correlationfactor.h:2184
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:2169
double Sr_div_S(const double &r, const double &Z) const
Definition correlationfactor.h:2162
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:2174
PseudoNuclearCorrelationFactor(World &world, const Molecule &mol, const std::shared_ptr< PotentialManager > pot, const double fac)
ctor
Definition correlationfactor.h:2116
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:2179
const real_function_3d U2() const
return the U2 term of the correlation function
Definition correlationfactor.h:2137
A nuclear correlation factor class.
Definition correlationfactor.h:1472
double eprec_param() const
Definition correlationfactor.h:1502
double Sr_div_S(const double &r, const double &Z) const override
first derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1515
double U2X_spherical(const double &r, const double &Z, const double &rcut) const override
derivative of the U2 potential wrt X (scalar part)
Definition correlationfactor.h:1591
double screening_radius(const double Z) const override
every per-atom term of this factor decays as exp(-a Z r); 1e-14 relative to (a Z)^2
Definition correlationfactor.h:1505
double a_param() const
Definition correlationfactor.h:1501
double S(const double &r, const double &Z) const override
the nuclear correlation factor
Definition correlationfactor.h:1543
double Srr_div_S(const double &r, const double &Z) const override
second derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1525
Slater(World &world, const Molecule &mol, const double a)
ctor
Definition correlationfactor.h:1478
corrfactype type() const override
Definition correlationfactor.h:1493
double Srrr_div_S(const double &r, const double &Z) const override
third derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1536
double eprec_
Definition correlationfactor.h:1499
coord_3d Sp(const coord_3d &vr1A, const double &Z) const override
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1554
double Spp_div_S(const double &r, const double &Z) const override
second derivative of the nuclear correlation factor
Definition correlationfactor.h:1561
double a_
the length scale parameter
Definition correlationfactor.h:1498
constexpr T normf() const
Calculate the 2-norm of the vector elements.
Definition vector.h:421
A parallel world class.
Definition world.h:134
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:344
Definition correlationfactor.h:1622
double Srrr_div_S(const double &r, const double &Z) const
third derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1793
double a
the length scale parameter
Definition correlationfactor.h:1669
double Spp_div_S(const double &r, const double &Z) const
second derivative of the nuclear correlation factor
Definition correlationfactor.h:1813
poly4erfc(World &world, const Molecule &mol, const double aa)
ctor
Definition correlationfactor.h:1628
double a0
Definition correlationfactor.h:1670
double eprec_
Definition correlationfactor.h:1671
coord_3d Sp(const coord_3d &vr1A, const double &Z) const
radial part first derivative of the nuclear correlation factor
Definition correlationfactor.h:1807
corrfactype type() const
Definition correlationfactor.h:1664
double U2X_spherical(const double &r, const double &Z, const double &rcut) const
derivative of the U2 potential wrt X (scalar part)
Definition correlationfactor.h:1922
double a_param() const
Definition correlationfactor.h:1673
double eprec_param() const
Definition correlationfactor.h:1674
double Srr_div_S(const double &r, const double &Z) const
second derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1783
double Sr_div_S(const double &r, const double &Z) const
first derivative of the correlation factor wrt (r-R_A)
Definition correlationfactor.h:1681
double S(const double &r, const double &Z) const
the nuclear correlation factor
Definition correlationfactor.h:1799
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
static double lo
Definition dirac-hatom.cc:23
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition tensor.h:2757
static const double rcut
Definition hatom_sf_dirac.cc:19
static const double eprec
Definition hatom_sf_dirac.cc:18
static double u(double r, double c)
Definition he.cc:20
static double Z2(const coord_3d &r)
Definition helium_mp2.cc:124
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
void print(const tensorT &t)
Definition mcpfit.cc:140
static double dsmoothed_potential(double r)
Derivative of the regularized 1/r potential.
Definition mentity.cc:223
static double smoothed_potential(double r)
Regularized 1/r potential.
Definition mentity.cc:206
static double smoothing_parameter(double Z, double eprec)
Returns radius for smoothing nuclear potential with energy precision eprec.
Definition mentity.cc:192
Main include file for MADNESS and defines Function interface.
constexpr double pi
Mathematical constant .
Definition constants.h:48
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
std::shared_ptr< NuclearCorrelationFactor > create_nuclear_correlation_factor(World &world, const Molecule &molecule, const std::shared_ptr< PotentialManager > potentialmanager, const std::string inputline)
create and return a new nuclear correlation factor
Definition correlationfactor.cc:45
int power< 4 >(int base)
Definition power.h:68
Function< TENSOR_RESULT_TYPE(T, R), NDIM > dot(World &world, const std::vector< Function< T, NDIM > > &a, const std::vector< Function< R, NDIM > > &b, bool fence=true, bool do_make_redundant=true)
Multiplies and sums two vectors of functions r = \sum_i a[i] * b[i]; see dot_sparse for screening.
Definition vmra.h:1848
static double r2(const coord_3d &x)
Definition smooth.h:45
void truncate(World &world, std::vector< Function< T, NDIM > > &v, double tol=0.0, bool fence=true)
Truncates a vector of functions.
Definition vmra.h:336
int power< 5 >(int base)
Definition power.h:73
std::shared_ptr< FunctionFunctorInterface< double, 3 > > func(new opT(g))
FunctionFactory< double, 3 > real_factory_3d
Definition functypedefs.h:108
NDIM const Function< R, NDIM > & g
Definition mra.h:2664
int power< 2 >(int base)
Definition power.h:58
void print(const T &t, Ts &&... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:232
int power< 3 >(int base)
Definition power.h:63
Vector< double, 3 > coord_3d
Definition funcplot.h:1042
Derivative< double, 3 > real_derivative_3d
Definition functypedefs.h:185
int power< 6 >(int base)
Definition power.h:78
static const double b
Definition nonlinschro.cc:119
static const double d
Definition nonlinschro.cc:121
static const double a
Definition nonlinschro.cc:118
Declaration of molecule-related classes and functions.
static const double c
Definition relops.cc:10
static double Z
Definition rk.cc:35
static const double thresh
Definition rk.cc:45
static const long k
Definition rk.cc:44
const double xi
Exponent for delta function approx.
Definition siam_example.cc:60
Definition test_ar.cc:204
Definition dirac-hatom.cc:112
static double V(const coordT &r)
Definition tdse.cc:288
AtomicInt sum
Definition test_atomicint.cc:46
void e()
Definition test_sig.cc:75
double aa
Definition testbsh.cc:68
#define N
Definition testconv.cc:37
const auto npts
Definition testgconv.cc:52
std::size_t axis
Definition testpdiff.cc:59
const double a2
Definition vnucso.cc:86
const double R2
Definition vnucso.cc:84
const double a1
Definition vnucso.cc:85