Skip to content

Commit

Permalink
fix: close mixing_gg0 after PBE-loop in no-separate-loop EXX process
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Sep 4, 2024
1 parent 731388d commit 8656c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/module_elecstate/module_charge/charge_mixing.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Charge_Mixing
const double& mixing_angle_in,
const bool& mixing_dmr_in);

void close_kerker_gg0() { mixing_gg0 = 0.0; mixing_gg0_mag = 0.0; }
/**
* @brief initialize mixing, including constructing mixing and allocating memory for mixing data
* @brief this function should be called at eachiterinit()
Expand Down
4 changes: 4 additions & 0 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,10 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(int& iter)

if (GlobalC::exx_info.info_global.cal_exx && this->conv_elec)
{
// Kerker mixing does not work for the density matrix.
// In the separate loop case, it can still work in the subsequent inner loops where Hexx(DM) is fixed.
// In the non-separate loop case where Hexx(DM) is updated in every iteration of the 2nd loop, it should be closed.
if (!GlobalC::exx_info.info_global.separate_loop) { this->p_chgmix->close_kerker_gg0(); }
if (GlobalC::exx_info.info_ri.real_number)
{
this->conv_elec = this->exd->exx_after_converge(
Expand Down

0 comments on commit 8656c3e

Please sign in to comment.