7 inline void print_global(
const TR* tlocal,
const int nr,
const int nc,
const std::string name)
10 for (
int i = 0;i < nr;++i)
20 for (
int i = 0; i < pv.
para_2d().nrloc(); ++i)
22 for (
int j = 0; j < pv.
para_2d().ncloc(); ++j)
41 const std::vector<int>& iat2it,
const std::vector<int>& iat2ia,
const char mode,
47 for (
auto& apR_isym_irapR : this->
irs_.full_map_to_irreducible_sector_)
49 const Tap& ap = apR_isym_irapR.first.first;
50 const TC& R = apR_isym_irapR.first.second;
51 const int& isym = apR_isym_irapR.second.first;
52 const Tap& irap = apR_isym_irapR.second.second.first;
53 const TC& irR = apR_isym_irapR.second.second.second;
54 assert(irR == this->
irs_.rotate_R(symm, isym, ap.first, ap.second, R));
57 const int irR_hc = irap_hc.
find_R(irR[0], irR[1], irR[2]);
58 if (irR_hc < 0)
continue;
61 const int R_hc = ap_hc.
find_R(R[0], R[1], R[2]);
62 if (R_hc < 0)
continue;
71 for (
int i = 0;i < block.
nr;++i)
72 for (
int j = 0;j < block.
nc;++j)
73 obj[starti + i + (startj + j) * nr] = block(j, i).
real();
77 for (
int i = 0;i < block.
nr;++i)
78 for (
int j = 0;j < block.
nc;++j)
79 obj[starti + i + (startj + j) * nr] = block(j, i);
83 const std::vector<int>& iat2it,
const std::vector<int>& iat2ia,
87 int iat1 = ap_in.first, iat2 = ap_in.second;
88 int it1 = iat2it[iat1], it2 = iat2it[iat2];
89 int ia1 = iat2ia[iat1], ia2 = iat2ia[iat2];
91 std::vector<TR> T1, T2;
94 T.resize(atoms[it].nw * atoms[it].nw, 0.0);
95 const int iwstart = atoms[it].
stapos_wf + ia * atoms[it].
nw;
97 while (iw < atoms[it].nw)
99 int l = atoms[it].
iw2l[iw];
111 std::vector<TR> A(atoms[it1].nw * atoms[it2].nw, 0.0);
114 if (abr1 >= 0 && abc2 >= 0)
119 + (pv.
para_2d().icglb(j + abc2) - iw2start)]
126 const char notrans =
'N', transpose =
'T', dagger =
'C';
128 std::vector<TR> AT2(atoms[it1].nw * atoms[it2].nw, 0.0);
129 std::vector<TR> TAT(atoms[it1].nw * atoms[it2].nw, 0.0);
133 1.0, A.data(), atoms[it2].
nw, T2.data(), atoms[it2].
nw, 0.0, AT2.data(), atoms[it2].
nw);
135 1.0, T1.data(), atoms[it1].
nw, AT2.data(), atoms[it2].
nw, 0.0, TAT.data(), atoms[it2].
nw);
137 else if (mode ==
'D')
140 1.0, T2.data(), atoms[it2].
nw, A.data(), atoms[it2].
nw, 0.0, AT2.data(), atoms[it1].
nw);
142 1.0, T1.data(), atoms[it1].
nw, AT2.data(), atoms[it1].
nw, 0.0, TAT.data(), atoms[it2].
nw);
144 else throw std::invalid_argument(
"Symmetry_rotation::rotate_atompair_tensor: invalid mode.");
155 iat1 = ap_out.first, iat2 = ap_out.second;
156 it1 = iat2it[iat1], it2 = iat2it[iat2];
157 ia1 = iat2ia[iat1], ia2 = iat2ia[iat2];
159 iw1start = atoms[it1].
stapos_wf + ia1 * atoms[it1].
nw;
160 iw2start = atoms[it2].
stapos_wf + ia2 * atoms[it2].
nw;
161 if (abr1 >= 0 && abc2 >= 0)
166 = TAT[(pv.
para_2d().irglb(i + abr1) - iw1start) * atoms[it2].
nw
167 + (pv.
para_2d().icglb(j + abc2) - iw2start)];
Atom class for storing atom information.
Definition atom_spec.h:14
int nw
number of local orbitals (l,n,m) of this type
Definition atom_spec.h:36
int stapos_wf
start position of wave functions
Definition atom_spec.h:49
std::vector< int > iw2l
use iw to find L
Definition atom_spec.h:33
static void gemm(const char transa, const char transb, const int m, const int n, const int k, const float alpha, const float *a, const int lda, const float *b, const int ldb, const float beta, float *c, const int ldc, base_device::AbacusDevice_t device_type=base_device::AbacusDevice_t::CpuDevice)
Definition blas_connector_matrix.cpp:27
Definition complexmatrix.h:11
int nr
Definition complexmatrix.h:15
matrix real() const
Definition complexmatrix.cpp:265
int nc
Definition complexmatrix.h:16
static void start(void)
Start total time calculation.
Definition timer.cpp:44
static void end(const std::string &class_name_in, const std::string &name_in)
Definition timer.cpp:109
Irred_Sector irs_
irreducible sector
Definition symm_rotation_k.h:190
std::vector< std::vector< ModuleBase::ComplexMatrix > > rotmat_Slm_
the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]
Definition symm_rotation_k.h:167
void rotate_atompair_parallel(const TR *Alocal_in, const int isym, const Atom *atoms, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const Tap &ap_in, const Tap &ap_out, const char mode, const Parallel_Orbitals &pv, TR *Alocal_out, const bool output=false) const
Definition symm_rotation_r_hcontainer.hpp:82
std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > restore_HR(const Symmetry &symm, const Atom *atoms, const std::vector< int > &iat2it, const char mode, const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > &HR_irreduceble) const
Definition symm_rotation_r.hpp:79
RI::Tensor< Tdata > set_rotation_matrix(const Atom &a, const int &isym) const
Definition symm_rotation_r.hpp:295
Symmetry analysis class.
Definition symmetry.h:24
int irglb(const int irloc) const
Definition parallel_blkcyc.h:88
int ncloc() const
Definition parallel_blkcyc.h:40
Definition parallel_orbitals.h:16
int get_nrow_atom(int iat) const
Definition parallel_orbitals.cpp:110
int get_ncol_atom(int iat) const
dimension getters for 2D-block-cyclic division of Hamiltonian matrix ncloc() : total number of column...
Definition parallel_orbitals.cpp:87
Parallel_Blkcyclic & para_2d()
Definition parallel_orbitals.h:24
std::vector< int > atom_begin_col
Definition parallel_orbitals.h:117
std::vector< int > atom_begin_row
Definition parallel_orbitals.h:116
Definition atom_pair.h:45
const Parallel_Orbitals * get_paraV() const
get Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel
Definition atom_pair.cpp:389
T * get_pointer(int ir) const
get pointer of value from a submatrix
Definition atom_pair.cpp:950
int find_R(const int &rx_in, const int &ry_in, const int &rz_in) const
Definition atom_pair.cpp:424
Definition hcontainer.h:147
AtomPair< T > & get_atom_pair(int i, int j) const
return a reference of AtomPair with index of atom I and J in atom_pairs
Definition hcontainer.cpp:528
#define T
Definition exp.cpp:237
std::ofstream ofs_running
Definition global_variable.cpp:38
void TITLE(const std::string &class_name, const std::string &function_name, const bool disable)
Definition tool_title.cpp:18
std::pair< int, int > Tap
Definition irred_sec.h:14
std::array< int, 3 > TC
Definition irred_sec.h:15
void print_local(const Parallel_Orbitals &pv, const TR *tlocal, const std::string name)
Definition symm_rotation_r_hcontainer.hpp:17
void set_block(const int starti, const int startj, const RI::Tensor< std::complex< double > > &block, RI::Tensor< Tdata > &obj_tensor)
Definition symm_rotation_r.hpp:284
void print_global(const TR *tlocal, const int nr, const int nc, const std::string name)
Definition symm_rotation_r_hcontainer.hpp:7
void print_atompair_local(const Parallel_Orbitals &pv, const int iat1, const int iat2, const TR *tlocal, const std::string name)
Definition symm_rotation_r_hcontainer.hpp:28
void reduce_all(T &object)
reduce in all process
Definition depend_mock.cpp:14