Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: close mixing_gg0 after PBE-loop in no-separate-loop EXX process #5034

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading