diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 0dc808e806..40c71e9118 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -420,6 +420,7 @@ - [pexsi\_zero\_thr](#pexsi_zero_thr) - [Linear Response TDDFT](#linear-response-tddft) - [xc\_kernel](#xc_kernel) + - [lr\_init\_xc\_kernel](#lr_init_xc_kernel) - [lr\_solver](#lr_solver) - [lr\_thr](#lr_thr) - [nocc](#nocc) @@ -3921,10 +3922,10 @@ Currently supported: `RPA`, `LDA`, `PBE`, `HSE`, `HF`. - **Type**: String - **Description**: The method to initalize the xc kernel. - - "from_chg_groundstate": Calculate xc kerenel ($f_\text{xc}$) from the ground-state charge density. - - "file": Read the xc kernel $f_\text{xc}$ on grid from the provided files. The following words should be the paths of ".cube" files, where the first 3 (spin-aa, spin-ab and spin-bb) will be read in. The parameter [xc_kernel](#xc_kernel) will be invalid. Now only LDA-type kernel is supproted as the potential will be calculated by directly multiplying the transition density. - - "from_chg_file": Calculate fxc from the charge density read from the provided files. The following words should be the paths of ".cube" files, where the first [nspin]($nspin) files will be read in. -- **Default**: "from_chg_groundstate" + - "default": Calculate xc kerenel ($f_\text{xc}$) from the ground-state charge density. + - "file": Read the xc kernel $f_\text{xc}$ on grid from the provided files. The following words should be the paths of ".cube" files, where the first 1 (*[nspin](#nspin)==1*) or 3 (*[nspin](#nspin)==2*, namely spin-aa, spin-ab and spin-bb) will be read in. The parameter [xc_kernel](#xc_kernel) will be invalid. Now only LDA-type kernel is supproted as the potential will be calculated by directly multiplying the transition density. + - "from_charge_file": Calculate fxc from the charge density read from the provided files. The following words should be the paths of ".cube" files, where the first [nspin]($nspin) files will be read in. +- **Default**: "default" ### lr_solver diff --git a/source/module_io/read_input_item_tddft.cpp b/source/module_io/read_input_item_tddft.cpp index ce71273dc7..bfd0542729 100644 --- a/source/module_io/read_input_item_tddft.cpp +++ b/source/module_io/read_input_item_tddft.cpp @@ -318,9 +318,9 @@ void ReadInput::item_lr_tddft() for (int i = 0; i < count; i++) { ifxc.push_back(item.str_values[i]); } }; item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.lr_init_xc_kernel.empty()) { para.input.lr_init_xc_kernel.push_back("from_chg_groundstate"); } + if (para.input.lr_init_xc_kernel.empty()) { para.input.lr_init_xc_kernel.push_back("default"); } }; - sync_stringvec(input.lr_init_xc_kernel, para.input.lr_init_xc_kernel.size(), "from_chg_groundstate"); + sync_stringvec(input.lr_init_xc_kernel, para.input.lr_init_xc_kernel.size(), "default"); this->add_item(item); } { diff --git a/source/module_io/test/read_input_ptest.cpp b/source/module_io/test/read_input_ptest.cpp index e0b8beac7a..f205567969 100644 --- a/source/module_io/test/read_input_ptest.cpp +++ b/source/module_io/test/read_input_ptest.cpp @@ -417,7 +417,7 @@ TEST_F(InputParaTest, ParaRead) EXPECT_EQ(param.inp.nocc, param.inp.nbands); EXPECT_EQ(param.inp.nvirt, 1); EXPECT_EQ(param.inp.xc_kernel, "LDA"); - EXPECT_EQ(param.inp.lr_init_xc_kernel[0], "from_chg_groundstate"); + EXPECT_EQ(param.inp.lr_init_xc_kernel[0], "default"); EXPECT_EQ(param.inp.lr_solver, "dav"); EXPECT_DOUBLE_EQ(param.inp.lr_thr, 1e-2); EXPECT_FALSE(param.inp.lr_unrestricted); diff --git a/source/module_lr/potentials/pot_hxc_lrtd.h b/source/module_lr/potentials/pot_hxc_lrtd.h index f7b78355d7..c165999ffb 100644 --- a/source/module_lr/potentials/pot_hxc_lrtd.h +++ b/source/module_lr/potentials/pot_hxc_lrtd.h @@ -19,7 +19,7 @@ namespace LR /// constructor for exchange-correlation kernel PotHxcLR(const std::string& xc_kernel, const ModulePW::PW_Basis& rho_basis, const UnitCell& ucell, const Charge& chg_gs/*ground state*/, const Parallel_Grid& pgrid, - const SpinType& st = SpinType::S1, const std::vector& lr_init_xc_kernel = { "from_chg_groundstate" }); + const SpinType& st = SpinType::S1, const std::vector& lr_init_xc_kernel = { "default" }); ~PotHxcLR() {} void cal_v_eff(double** rho, const UnitCell& ucell, ModuleBase::matrix& v_eff, const std::vector& ispin_op = { 0,0 }); const int& nrxx = nrxx_; diff --git a/source/module_lr/potentials/xc_kernel.cpp b/source/module_lr/potentials/xc_kernel.cpp index 021c77ba3b..f5fa4f8fc8 100644 --- a/source/module_lr/potentials/xc_kernel.cpp +++ b/source/module_lr/potentials/xc_kernel.cpp @@ -44,7 +44,7 @@ LR::KernelXC::KernelXC(const ModulePW::PW_Basis& rho_basis, } #ifdef USE_LIBXC - if (lr_init_xc_kernel[0] == "from_chg_file") + if (lr_init_xc_kernel[0] == "from_charge_file") { assert(lr_init_xc_kernel.size() >= 2); double** rho_for_fxc;