Skip to content

Commit

Permalink
small fix in LR
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Sep 27, 2024
1 parent ba0cb21 commit 3afeb3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/module_lr/esolver_lrtd_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
template<>
void LR::ESolver_LR<double>::move_exx_lri(std::shared_ptr<Exx_LRI<double>>& exx_ks)
{
ModuleBase::TITLE("ESolver_LR<double>", "move_exx_lri");
this->exx_lri = exx_ks;
exx_ks = nullptr;
}
template<>
void LR::ESolver_LR<std::complex<double>>::move_exx_lri(std::shared_ptr<Exx_LRI<std::complex<double>>>& exx_ks)
{
ModuleBase::TITLE("ESolver_LR<complex>", "move_exx_lri");
this->exx_lri = exx_ks;
exx_ks = nullptr;
}
Expand Down Expand Up @@ -128,7 +130,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
#endif
{
redirect_log(inp.out_alllog);
ModuleBase::TITLE("ESolver_LR", "ESolver_LR");
ModuleBase::TITLE("ESolver_LR", "ESolver_LR(KS)");

if (this->input.lr_solver == "spectrum") {
throw std::invalid_argument("when lr_solver==spectrum, esolver_type must be set to `lr` to skip the KS calculation.");
Expand Down Expand Up @@ -226,7 +228,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(const Input_para& inp, UnitCell& ucell) : inpu
#endif
{
redirect_log(inp.out_alllog);
ModuleBase::TITLE("ESolver_LR", "ESolver_LR");
ModuleBase::TITLE("ESolver_LR", "ESolver_LR(from scratch)");
// xc kernel
this->xc_kernel = inp.xc_kernel;
std::transform(xc_kernel.begin(), xc_kernel.end(), xc_kernel.begin(), tolower);
Expand Down
2 changes: 1 addition & 1 deletion source/module_lr/operator_casida/operator_lr_exx.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace LR
const int& naos;
const int& nocc;
const int& nvirt;
const double& alpha;
const double alpha = 1.0; //(allow non-ref constant)
const bool cal_dm_trans = false;
const bool tdm_sym = false; ///< whether transition density matrix is symmetric
const K_Vectors& kv;
Expand Down
1 change: 1 addition & 0 deletions source/module_ri/Exx_LRI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void Exx_LRI<Tdata>::cal_exx_ions(const bool write_cv)
list_As_Vs.first, list_As_Vs.second[0],
{{"writable_Vws",true}});
this->cv.Vws = LRI_CV_Tools::get_CVws(Vs);
if (write_cv && GlobalV::MY_RANK == 0) { LRI_CV_Tools::write_Vs_abf(Vs, PARAM.globalv.global_out_dir + "Vs"); }
this->exx_lri.set_Vs(std::move(Vs), this->info.V_threshold);

if(PARAM.inp.cal_force || PARAM.inp.cal_stress)
Expand Down

0 comments on commit 3afeb3e

Please sign in to comment.