@@ -29,7 +29,12 @@ inline RI::Tensor<std::complex<double>> tensor_conj(const RI::Tensor<std::comple
2929 return r;
3030}
3131template <typename Tdata, typename Tmatrix>
32- auto RI_2D_Comm::split_m2D_ktoR (const K_Vectors & kv, const std::vector<const Tmatrix*>&mks_2D, const Parallel_2D & pv, const int nspin, const bool spgsym)
32+ auto RI_2D_Comm::split_m2D_ktoR (const UnitCell& ucell,
33+ const K_Vectors & kv,
34+ const std::vector<const Tmatrix*>&mks_2D,
35+ const Parallel_2D & pv,
36+ const int nspin,
37+ const bool spgsym)
3338-> std::vector<std::map<TA,std::map<TAC,RI::Tensor<Tdata>>>>
3439{
3540 ModuleBase::TITLE (" RI_2D_Comm" ," split_m2D_ktoR" );
@@ -63,7 +68,7 @@ auto RI_2D_Comm::split_m2D_ktoR(const K_Vectors & kv, const std::vector<const Tm
6368 RI::Tensor<Tdata_m> mk_2D = RI_Util::Vector_to_Tensor<Tdata_m>(*mks_2D[ik], pv.get_col_size (), pv.get_row_size ());
6469 const Tdata_m frac = SPIN_multiple
6570 * RI::Global_Func::convert<Tdata_m>(std::exp (
66- -ModuleBase::TWO_PI * ModuleBase::IMAG_UNIT * (kv.kvec_c [ik] * (RI_Util::array3_to_Vector3 (cell) * GlobalC:: ucell.latvec ))));
71+ -ModuleBase::TWO_PI * ModuleBase::IMAG_UNIT * (kv.kvec_c [ik] * (RI_Util::array3_to_Vector3 (cell) * ucell.latvec ))));
6772 if (static_cast <int >(std::round (SPIN_multiple * kv.wk [ik] * kv.get_nkstot_full ())) == 2 )
6873 { set_mR_2D (mk_2D * (frac * 0.5 ) + tensor_conj (mk_2D * (frac * 0.5 ))); }
6974 else { set_mR_2D (mk_2D * frac); }
@@ -75,7 +80,7 @@ auto RI_2D_Comm::split_m2D_ktoR(const K_Vectors & kv, const std::vector<const Tm
7580 RI::Tensor<Tdata_m> mk_2D = RI_Util::Vector_to_Tensor<Tdata_m>(*mks_2D[ik_full + is_k * kv.get_nkstot_full ()], pv.get_col_size (), pv.get_row_size ());
7681 const Tdata_m frac = SPIN_multiple
7782 * RI::Global_Func::convert<Tdata_m>(std::exp (
78- -ModuleBase::TWO_PI * ModuleBase::IMAG_UNIT * ((isym_kvd.second * GlobalC:: ucell.G ) * (RI_Util::array3_to_Vector3 (cell) * GlobalC:: ucell.latvec ))));
83+ -ModuleBase::TWO_PI * ModuleBase::IMAG_UNIT * ((isym_kvd.second * ucell.G ) * (RI_Util::array3_to_Vector3 (cell) * ucell.latvec ))));
7984 set_mR_2D (mk_2D * frac);
8085 ++ik_full;
8186 }
@@ -87,24 +92,24 @@ auto RI_2D_Comm::split_m2D_ktoR(const K_Vectors & kv, const std::vector<const Tm
8792 ? pv.local2global_col (iwt0_2D)
8893 : pv.local2global_row (iwt0_2D);
8994 int iat0, iw0_b, is0_b;
90- std::tie (iat0,iw0_b,is0_b) = RI_2D_Comm::get_iat_iw_is_block (iwt0);
95+ std::tie (iat0,iw0_b,is0_b) = RI_2D_Comm::get_iat_iw_is_block (ucell, iwt0);
9196 const int it0 = GlobalC::ucell.iat2it [iat0];
9297 for (int iwt1_2D=0 ; iwt1_2D!=mR_2D .shape [1 ]; ++iwt1_2D)
9398 {
9499 const int iwt1 =ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER (PARAM.inp .ks_solver )
95100 ? pv.local2global_row (iwt1_2D)
96101 : pv.local2global_col (iwt1_2D);
97102 int iat1, iw1_b, is1_b;
98- std::tie (iat1,iw1_b,is1_b) = RI_2D_Comm::get_iat_iw_is_block (iwt1);
103+ std::tie (iat1,iw1_b,is1_b) = RI_2D_Comm::get_iat_iw_is_block (ucell, iwt1);
99104 const int it1 = GlobalC::ucell.iat2it [iat1];
100105
101106 const int is_b = RI_2D_Comm::get_is_block (is_k, is0_b, is1_b);
102107 RI::Tensor<Tdata> &mR_a2D = mRs_a2D [is_b][iat0][{iat1,cell}];
103108 if (mR_a2D .empty ()) {
104109 mR_a2D = RI::Tensor<Tdata>(
105- {static_cast <size_t >(GlobalC:: ucell.atoms [it0].nw ),
110+ {static_cast <size_t >(ucell.atoms [it0].nw ),
106111 static_cast <size_t >(
107- GlobalC:: ucell.atoms [it1].nw )});
112+ ucell.atoms [it1].nw )});
108113 }
109114 mR_a2D (iw0_b,iw1_b) = mR_2D (iwt0_2D, iwt1_2D);
110115 }
@@ -165,7 +170,7 @@ void RI_2D_Comm::add_Hexx(
165170}
166171
167172std::tuple<int ,int ,int >
168- RI_2D_Comm::get_iat_iw_is_block (const int iwt)
173+ RI_2D_Comm::get_iat_iw_is_block (const UnitCell& ucell, const int & iwt)
169174{
170175 const int iat = GlobalC::ucell.iwt2iat [iwt];
171176 const int iw = GlobalC::ucell.iwt2iw [iwt];
0 commit comments