|
|
eceb961 |
diff -up psi4-1.3.2/psi4/driver/procrouting/dft/dh_functionals.py.libxc5 psi4-1.3.2/psi4/driver/procrouting/dft/dh_functionals.py
|
|
|
eceb961 |
--- psi4-1.3.2/psi4/driver/procrouting/dft/dh_functionals.py.libxc5 2020-05-05 09:06:43.806038249 +0200
|
|
|
eceb961 |
+++ psi4-1.3.2/psi4/driver/procrouting/dft/dh_functionals.py 2020-05-05 09:02:26.227501499 +0200
|
|
|
eceb961 |
@@ -594,13 +594,13 @@ def get_pwpb95_tweaks():
|
|
|
eceb961 |
c_pw6 = bt / (X_FACTOR_C * X2S * X2S)
|
|
|
eceb961 |
d_pw6 = -(bt - beta) / (X_FACTOR_C * X2S * X2S)
|
|
|
eceb961 |
f_pw6 = 1.0e-6 / (X_FACTOR_C * X2S**expo_pw6)
|
|
|
eceb961 |
- return ([a_pw6, b_pw6, c_pw6, d_pw6, f_pw6, alpha_pw6, expo_pw6])
|
|
|
eceb961 |
+ return ([bt, alpha_pw6, expo_pw6])
|
|
|
eceb961 |
|
|
|
eceb961 |
|
|
|
eceb961 |
funcs.append({
|
|
|
eceb961 |
"name": "PWPB95",
|
|
|
eceb961 |
"x_functionals": {
|
|
|
eceb961 |
- "GGA_X_PW91": {
|
|
|
eceb961 |
+ "GGA_X_MPW91": { # only mpw91, not pw91, is tweakable
|
|
|
eceb961 |
"tweak": get_pwpb95_tweaks(),
|
|
|
eceb961 |
"alpha": 0.50
|
|
|
eceb961 |
}
|
|
|
eceb961 |
@@ -626,7 +626,7 @@ funcs.append({
|
|
|
eceb961 |
"name": "PTPSS",
|
|
|
eceb961 |
"x_functionals": {
|
|
|
eceb961 |
"MGGA_X_TPSS": {
|
|
|
eceb961 |
- "tweak": [0.15, 0.88491, 0.047, 0.872, 0.16952],
|
|
|
eceb961 |
+ "tweak": [0.15, 0.88491, 0.047, 0.872, 0.16952, -999., -999.], # last two are filled in from defaults
|
|
|
eceb961 |
"alpha": 0.50
|
|
|
eceb961 |
}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
diff -up psi4-1.3.2/psi4/driver/procrouting/dft/gga_functionals.py.libxc5 psi4-1.3.2/psi4/driver/procrouting/dft/gga_functionals.py
|
|
|
eceb961 |
--- psi4-1.3.2/psi4/driver/procrouting/dft/gga_functionals.py.libxc5 2020-05-05 09:06:48.714819789 +0200
|
|
|
eceb961 |
+++ psi4-1.3.2/psi4/driver/procrouting/dft/gga_functionals.py 2020-05-05 09:02:26.238501010 +0200
|
|
|
eceb961 |
@@ -138,7 +138,7 @@ funcs.append({
|
|
|
eceb961 |
"GGA_X_PW91": {}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"c_functionals": {
|
|
|
eceb961 |
- "GGA_C_Pw91": {}
|
|
|
eceb961 |
+ "GGA_C_PW91": {}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"citation": ' J.P. Perdew et. al., Phys. Rev. B., 46(11), 6671-6687, 1992\n',
|
|
|
eceb961 |
"description": ' PW91 GGA Exchange-Correlation Functional\n',
|
|
|
eceb961 |
@@ -150,7 +150,7 @@ funcs.append({
|
|
|
eceb961 |
"GGA_X_mPW91": {}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"c_functionals": {
|
|
|
eceb961 |
- "GGA_C_Pw91": {}
|
|
|
eceb961 |
+ "GGA_C_PW91": {}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"citation": ' C. Adamo, V. Barone, J. Chem. Phys., 108, 664, 1998\n',
|
|
|
eceb961 |
"description": ' mPWPW GGA Exchange-Correlation Functional\n',
|
|
|
eceb961 |
diff -up psi4-1.3.2/psi4/driver/procrouting/dft/hyb_functionals.py.libxc5 psi4-1.3.2/psi4/driver/procrouting/dft/hyb_functionals.py
|
|
|
eceb961 |
--- psi4-1.3.2/psi4/driver/procrouting/dft/hyb_functionals.py.libxc5 2020-05-05 09:06:43.816037804 +0200
|
|
|
eceb961 |
+++ psi4-1.3.2/psi4/driver/procrouting/dft/hyb_functionals.py 2020-05-05 09:02:26.240500921 +0200
|
|
|
eceb961 |
@@ -174,7 +174,7 @@ funcs.append({
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"c_functionals": {
|
|
|
eceb961 |
"GGA_C_PBE": {
|
|
|
eceb961 |
- "tweak": [0.03]
|
|
|
eceb961 |
+ "tweak": [0.03, -999., -999.] # last two are filled in from defaults
|
|
|
eceb961 |
}
|
|
|
eceb961 |
},
|
|
|
eceb961 |
"dispersion": {
|
|
|
eceb961 |
@@ -357,13 +357,13 @@ def get_pw6b95_tweaks():
|
|
|
eceb961 |
c_pw6 = bt / (X_FACTOR_C * X2S * X2S)
|
|
|
eceb961 |
d_pw6 = -(bt - beta) / (X_FACTOR_C * X2S * X2S)
|
|
|
eceb961 |
f_pw6 = 1.0e-6 / (X_FACTOR_C * X2S**expo_pw6)
|
|
|
eceb961 |
- return ([a_pw6, b_pw6, c_pw6, d_pw6, f_pw6, alpha_pw6, expo_pw6])
|
|
|
eceb961 |
+ return ([bt, alpha_pw6, expo_pw6])
|
|
|
eceb961 |
|
|
|
eceb961 |
|
|
|
eceb961 |
funcs.append({
|
|
|
eceb961 |
"name": "PW6B95",
|
|
|
eceb961 |
"x_functionals": {
|
|
|
eceb961 |
- "GGA_X_PW91": {
|
|
|
eceb961 |
+ "GGA_X_MPW91": {
|
|
|
eceb961 |
"tweak": get_pw6b95_tweaks(),
|
|
|
eceb961 |
"alpha": 0.72
|
|
|
eceb961 |
}
|
|
|
eceb961 |
diff -up psi4-1.3.2/psi4/src/psi4/libfunctional/LibXCfunctional.cc.libxc5 psi4-1.3.2/psi4/src/psi4/libfunctional/LibXCfunctional.cc
|
|
|
eceb961 |
--- psi4-1.3.2/psi4/src/psi4/libfunctional/LibXCfunctional.cc.libxc5 2020-05-05 09:06:43.824037448 +0200
|
|
|
eceb961 |
+++ psi4-1.3.2/psi4/src/psi4/libfunctional/LibXCfunctional.cc 2020-05-05 09:02:26.258500120 +0200
|
|
|
eceb961 |
@@ -199,11 +199,11 @@ void LibXCFunctional::set_omega(double o
|
|
|
eceb961 |
omega_ = omega;
|
|
|
eceb961 |
user_omega_ = true;
|
|
|
eceb961 |
if (xc_func_name_ == "XC_GGA_X_WPBEH") {
|
|
|
eceb961 |
- xc_gga_x_wpbeh_set_params(xc_functional_.get(), omega);
|
|
|
eceb961 |
+ xc_func_set_ext_params(xc_functional_.get(), &omega);
|
|
|
eceb961 |
} else if (xc_func_name_ == "XC_GGA_X_HJS_PBE") {
|
|
|
eceb961 |
- xc_gga_x_hjs_set_params(xc_functional_.get(), omega);
|
|
|
eceb961 |
+ xc_func_set_ext_params(xc_functional_.get(), &omega);
|
|
|
eceb961 |
} else if (xc_func_name_ == "XC_HYB_GGA_XC_LRC_WPBEH") {
|
|
|
eceb961 |
- xc_gga_x_wpbeh_set_params(xc_functional_->func_aux[0], omega);
|
|
|
eceb961 |
+ xc_func_set_ext_params(xc_functional_->func_aux[0], &omega);
|
|
|
eceb961 |
} else if (xc_func_name_ == "XC_HYB_GGA_XC_WB97X") {
|
|
|
eceb961 |
xc_functional_->cam_omega = omega;
|
|
|
eceb961 |
} else if (xc_func_name_ == "XC_HYB_GGA_XC_WB97") {
|
|
|
eceb961 |
@@ -249,100 +249,45 @@ std::map<std::string, double> LibXCFunct
|
|
|
eceb961 |
void LibXCFunctional::set_tweak(std::vector<double> values) {
|
|
|
eceb961 |
bool failed = true;
|
|
|
eceb961 |
size_t vsize = values.size();
|
|
|
eceb961 |
- if (xc_func_name_ == "XC_GGA_X_B86") {
|
|
|
eceb961 |
- if (vsize == 3) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT beta, FLOAT gamma, FLOAT omega);
|
|
|
eceb961 |
- xc_gga_x_b86_set_params(xc_functional_.get(), values[0], values[1], values[2]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_X_B88") {
|
|
|
eceb961 |
- if (vsize == 2) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT beta, FLOAT gamma);
|
|
|
eceb961 |
- xc_gga_x_b88_set_params(xc_functional_.get(), values[0], values[1]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_X_PBE") {
|
|
|
eceb961 |
- if (vsize == 2) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT kappa, FLOAT mu);
|
|
|
eceb961 |
- xc_gga_x_pbe_set_params(xc_functional_.get(), values[0], values[1]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_C_PBE") {
|
|
|
eceb961 |
- if (vsize == 1) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT beta);
|
|
|
eceb961 |
- xc_gga_c_pbe_set_params(xc_functional_.get(), values[0]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_X_PW91") {
|
|
|
eceb961 |
- if (vsize == 7) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT a, FLOAT b, FLOAT c, FLOAT d, FLOAT f, FLOAT alpha, FLOAT expo);
|
|
|
eceb961 |
- xc_gga_x_pw91_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3], values[4],
|
|
|
eceb961 |
- values[5], values[6]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_X_RPBE") {
|
|
|
eceb961 |
- if (vsize == 2) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT kappa, FLOAT mu);
|
|
|
eceb961 |
- xc_gga_x_rpbe_set_params(xc_functional_.get(), values[0], values[1]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_X_OPTX") {
|
|
|
eceb961 |
- if (vsize == 3) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT a, FLOAT b, FLOAT gamma);
|
|
|
eceb961 |
- xc_gga_x_optx_set_params(xc_functional_.get(), values[0], values[1], values[2]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_GGA_C_LYP") {
|
|
|
eceb961 |
- if (vsize == 4) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT A, FLOAT B, FLOAT c, FLOAT d);
|
|
|
eceb961 |
- xc_gga_c_lyp_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if ((xc_func_name_ == "XC_HYB_GGA_XC_HSE03") || (xc_func_name_ == "XC_HYB_GGA_XC_HSE06")) {
|
|
|
eceb961 |
+ int npars = xc_func_info_get_n_ext_params(xc_functional_.get()->info);
|
|
|
eceb961 |
+ if (npars == 0) {
|
|
|
eceb961 |
+ throw PSIEXCEPTION(
|
|
|
eceb961 |
+ "LibXCfunctional: set_tweak: There are no known tweaks for this functional, please double check "
|
|
|
eceb961 |
+ "the functional form and add them if required.");
|
|
|
eceb961 |
+ } else if (npars != vsize) {
|
|
|
eceb961 |
+ std::ostringstream oss;
|
|
|
eceb961 |
+ oss << "got " << vsize << ", expected " << npars;
|
|
|
eceb961 |
+ throw PSIEXCEPTION(
|
|
|
eceb961 |
+ "LibXCfunctional: set_tweak: Mismatch in size of tweaker vector and expected number of "
|
|
|
eceb961 |
+ "input parameters:" +
|
|
|
eceb961 |
+ oss.str() + "\n");
|
|
|
eceb961 |
+ }
|
|
|
eceb961 |
+
|
|
|
eceb961 |
+ if (xc_func_name_ == "XC_GGA_C_PBE") {
|
|
|
eceb961 |
if (vsize == 3) {
|
|
|
eceb961 |
- // "Mixing parameter beta", "Screening parameter omega_HF", "Screening parameter omega_PBE"
|
|
|
eceb961 |
+ // (XC(func_type) *p, FLOAT beta); FLOAT gamma, FLOAT BB
|
|
|
eceb961 |
+ // xc_gga_c_pbe_set_params(xc_functional_.get(), values[0]);
|
|
|
eceb961 |
+ values[1] =
|
|
|
eceb961 |
+ xc_func_info_get_ext_params_default_value(const_cast<xc_func_info_type*>(xc_functional_->info), 1);
|
|
|
eceb961 |
+ values[2] =
|
|
|
eceb961 |
+ xc_func_info_get_ext_params_default_value(const_cast<xc_func_info_type*>(xc_functional_->info), 2);
|
|
|
eceb961 |
xc_func_set_ext_params(xc_functional_.get(), values.data());
|
|
|
eceb961 |
failed = false;
|
|
|
eceb961 |
}
|
|
|
eceb961 |
} else if (xc_func_name_ == "XC_MGGA_X_TPSS") {
|
|
|
eceb961 |
- if (vsize == 5) {
|
|
|
eceb961 |
+ if (vsize == 7) {
|
|
|
eceb961 |
// (xc_func_type *p, double b, double c, double e, double kappa, double mu, double BLOC_a, double BLOC_bu);
|
|
|
eceb961 |
- xc_mgga_x_tpss_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3], values[4], 2.0,
|
|
|
eceb961 |
- 0.0);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_MGGA_C_TPSS") {
|
|
|
eceb961 |
- if (vsize == 6) {
|
|
|
eceb961 |
- // (xc_func_type *p, double beta, double d, double C0_0, double C0_1, double C0_2, double C0_3);
|
|
|
eceb961 |
- xc_mgga_c_tpss_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3], values[4],
|
|
|
eceb961 |
- values[5]);
|
|
|
eceb961 |
- failed = false;
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
- } else if (xc_func_name_ == "XC_MGGA_C_BC95") {
|
|
|
eceb961 |
- if (vsize == 2) {
|
|
|
eceb961 |
- // (XC(func_type) *p, FLOAT css, FLOAT copp);
|
|
|
eceb961 |
- xc_mgga_c_bc95_set_params(xc_functional_.get(), values[0], values[1]);
|
|
|
eceb961 |
+ // xc_mgga_x_tpss_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3],
|
|
|
eceb961 |
+ // values[4], 2.0,
|
|
|
eceb961 |
+ // 0.0);
|
|
|
eceb961 |
+ values[5] = 2.0;
|
|
|
eceb961 |
+ values[6] = 0.0;
|
|
|
eceb961 |
+ xc_func_set_ext_params(xc_functional_.get(), values.data());
|
|
|
eceb961 |
failed = false;
|
|
|
eceb961 |
}
|
|
|
eceb961 |
- // } else if (xc_func_name_ == "XC_MGGA_C_PKZB") {
|
|
|
eceb961 |
- // if (vsize == 6) {
|
|
|
eceb961 |
- // // ((XC(func_type) *p, FLOAT beta, FLOAT d, FLOAT C0_0, FLOAT C0_1, FLOAT C0_2, FLOAT
|
|
|
eceb961 |
- // // C0_3);
|
|
|
eceb961 |
- // xc_mgga_c_pkzb_set_params(xc_functional_.get(), values[0], values[1], values[2], values[3],
|
|
|
eceb961 |
- // values[4], values[5]);
|
|
|
eceb961 |
- // failed = false;
|
|
|
eceb961 |
- // }
|
|
|
eceb961 |
} else {
|
|
|
eceb961 |
- throw PSIEXCEPTION(
|
|
|
eceb961 |
- "LibXCfunctional: set_tweak: There are no known tweaks for this functional, please double check "
|
|
|
eceb961 |
- "the functional form and add them if required.");
|
|
|
eceb961 |
- }
|
|
|
eceb961 |
-
|
|
|
eceb961 |
- // Did we match fully?
|
|
|
eceb961 |
- if (failed) {
|
|
|
eceb961 |
- throw PSIEXCEPTION(
|
|
|
eceb961 |
- "LibXCfunctional: set_tweak: Mismatch in size of tweaker vector and expected number of "
|
|
|
eceb961 |
- "input parameters.");
|
|
|
eceb961 |
+ xc_func_set_ext_params(xc_functional_.get(), values.data());
|
|
|
eceb961 |
+ failed = false;
|
|
|
eceb961 |
}
|
|
|
eceb961 |
|
|
|
eceb961 |
user_tweakers_ = values;
|