Skip to content

Commit

Permalink
initial the file : source/module_ri/RI_2D_Comm.cpp and ABF_Construct (#…
Browse files Browse the repository at this point in the history
…3898)

* initial the file source/module_ri/RI_2D_Comm.cpp

* the second initialization of module_ri/RI_2D_Comm.cpp

* initialize the file ABFS-Construct-PCA

* initialize the file ABF_Costruct_

* initialize the file ABFs_Construct-PCA.cpp

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
  • Loading branch information
RobertRainbow and mohanchen committed Apr 5, 2024
1 parent 2065971 commit 3d1ad16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/module_ri/ABFs_Construct-PCA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace ABFs_Construct::PCA
const int nr = a.shape[0];
const int nc = a.shape[1];

double work_tmp;
double work_tmp=0.0;
constexpr int minus_one = -1;
dsyev_(&jobz, &uplo, &nr, a.ptr(), &nc, w, &work_tmp, &minus_one, &info); // get best lwork

Expand Down Expand Up @@ -117,7 +117,7 @@ namespace ABFs_Construct::PCA
RI::Tensor<double> mm = A_sub.transpose() * A_sub;
std::vector<double> eig_value(mm.shape[0]);

int info;
int info=1;

tensor_dsyev('V', 'L', mm, eig_value.data(), info);

Expand Down Expand Up @@ -150,4 +150,4 @@ namespace ABFs_Construct::PCA
return eig;
}

} // namespace ABFs_Construct::PCA
} // namespace ABFs_Construct::PCA
7 changes: 4 additions & 3 deletions source/module_ri/RI_2D_Comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ auto RI_2D_Comm::get_2D_judge(const Parallel_Orbitals &pv)
for (int iwt0_2D = 0; iwt0_2D < pv.nrow; ++iwt0_2D)
{
const int iwt0 = pv.local2global_row(iwt0_2D);
int iat0, iw0_b, is0_b;
int iat0=0;int iw0_b=0;int is0_b=0;
std::tie(iat0,iw0_b,is0_b) = RI_2D_Comm::get_iat_iw_is_block(iwt0);
iat0_list[is0_b].insert(iat0);
}
Expand All @@ -31,7 +31,7 @@ auto RI_2D_Comm::get_2D_judge(const Parallel_Orbitals &pv)
for (int iwt1_2D = 0; iwt1_2D < pv.ncol; ++iwt1_2D)
{
const int iwt1 = pv.local2global_col(iwt1_2D);
int iat1, iw1_b, is1_b;
int iat1=0;int iw1_b=0;int is1_b=0;
std::tie(iat1,iw1_b,is1_b) = RI_2D_Comm::get_iat_iw_is_block(iwt1);
iat1_list[is1_b].insert(iat1);
}
Expand Down Expand Up @@ -68,4 +68,5 @@ RI_2D_Comm::get_ik_list(const K_Vectors &kv, const int is_k)
if(kv.isk[ik]==is_k)
ik_list.push_back(ik);
return ik_list;
}
}

0 comments on commit 3d1ad16

Please sign in to comment.