From d2c534b73c53cb641bdd3dd82b9a94a3a96788a0 Mon Sep 17 00:00:00 2001 From: someone Date: Wed, 21 Jan 2026 01:19:49 +0800 Subject: [PATCH] Add tests --- source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp | 2 +- source/source_pw/module_pwdft/operator_pw/exx_pw_ace.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp index 1b41163967..81922729d8 100644 --- a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp +++ b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp @@ -26,7 +26,7 @@ bool Exx_Helper::exx_after_converge(int &iter, bool ene_conv) { return true; } - else if (iter >= PARAM.inp.exx_hybrid_step) + else if (exx_iter >= PARAM.inp.exx_hybrid_step) { GlobalV::ofs_running << " !!EXX IS NOT CONVERGED!!" << std::endl; std::cout << " !!EXX IS NOT CONVERGED!!" << std::endl; diff --git a/source/source_pw/module_pwdft/operator_pw/exx_pw_ace.cpp b/source/source_pw/module_pwdft/operator_pw/exx_pw_ace.cpp index 1e62477e5d..1fd14dced9 100644 --- a/source/source_pw/module_pwdft/operator_pw/exx_pw_ace.cpp +++ b/source/source_pw/module_pwdft/operator_pw/exx_pw_ace.cpp @@ -1,6 +1,7 @@ #include "op_exx_pw.h" #include "source_base/parallel_comm.h" #include "source_io/module_parameter/parameter.h" +#include "source_pw/module_pwdft/global.h" namespace hamilt { @@ -311,6 +312,7 @@ double OperatorEXXPW::cal_exx_energy_ace(psi::Psi* ppsi_) psi::Psi psi_ = *ppsi_; int* ik_ = const_cast(&this->ik); int ik_save = this->ik; + Real hybrid_alpha = GlobalC::exx_info.info_global.hybrid_alpha; for (int i = 0; i < wfcpw->nks; i++) { setmem_complex_op()(h_psi_ace, 0, psi_.get_nbands() * psi_.get_nbasis()); @@ -332,6 +334,7 @@ double OperatorEXXPW::cal_exx_energy_ace(psi::Psi* ppsi_) Parallel_Reduce::reduce_all(Eexx); *ik_ = ik_save; + Eexx = Eexx / hybrid_alpha / 4; return Eexx; } template class OperatorEXXPW, base_device::DEVICE_CPU>;