From cdc19424d3e19d23d6f575e5a3c79decd0117956 Mon Sep 17 00:00:00 2001 From: ahxbcn <2092233074@qq.com> Date: Tue, 21 Oct 2025 16:28:17 +0800 Subject: [PATCH 1/3] Update supported xc functionals from develop branch --- docs/advanced/input_files/input-main.md | 24 +++- .../module_xc/xc_functional.cpp | 121 ++++++++++-------- .../module_xc/xc_functional.h | 23 +++- 3 files changed, 101 insertions(+), 67 deletions(-) diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 567af13c31..62f43979d4 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -995,12 +995,24 @@ calculations. - **Type**: String - **Description**: In our package, the XC functional can either be set explicitly using the `dft_functional` keyword in `INPUT` file. If `dft_functional` is not specified, ABACUS will use the xc functional indicated in the pseudopotential file. - On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names such as 'LDA', 'PBE', 'SCAN'. A complete list of 'short-hand' expressions can be found in [the source code](../../../source/module_hamilt_general/module_xc/xc_functional.cpp). The other way is only available when ***compiling with LIBXC***, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by a plus sign, for example, dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'. The list of LIBXC keywords can be found on its [website](https://libxc.gitlab.io/functionals/). In this way, **we support all the LDA,GGA and mGGA functionals provided by LIBXC**. - - Furthermore, the old INPUT parameter exx_hybrid_type for hybrid functionals has been absorbed into dft_functional. Options are `hf` (pure Hartree-Fock), `pbe0`(PBE0), `hse` (Note: in order to use HSE functional, LIBXC is required). Note also that HSE has been tested while PBE0 has NOT been fully tested yet, and the maximum CPU cores for running exx in parallel is $N(N+1)/2$, with N being the number of atoms. And forces for hybrid functionals are not supported yet. - - If set to `opt_orb`, the program will not perform hybrid functional calculation. Instead, it is going to generate opt-ABFs as discussed in this [article](https://pubs.acs.org/doi/abs/10.1021/acs.jpclett.0c00481). -- **Default**: same as UPF file. + On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names. A complete list of 'short-hand' expressions can be found in [the source code](../../../source/source_hamilt/module_xc/xc_functional.cpp). Supported density functionals are: + - LDA functionals + - LDA (equivalent with PZ and SLAPZNOGXNOGC), PWLDA + - GGA functionals + - PBE (equivalent with SLAPWPBXPBC), PBESOL, REVPBE, WC, BLYP, BP(referred to BP86), PW91, HCTH, OLYP, BLYP_LR + - meta-GGA functionals + - SCAN (require LIBXC) + - Hybrid functionals + - PBE0, HF + - If LIBXC is avaliale, additional short-hand names of hybrid functionals are supported: HSE(referred to HSE06), B3LYP, LC_PBE, LC_WPBE, LRC_WPBE, LRC_WPBEH, CAM_PBEH, WP22, CWP22, MULLER (equivalent with POWER) + - Hybrid meta-GGA functionals + - SCAN0 (require LIBXC) + + The other way is only available when ***compiling with LIBXC***, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by a plus sign, for example, dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'. The list of LIBXC keywords can be found on its [website](https://libxc.gitlab.io/functionals/). In this way, **we support all the LDA,GGA and mGGA functionals provided by LIBXC**. Some popular functionals and their usage are: RPBE of [Hammer et al.](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.59.7413), set `dft_functional` to 'GGA_X_RPBE+GGA_C_PBE', and [r$^{2}$SCAN](https://pubs.acs.org/doi/10.1021/acs.jpclett.0c02405), set `dft_functional` to 'MGGA_X_R2SCAN+MGGA_C_R2SCAN'. + + Furthermore, the old INPUT parameter exx_hybrid_type for hybrid functionals has been absorbed into dft_functional. Options are `hf` (pure Hartree-Fock), `pbe0`(PBE0), `hse` (Note: in order to use HSE functional, LIBXC is required). Note also that HSE has been tested while PBE0 has NOT been fully tested yet, and the maximum CPU cores for running exx in parallel is $N(N+1)/2$, with N being the number of atoms. + +- **Default**: Used the same as DFT functional as specified in the pseudopotential files. ### xc_temperature diff --git a/source/module_hamilt_general/module_xc/xc_functional.cpp b/source/module_hamilt_general/module_xc/xc_functional.cpp index 6b3c415473..0f50ebef1f 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.cpp +++ b/source/module_hamilt_general/module_xc/xc_functional.cpp @@ -2,9 +2,6 @@ #include "module_hamilt_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include "module_base/global_function.h" -#ifdef USE_PAW -#include "module_cell/module_paw/paw_cell.h" -#endif #ifdef USE_LIBXC #include "xc_functional_libxc.h" @@ -16,6 +13,7 @@ XC_Functional::~XC_Functional(){} std::vector XC_Functional::func_id(1); int XC_Functional::func_type = 0; +bool XC_Functional::ked_flag = false; bool XC_Functional::use_libxc = true; double XC_Functional::hybrid_alpha = 0.25; std::map XC_Functional::scaling_factor_xc = { {1, 1.0} }; // added by jghan, 2024-10-10 @@ -25,29 +23,24 @@ void XC_Functional::set_hybrid_alpha(const double alpha_in) hybrid_alpha = alpha_in; } -double XC_Functional::get_hybrid_alpha() -{ - return hybrid_alpha; -} - -int XC_Functional::get_func_type() -{ - return func_type; -} void XC_Functional::set_xc_first_loop(const UnitCell& ucell) { /** In the special "two-level" calculation case, the first scf iteration only calculate the functional without exact exchange. but in "nscf" calculation, there is no need of "two-level" method. */ - if (ucell.atoms[0].ncpp.xc_func == "HF" - || ucell.atoms[0].ncpp.xc_func == "PBE0" - || ucell.atoms[0].ncpp.xc_func == "HSE") { + if (ucell.atoms[0].ncpp.xc_func == "HF" || ucell.atoms[0].ncpp.xc_func == "HSE" + || ucell.atoms[0].ncpp.xc_func == "PBE0"|| ucell.atoms[0].ncpp.xc_func == "LC_PBE" + || ucell.atoms[0].ncpp.xc_func == "LC_WPBE" || ucell.atoms[0].ncpp.xc_func == "LRC_WPBEH" + || ucell.atoms[0].ncpp.xc_func == "CAM_PBEH") { XC_Functional::set_xc_type("pbe"); } else if (ucell.atoms[0].ncpp.xc_func == "SCAN0") { XC_Functional::set_xc_type("scan"); } + else if (ucell.atoms[0].ncpp.xc_func == "B3LYP") { + XC_Functional::set_xc_type("blyp"); + } } // The setting values of functional id according to the index in LIBXC @@ -71,19 +64,6 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_id.push_back(XC_LDA_C_PZ); func_type = 1; use_libxc = false; -#ifdef USE_PAW - if(PARAM.inp.use_paw) - { - if(PARAM.inp.nspin != 1) - { - ModuleBase::WARNING_QUIT("set_xc_type","paw does not support pz with spin polarization"); - } - else - { - GlobalC::paw_cell.set_libpaw_xc(1,2); - } - } -#endif } else if (xc_func == "PWLDA") { @@ -91,10 +71,6 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_id.push_back(XC_LDA_C_PW); func_type = 1; use_libxc = false; -#ifdef USE_PAW - if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(1,7); -} -#endif } else if ( xc_func == "PBE" || xc_func == "SLAPWPBXPBC") //PBX+PBC { @@ -102,10 +78,6 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_id.push_back(XC_GGA_C_PBE); func_type = 2; use_libxc = false; -#ifdef USE_PAW - if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(2,11); -} -#endif } else if ( xc_func == "PBESOL") //PBX_S+PBC_S { @@ -120,10 +92,6 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_id.push_back(XC_GGA_C_PBE); func_type = 2; use_libxc = false; -#ifdef USE_PAW - if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(2,14); -} -#endif } else if ( xc_func == "WC") //WC+PBC { @@ -182,6 +150,36 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_type = 5; use_libxc = true; } + else if( xc_func == "LC_PBE") + { + func_id.push_back(XC_HYB_GGA_XC_LC_PBEOP); + func_type = 4; + use_libxc = true; + } + else if( xc_func == "LC_WPBE") + { + func_id.push_back(XC_HYB_GGA_XC_LC_WPBE); + func_type = 4; + use_libxc = true; + } + else if( xc_func == "LRC_WPBE") + { + func_id.push_back(XC_HYB_GGA_XC_LRC_WPBE); + func_type = 4; + use_libxc = true; + } + else if( xc_func == "LRC_WPBEH") + { + func_id.push_back(XC_HYB_GGA_XC_LRC_WPBEH); + func_type = 4; + use_libxc = true; + } + else if( xc_func == "CAM_PBEH") + { + func_id.push_back(XC_HYB_GGA_XC_CAM_PBEH); + func_type = 4; + use_libxc = true; + } #endif else if( xc_func == "HF") { @@ -252,6 +250,12 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_type = 2; use_libxc = true; } + else if (xc_func == "B3LYP") + { + func_id.push_back(XC_HYB_GGA_XC_B3LYP); + func_type = 4; + use_libxc = true; + } #endif else { @@ -270,38 +274,45 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) #endif } - if (func_id[0] == XC_GGA_X_OPTX) - { - std::cerr << "\n OPTX untested please test,"; - } + if (func_type == 3 || func_type == 5) + { + ked_flag = true; + } + else + { + ked_flag = false; + } - if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "pw") + if (func_id[0] == XC_GGA_X_OPTX) { - ModuleBase::WARNING_QUIT("set_xc_type","hybrid functional not realized for planewave yet"); + std::cerr << "\n OPTX untested please test,"; } + + // if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "pw") + // { + // ModuleBase::WARNING_QUIT("set_xc_type","hybrid functional not realized for planewave yet"); + // } if((func_type == 3 || func_type == 5) && PARAM.inp.nspin==4) { ModuleBase::WARNING_QUIT("set_xc_type","meta-GGA has not been implemented for nspin = 4 yet"); } - //if((func_type == 3 || func_type == 5) && PARAM.inp.cal_stress == 1 && PARAM.inp.nspin!=1) - //{ - // ModuleBase::WARNING_QUIT("set_xc_type","mgga stress not implemented for polarized case yet"); - //} #ifndef __EXX - if(func_type == 4 || func_type == 5) + if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "lcao") { - ModuleBase::WARNING_QUIT("set_xc_type","compile with libri to use hybrid functional"); + ModuleBase::WARNING_QUIT("set_xc_type","compile with libri to use hybrid functional in lcao basis"); } #endif #ifndef USE_LIBXC if(xc_func == "SCAN" || xc_func == "HSE" || xc_func == "SCAN0" - || xc_func == "MULLER" || xc_func == "POWER" || xc_func == "WP22" || xc_func == "CWP22") + || xc_func == "MULLER" || xc_func == "POWER" || xc_func == "WP22" || xc_func == "CWP22" || + xc_func == "LC_PBE" || xc_func == "LC_WPBE" || xc_func == "LRC_WPBE" || + xc_func == "LRC_PBEH" || xc_func == "CAM_PBEH") { - ModuleBase::WARNING_QUIT("set_xc_type","to use SCAN, SCAN0, or HSE, LIBXC is required"); + ModuleBase::WARNING_QUIT("set_xc_type","to use SCAN, SCAN0, HSE, long-range corrected (LC_PBE, LC_WPBE...) or CAM_PBEH LIBXC is required"); } use_libxc = false; #endif -} +} \ No newline at end of file diff --git a/source/module_hamilt_general/module_xc/xc_functional.h b/source/module_hamilt_general/module_xc/xc_functional.h index 04ca90216f..35f6a35016 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.h +++ b/source/module_hamilt_general/module_xc/xc_functional.h @@ -64,12 +64,22 @@ class XC_Functional // func_type, which is as specified in get_func_type // use_libxc, whether to use LIBXC. The rule is to NOT use it for functionals that we already have. - static int get_func_type(); + static int get_func_type() + { + return func_type; + }; static void set_xc_type(const std::string xc_func_in); // For hybrid functional static void set_hybrid_alpha(const double alpha_in); - static double get_hybrid_alpha(); + static double get_hybrid_alpha() + { + return hybrid_alpha; + }; + static bool get_ked_flag() + { + return ked_flag; + }; /// Usually in exx caculation, the first SCF loop should be converged with PBE static void set_xc_first_loop(const UnitCell& ucell); @@ -77,10 +87,11 @@ class XC_Functional static std::vector func_id; // libxc id of functional static int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga - static bool use_libxc; + static bool ked_flag; // whether the functional has kinetic energy density + static bool use_libxc; - //exx_hybrid_alpha for mixing exx in hybrid functional: - static double hybrid_alpha; + // exx_hybrid_alpha for mixing exx in hybrid functional: + static double hybrid_alpha; // added by jghan, 2024-07-07 // as a scaling factor for different xc-functionals @@ -316,4 +327,4 @@ class XC_Functional }; -#endif //XC_FUNCTION_H +#endif //XC_FUNCTION_H \ No newline at end of file From 5f57188eb377a48a1fba68224118059b69fd7658 Mon Sep 17 00:00:00 2001 From: ahxbcn <2092233074@qq.com> Date: Tue, 21 Oct 2025 17:30:04 +0800 Subject: [PATCH 2/3] Revert unnecessary changes --- .../module_xc/xc_functional.cpp | 141 +++++++++++------- 1 file changed, 86 insertions(+), 55 deletions(-) diff --git a/source/module_hamilt_general/module_xc/xc_functional.cpp b/source/module_hamilt_general/module_xc/xc_functional.cpp index 0f50ebef1f..9e3023b640 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.cpp +++ b/source/module_hamilt_general/module_xc/xc_functional.cpp @@ -2,6 +2,9 @@ #include "module_hamilt_pw/hamilt_pwdft/global.h" #include "module_parameter/parameter.h" #include "module_base/global_function.h" +#ifdef USE_PAW +#include "module_cell/module_paw/paw_cell.h" +#endif #ifdef USE_LIBXC #include "xc_functional_libxc.h" @@ -13,7 +16,6 @@ XC_Functional::~XC_Functional(){} std::vector XC_Functional::func_id(1); int XC_Functional::func_type = 0; -bool XC_Functional::ked_flag = false; bool XC_Functional::use_libxc = true; double XC_Functional::hybrid_alpha = 0.25; std::map XC_Functional::scaling_factor_xc = { {1, 1.0} }; // added by jghan, 2024-10-10 @@ -23,6 +25,15 @@ void XC_Functional::set_hybrid_alpha(const double alpha_in) hybrid_alpha = alpha_in; } +double XC_Functional::get_hybrid_alpha() +{ + return hybrid_alpha; +} + +int XC_Functional::get_func_type() +{ + return func_type; +} void XC_Functional::set_xc_first_loop(const UnitCell& ucell) { /** In the special "two-level" calculation case, @@ -58,98 +69,123 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) scaling_factor_xc.clear(); // added by jghan, 2024-07-07 std::string xc_func = xc_func_in; std::transform(xc_func.begin(), xc_func.end(), xc_func.begin(), (::toupper)); - if( xc_func == "LDA" || xc_func == "PZ" || xc_func == "SLAPZNOGXNOGC") //SLA+PZ - { + if( xc_func == "LDA" || xc_func == "PZ" || xc_func == "SLAPZNOGXNOGC") //SLA+PZ + { func_id.push_back(XC_LDA_X); func_id.push_back(XC_LDA_C_PZ); func_type = 1; use_libxc = false; - } +#ifdef USE_PAW + if(PARAM.inp.use_paw) + { + if(PARAM.inp.nspin != 1) + { + ModuleBase::WARNING_QUIT("set_xc_type","paw does not support pz with spin polarization"); + } + else + { + GlobalC::paw_cell.set_libpaw_xc(1,2); + } + } +#endif + } else if (xc_func == "PWLDA") { func_id.push_back(XC_LDA_X); func_id.push_back(XC_LDA_C_PW); func_type = 1; use_libxc = false; +#ifdef USE_PAW + if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(1,7); +} +#endif } - else if ( xc_func == "PBE" || xc_func == "SLAPWPBXPBC") //PBX+PBC - { + else if ( xc_func == "PBE" || xc_func == "SLAPWPBXPBC") //PBX+PBC + { func_id.push_back(XC_GGA_X_PBE); func_id.push_back(XC_GGA_C_PBE); func_type = 2; use_libxc = false; - } - else if ( xc_func == "PBESOL") //PBX_S+PBC_S - { +#ifdef USE_PAW + if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(2,11); +} +#endif + } + else if ( xc_func == "PBESOL") //PBX_S+PBC_S + { func_id.push_back(XC_GGA_X_PBE_SOL); func_id.push_back(XC_GGA_C_PBE_SOL); func_type = 2; use_libxc = false; - } - else if( xc_func == "REVPBE" ) //PBX_r+PBC - { - func_id.push_back(XC_GGA_X_PBE_R); + } + else if( xc_func == "REVPBE" ) //PBX_r+PBC + { + func_id.push_back(XC_GGA_X_PBE_R); func_id.push_back(XC_GGA_C_PBE); func_type = 2; use_libxc = false; - } - else if ( xc_func == "WC") //WC+PBC - { +#ifdef USE_PAW + if(PARAM.inp.use_paw) { GlobalC::paw_cell.set_libpaw_xc(2,14); +} +#endif + } + else if ( xc_func == "WC") //WC+PBC + { func_id.push_back(XC_GGA_X_WC); func_id.push_back(XC_GGA_C_PBE); func_type = 2; use_libxc = false; - } - else if ( xc_func == "BLYP") //B88+LYP - { + } + else if ( xc_func == "BLYP") //B88+LYP + { func_id.push_back(XC_GGA_X_B88); func_id.push_back(XC_GGA_C_LYP); func_type = 2; use_libxc = false; - } - else if ( xc_func == "BP") //B88+P86 - { + } + else if ( xc_func == "BP") //B88+P86 + { func_id.push_back(XC_GGA_X_B88); func_id.push_back(XC_GGA_C_P86); func_type = 2; use_libxc = false; - } - else if ( xc_func == "PW91") //PW91_X+PW91_C - { + } + else if ( xc_func == "PW91") //PW91_X+PW91_C + { func_id.push_back(XC_GGA_X_PW91); func_id.push_back(XC_GGA_C_PW91); func_type = 2; use_libxc = false; - } - else if ( xc_func == "HCTH") //HCTH_X+HCTH_C - { + } + else if ( xc_func == "HCTH") //HCTH_X+HCTH_C + { func_id.push_back(XC_GGA_X_HCTH_A); func_id.push_back(XC_GGA_C_HCTH_A); func_type = 2; use_libxc = false; - } - else if ( xc_func == "OLYP") //OPTX+LYP - { + } + else if ( xc_func == "OLYP") //OPTX+LYP + { func_id.push_back(XC_GGA_X_OPTX); func_id.push_back(XC_GGA_C_LYP); func_type = 2; use_libxc = false; - } + } #ifdef USE_LIBXC - else if ( xc_func == "SCAN") - { + else if ( xc_func == "SCAN") + { func_id.push_back(XC_MGGA_X_SCAN); func_id.push_back(XC_MGGA_C_SCAN); func_type = 3; use_libxc = true; - } + } else if ( xc_func == "SCAN0") - { + { func_id.push_back(XC_MGGA_X_SCAN); func_id.push_back(XC_MGGA_C_SCAN); func_type = 5; use_libxc = true; - } + } else if( xc_func == "LC_PBE") { func_id.push_back(XC_HYB_GGA_XC_LC_PBEOP); @@ -186,12 +222,12 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) func_type = 4; use_libxc = false; } - else if( xc_func == "PBE0") - { + else if( xc_func == "PBE0") + { func_id.push_back(XC_HYB_GGA_XC_PBEH); func_type = 4; use_libxc = false; - } + } else if( xc_func == "OPT_ORB" || xc_func == "NONE" || xc_func == "NOX+NOC") { // not doing anything @@ -274,33 +310,28 @@ void XC_Functional::set_xc_type(const std::string xc_func_in) #endif } - if (func_type == 3 || func_type == 5) - { - ked_flag = true; - } - else - { - ked_flag = false; - } - if (func_id[0] == XC_GGA_X_OPTX) { std::cerr << "\n OPTX untested please test,"; } - // if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "pw") - // { - // ModuleBase::WARNING_QUIT("set_xc_type","hybrid functional not realized for planewave yet"); - // } + if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "pw") + { + ModuleBase::WARNING_QUIT("set_xc_type","hybrid functional not realized for planewave yet"); + } if((func_type == 3 || func_type == 5) && PARAM.inp.nspin==4) { ModuleBase::WARNING_QUIT("set_xc_type","meta-GGA has not been implemented for nspin = 4 yet"); } + //if((func_type == 3 || func_type == 5) && PARAM.inp.cal_stress == 1 && PARAM.inp.nspin!=1) + //{ + // ModuleBase::WARNING_QUIT("set_xc_type","mgga stress not implemented for polarized case yet"); + //} #ifndef __EXX - if((func_type == 4 || func_type == 5) && PARAM.inp.basis_type == "lcao") + if(func_type == 4 || func_type == 5) { - ModuleBase::WARNING_QUIT("set_xc_type","compile with libri to use hybrid functional in lcao basis"); + ModuleBase::WARNING_QUIT("set_xc_type","compile with libri to use hybrid functional"); } #endif From 601569f1ebc15cf3e7610f981e4e8e7966df8677 Mon Sep 17 00:00:00 2001 From: ahxbcn <2092233074@qq.com> Date: Tue, 21 Oct 2025 17:39:54 +0800 Subject: [PATCH 3/3] Revert changes in xc_functional.h --- .../module_xc/xc_functional.h | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/source/module_hamilt_general/module_xc/xc_functional.h b/source/module_hamilt_general/module_xc/xc_functional.h index 35f6a35016..379322a689 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.h +++ b/source/module_hamilt_general/module_xc/xc_functional.h @@ -64,22 +64,12 @@ class XC_Functional // func_type, which is as specified in get_func_type // use_libxc, whether to use LIBXC. The rule is to NOT use it for functionals that we already have. - static int get_func_type() - { - return func_type; - }; + static int get_func_type(); static void set_xc_type(const std::string xc_func_in); // For hybrid functional static void set_hybrid_alpha(const double alpha_in); - static double get_hybrid_alpha() - { - return hybrid_alpha; - }; - static bool get_ked_flag() - { - return ked_flag; - }; + static double get_hybrid_alpha(); /// Usually in exx caculation, the first SCF loop should be converged with PBE static void set_xc_first_loop(const UnitCell& ucell); @@ -87,11 +77,10 @@ class XC_Functional static std::vector func_id; // libxc id of functional static int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga - static bool ked_flag; // whether the functional has kinetic energy density - static bool use_libxc; + static bool use_libxc; - // exx_hybrid_alpha for mixing exx in hybrid functional: - static double hybrid_alpha; + //exx_hybrid_alpha for mixing exx in hybrid functional: + static double hybrid_alpha; // added by jghan, 2024-07-07 // as a scaling factor for different xc-functionals