@@ -114,23 +114,33 @@ void Exx_LRI_Interface<T, Tdata>::exx_beforescf(const int istep,
114114}
115115
116116template <typename T, typename Tdata>
117- void Exx_LRI_Interface<T, Tdata>::exx_eachiterinit(const int istep, const elecstate::DensityMatrix<T, double >& dm, const K_Vectors& kv, const int & iter)
117+ void Exx_LRI_Interface<T, Tdata>::exx_eachiterinit(const int istep,
118+ const UnitCell& ucell,
119+ const elecstate::DensityMatrix<T, double >& dm,
120+ const K_Vectors& kv,
121+ const int & iter)
118122{
119123 if (GlobalC::exx_info.info_global .cal_exx )
120124 {
121125 if (!GlobalC::exx_info.info_global .separate_loop && (this ->two_level_step || istep > 0 ))
122126 {
123127 const bool flag_restart = (iter == 1 ) ? true : false ;
124- auto cal = [this , &kv, &flag_restart](const elecstate::DensityMatrix<T, double >& dm_in)
128+ auto cal = [this , &ucell,& kv, &flag_restart](const elecstate::DensityMatrix<T, double >& dm_in)
125129 {
126130 if (this ->exx_spacegroup_symmetry ) { this ->mix_DMk_2D .mix (symrot_.restore_dm (kv,dm_in.get_DMK_vector (), *dm_in.get_paraV_pointer ()), flag_restart); }
127131 else { this ->mix_DMk_2D .mix (dm_in.get_DMK_vector (), flag_restart); }
128132 const std::vector<std::map<int ,std::map<std::pair<int , std::array<int , 3 >>,RI::Tensor<Tdata>>>>
129133 Ds = PARAM.globalv .gamma_only_local
130134 ? RI_2D_Comm::split_m2D_ktoR<Tdata>(*this ->exx_ptr ->p_kv , this ->mix_DMk_2D .get_DMk_gamma_out (), *dm_in.get_paraV_pointer (), PARAM.inp .nspin )
131135 : RI_2D_Comm::split_m2D_ktoR<Tdata>(*this ->exx_ptr ->p_kv , this ->mix_DMk_2D .get_DMk_k_out (), *dm_in.get_paraV_pointer (), PARAM.inp .nspin , this ->exx_spacegroup_symmetry );
132- if (this ->exx_spacegroup_symmetry && GlobalC::exx_info.info_global .exx_symmetry_realspace ) { this ->exx_ptr ->cal_exx_elec (Ds, *dm_in.get_paraV_pointer (), &this ->symrot_ ); }
133- else { this ->exx_ptr ->cal_exx_elec (Ds, *dm_in.get_paraV_pointer ()); }
136+ if (this ->exx_spacegroup_symmetry && GlobalC::exx_info.info_global .exx_symmetry_realspace )
137+ {
138+ this ->exx_ptr ->cal_exx_elec (Ds, ucell,*dm_in.get_paraV_pointer (), &this ->symrot_ );
139+ }
140+ else
141+ {
142+ this ->exx_ptr ->cal_exx_elec (Ds, ucell,*dm_in.get_paraV_pointer ());
143+ }
134144 };
135145 if (istep > 0 && flag_restart) {
136146 cal (*dm_last_step);
@@ -326,13 +336,13 @@ bool Exx_LRI_Interface<T, Tdata>::exx_after_converge(
326336
327337 if (this ->exx_spacegroup_symmetry && GlobalC::exx_info.info_global .exx_symmetry_realspace )
328338 {
329- this ->exx_ptr ->cal_exx_elec (Ds, *dm.get_paraV_pointer (), &this ->symrot_ );
339+ this ->exx_ptr ->cal_exx_elec (Ds, ucell, *dm.get_paraV_pointer (), &this ->symrot_ );
330340 // this->symrot_.print_HR(this->exx_ptr->Hexxs[0], "Hexxs_irreducible"); // test
331341 // this->symrot_.print_HR(this->exx_ptr->Hexxs[0], "Hexxs_restored", 1e-10); // test
332342 }
333343 else
334344 {
335- this ->exx_ptr ->cal_exx_elec (Ds, *dm.get_paraV_pointer ()); // restore DM but not Hexx
345+ this ->exx_ptr ->cal_exx_elec (Ds, ucell, *dm.get_paraV_pointer ()); // restore DM but not Hexx
336346 // this->symrot_.print_HR(this->exx_ptr->Hexxs[0], "Hexxs_restore-DM-only"); // test
337347 // this->symrot_.print_HR(this->exx_ptr->Hexxs[0], "Hexxs_ref"); // test
338348 }
0 commit comments