@@ -265,20 +265,7 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
265265 this ->allocate_hamilt (ucell);
266266
267267 // ----------------------------------------------------------
268- // ! 4) Exx calculations
269- // ----------------------------------------------------------
270- if (PARAM.inp .calculation == " scf" || PARAM.inp .calculation == " relax" || PARAM.inp .calculation == " cell-relax"
271- || PARAM.inp .calculation == " md" )
272- {
273- if (GlobalC::exx_info.info_global .cal_exx && PARAM.inp .basis_type == " pw" )
274- {
275- auto hamilt_pw = reinterpret_cast <hamilt::HamiltPW<T, Device>*>(this ->p_hamilt );
276- hamilt_pw->set_exx_helper (exx_helper);
277- }
278- }
279-
280- // ----------------------------------------------------------
281- // ! 4.5) DFT-1/2 calculations, sep potential need to generate before effective potential calculation
268+ // ! 4) DFT-1/2 calculations, sep potential need to generate before effective potential calculation
282269 // ----------------------------------------------------------
283270 if (PARAM.inp .dfthalf_type > 0 )
284271 {
@@ -383,6 +370,8 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
383370 {
384371 if (GlobalC::exx_info.info_global .cal_exx && PARAM.inp .basis_type == " pw" )
385372 {
373+ auto hamilt_pw = reinterpret_cast <hamilt::HamiltPW<T, Device>*>(this ->p_hamilt );
374+ hamilt_pw->set_exx_helper (exx_helper);
386375 exx_helper.set_psi (kspw_psi);
387376 }
388377 }
0 commit comments