Skip to content

Commit

Permalink
rename and update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Nov 7, 2024
1 parent ac9b788 commit 2574013
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions source/module_io/read_input_item_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
{
Expand Down
2 changes: 1 addition & 1 deletion source/module_io/test/read_input_ptest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/module_lr/potentials/pot_hxc_lrtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>& lr_init_xc_kernel = { "from_chg_groundstate" });
const SpinType& st = SpinType::S1, const std::vector<std::string>& lr_init_xc_kernel = { "default" });
~PotHxcLR() {}
void cal_v_eff(double** rho, const UnitCell& ucell, ModuleBase::matrix& v_eff, const std::vector<int>& ispin_op = { 0,0 });
const int& nrxx = nrxx_;
Expand Down
2 changes: 1 addition & 1 deletion source/module_lr/potentials/xc_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2574013

Please sign in to comment.