diff --git a/source/module_hsolver/hsolver_lcaopw.cpp b/source/module_hsolver/hsolver_lcaopw.cpp index 932ee666b8..bee6e1a840 100644 --- a/source/module_hsolver/hsolver_lcaopw.cpp +++ b/source/module_hsolver/hsolver_lcaopw.cpp @@ -123,16 +123,20 @@ namespace hsolver auto& exx_lip = dynamic_cast*>(pHamilt)->exx_lip; auto add_exx_to_subspace_hamilt = [&ik, &exx_lip](T* hcc, const int naos) -> void { - if (GlobalC::exx_info.info_global.cal_exx) - for (int n = 0; n < naos; ++n) - for (int m = 0; m < naos; ++m) + if (GlobalC::exx_info.info_global.cal_exx) { + for (int n = 0; n < naos; ++n) { + for (int m = 0; m < naos; ++m) { hcc[n * naos + m] += (T)GlobalC::exx_info.info_global.hybrid_alpha * exx_lip.get_exx_matrix()[ik][m][n]; +} +} +} }; auto set_exxlip_lcaowfc = [&ik, &exx_lip](const T* const vcc, const int naos, const int nbands) -> void { - if (GlobalC::exx_info.info_global.cal_exx) + if (GlobalC::exx_info.info_global.cal_exx) { exx_lip.set_hvec(ik, vcc, naos, nbands); +} }; #endif hsolver::DiagoIterAssist::diagH_subspace_init( diff --git a/source/module_io/write_Vxc.hpp b/source/module_io/write_Vxc.hpp index f50995bfeb..a87ef6f276 100644 --- a/source/module_io/write_Vxc.hpp +++ b/source/module_io/write_Vxc.hpp @@ -304,8 +304,9 @@ void write_Vxc(int nspin, // R (the number of hR: 1 for nspin=1, 4; 2 for nspin=2) int nspin0 = (nspin == 2) ? 2 : 1; std::vector> vxcs_R_ao(nspin0, hamilt::HContainer(pv)); - for (int is = 0; is < nspin0; ++is) + for (int is = 0; is < nspin0; ++is) { vxcs_R_ao[is].set_zero(); +} // k (size for each k-point) hamilt::HS_Matrix_K vxc_k_ao(pv, 1); // only hk is needed, sk is skipped