ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
symm_rotation_r.hpp
Go to the documentation of this file.
1#include "symm_rotation.h"
3#include "source_base/timer.h"
4#include <array>
5#include <RI/global/Global_Func-2.h>
6#include <RI/physics/symmetry/Symmetry_Rotation.h>
7namespace ModuleSymmetry
8{
13 {
14 RI::Tensor<std::complex<double>> t({ static_cast<size_t>(block.nr), static_cast<size_t>(block.nc) });
15 for (int i = 0; i < block.nr; ++i) {
16 for (int j = 0; j < block.nc; ++j) {
17 t(i, j) = block(i, j);
18 } }
19 return t;
20 }
21
25 inline const RI::Tensor<std::complex<double>>& Symmetry_rotation::get_rotmat_Slm_tensor(const int isym, const int l)const
26 {
28 {
29 this->rotmat_Slm_tensor_.resize(this->rotmat_Slm_.size());
30 for (size_t is = 0; is < this->rotmat_Slm_.size(); ++is)
31 {
32 this->rotmat_Slm_tensor_[is].resize(this->rotmat_Slm_[is].size());
33 for (size_t il = 0; il < this->rotmat_Slm_[is].size(); ++il) {
34 this->rotmat_Slm_tensor_[is][il] = rotmat_Slm_to_tensor(this->rotmat_Slm_[is][il]);
35 } }
37 }
38 return this->rotmat_Slm_tensor_[isym][l];
39 }
40
43 inline float conj_elem(const float v) { return v; }
44 inline double conj_elem(const double v) { return v; }
45 inline std::complex<float> conj_elem(const std::complex<float>& v) { return std::conj(v); }
46 inline std::complex<double> conj_elem(const std::complex<double>& v) { return std::conj(v); }
47
48 template<typename Tdata>
49 inline void print_tensor(const RI::Tensor<Tdata>& t, const std::string& name, const double& threshold = 0.0)
50 {
51 GlobalV::ofs_running << name << ":\n";
52 for (int i = 0;i < t.shape[0];++i)
53 {
54 for (int j = 0;j < t.shape[1];++j) {
55 GlobalV::ofs_running << ((std::abs(t(i, j)) > threshold) ? t(i, j) : static_cast<Tdata>(0)) << " ";
56}
57 GlobalV::ofs_running << std::endl;
58 }
59 }
60 template<typename Tdata>
61 inline void print_tensor3(const RI::Tensor<Tdata>& t, const std::string& name, const double& threshold = 0.0)
62 {
63 GlobalV::ofs_running << name << ":\n";
64 for (int a = 0;a < t.shape[0];++a)
65 {
66 GlobalV::ofs_running << "abf: " << a << '\n';
67 for (int i = 0;i < t.shape[1];++i)
68 {
69 for (int j = 0;j < t.shape[2];++j) {
70 GlobalV::ofs_running << ((std::abs(t(a, i, j)) > threshold) ? t(a, i, j) : static_cast<Tdata>(0)) << " ";
71}
72 GlobalV::ofs_running << std::endl;
73 }
74 GlobalV::ofs_running << std::endl;
75 }
76 }
77
78 template<typename Tdata>
79 std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>> Symmetry_rotation::restore_HR(
80 const Symmetry& symm, const Atom* atoms, const std::vector<int>& iat2it, const char mode,
81 const std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>>& HR_irreducible) const
82 {
83 ModuleBase::TITLE("Symmetry_rotation", "restore_HR");
84 ModuleBase::timer::start("Symmetry_rotation", "restore_HR");
85 std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>> HR_full;
86 // irreducile-to-full map ver.
87 for (auto& tmp1 : HR_irreducible)
88 {
89 const int& irap1 = tmp1.first;
90 for (auto& tmp2 : tmp1.second)
91 {
92 const int& irap2 = tmp2.first.first;
93 const Tap& irap = { irap1, irap2 };
94 const TC& irR = tmp2.first.second;
95 const TapR& irapR = { irap, irR };
96 if (this->irs_.sector_stars_.find(irapR) != this->irs_.sector_stars_.end())
97 {
98 for (const std::pair<const int, std::pair<std::pair<int, int>, std::array<int, 3>>>& isym_apR : this->irs_.sector_stars_.at(irapR))
99 {
100 const int& isym = isym_apR.first;
101 const TapR& apR = isym_apR.second;
102 const int& ap1 = apR.first.first;
103 const int& ap2 = apR.first.second;
104 const TC& R = apR.second;
105 HR_full[ap1][{ap2, R}] = rotate_atompair_serial(tmp2.second, isym, atoms[iat2it[irap1]], atoms[iat2it[irap2]], mode);
106 }
107 }
108 else { std::cout << "Warning: not found: irreducible atom pair =(" << irap1 << "," << irap2 << "), irR=(" << irR[0] << "," << irR[1] << "," << irR[2] << ")\n";}
109 }
110 }
111 // full-to-irreducible map ver. (problematic in parallel)
112 // openmp slows down this for loop, why?
113 // for (auto& apR_isym_irapR : this->irs_.full_map_to_irreducible_sector_)
114 // {
115 // const Tap& ap = apR_isym_irapR.first.first;
116 // const TC& R = apR_isym_irapR.first.second;
117 // const int& isym = apR_isym_irapR.second.first;
118 // const Tap& irap = apR_isym_irapR.second.second.first;
119 // const TC& irR = apR_isym_irapR.second.second.second;
120 // // rotate the matrix and pack data
121 // // H_12(R)=T^\dagger(V)H_1'2'(VR+O_1-O_2)T(V)
122 // if (HR_irreducible.find(irap.first) != HR_irreducible.end() && HR_irreducible.at(irap.first).find({ irap.second, irR }) != HR_irreducible.at(irap.first).end())
123 // HR_full[ap.first][{ap.second, R}] = rotate_atompair_serial(HR_irreducible.at(irap.first).at({ irap.second, irR }),
124 // isym, atoms[ucell.iat2it[irap.first]], atoms[ucell.iat2it[irap.second]], mode);
125 // else
126 // std::cout << "not found: current atom pair =(" << ap.first << "," << ap.second << "), R=(" << R[0] << "," << R[1] << "," << R[2] << "), irreducible atom pair =(" << irap.first << "," << irap.second << "), irR=(" << irR[0] << "," << irR[1] << "," << irR[2] << ")\n";
127 // }
128 // // test: output HR_irreducile
129 // for (auto& tmp1 : HR_irreducible)
130 // {
131 // const int& a1 = tmp1.first;
132 // for (auto& tmp2 : tmp1.second)
133 // {
134 // const int& a2 = tmp2.first.first;
135 // const TC& R = tmp2.first.second;
136 // print_tensor(tmp2.second, "HR_irreducible (" + std::to_string(a1) + ", " + std::to_string(a2) + "), R=(" + std::to_string(R[0]) + " " + std::to_string(R[1]) + " " + std::to_string(R[2]) + ")");
137 // }
138 // }
139 // // test: output HR
140 // for (auto& tmp1 : HR_full)
141 // {
142 // const int& a1 = tmp1.first;
143 // for (auto& tmp2 : tmp1.second)
144 // {
145 // const int& a2 = tmp2.first.first;
146 // const TC& R = tmp2.first.second;
147 // print_tensor(tmp2.second, "HR_full (" + std::to_string(a1) + ", " + std::to_string(a2) + "), R=(" + std::to_string(R[0]) + " " + std::to_string(R[1]) + " " + std::to_string(R[2]) + ")");
148 // }
149 // }
150 ModuleBase::timer::end("Symmetry_rotation", "restore_HR");
151 return HR_full;
152 }
153
154 // (nspin=4) spinor version: rotate the 4 spin channels of H(R) together.
155 // Each channel is=a*2+b holds the (a,b) spin block (a=row spin, b=col spin),
156 // an nw1*nw2 spatial tensor (cf. RI_2D_Comm::split_is_block).
157 // The full spinor rotation is (T1 (x) U)^dagger H (T2 (x) U),
158 // which factorizes into the per-channel orbital rotation G^{cd}=T1^dagger H^{cd} T2 followed by the SU(2) spin mixing
159 // H'^{ab} = sum_{cd} conj(U_{ca}) U_{db} G^{cd} (mode 'H')
160 // H'^{ab} = sum_{cd} U_{ca} conj(U_{db}) G^{cd} (mode 'D')
161 //
162 // (nspin=4 magnetic) The atom-pair reduction may also use the ANTIUNITARY elements Theta*g of
163 // the Shubnikov group, flagged by isym >= nsym_. In real space time reversal acts as
164 // H(R) -> sigma_y H^*(R) sigma_y
165 // with R and the orbital indices untouched (in a real AO basis Theta = -i sigma_y K, and
166 // H(R) = sum_k H(k) e^{-ikR} turns H(k) -> sigma_y H^*(-k) sigma_y into exactly this).
167 // So the antiunitary case is the unitary result Y followed by one channel remap:
168 // H'^{00} = conj(Y^{11}), H'^{01} = -conj(Y^{10})
169 // H'^{10} = -conj(Y^{01}), H'^{11} = conj(Y^{00})
170 // The map is an involution (sigma_y^* = -sigma_y, sigma_y^2 = I), so no extra sign is needed
171 // when it is applied in either direction.
172 template<typename Tdata>
173 std::array<std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>>, 4> Symmetry_rotation::restore_HR_nspin4(
174 const Symmetry& symm, const Atom* atoms, const std::vector<int>& iat2it, const char mode,
175 const std::array<std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>>, 4>& HR_irreducible_soc)const
176 {
177 ModuleBase::TITLE("Symmetry_rotation", "restore_HR_nspin4");
178 ModuleBase::timer::start("Symmetry_rotation", "restore_HR_nspin4");
179 assert(mode == 'H' || mode == 'D');
180 std::array<std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>>, 4> HR_full;
181
182 // union of irreducible (irap1, {irap2, irR}) keys present in any of the 4 channels:
183 // a channel may drop an element below threshold while another keeps it; treat missing as zero.
184 std::map<int, std::set<std::pair<int, TC>>> ir_keys;
185 for (int is = 0;is < 4;++is)
186 {
187 for (auto& tmp1 : HR_irreducible_soc[is])
188 {
189 for (auto& tmp2 : tmp1.second) { ir_keys[tmp1.first].insert(tmp2.first); }
190 }
191 }
192
193 for (std::pair<const int, std::set<std::pair<int, std::array<int, 3>>>>& k1 : ir_keys)
194 {
195 const int& irap1 = k1.first;
196 for (const std::pair<int, std::array<int, 3>>& a2R : k1.second)
197 {
198 const int& irap2 = a2R.first;
199 const TC& irR = a2R.second;
200 const TapR irapR = { { irap1, irap2 }, irR };
201 if (this->irs_.sector_stars_.find(irapR) == this->irs_.sector_stars_.end())
202 {
203 std::cout << "Warning: not found: irreducible atom pair =(" << irap1 << "," << irap2 << "), irR=(" << irR[0] << "," << irR[1] << "," << irR[2] << ")\n";
204 continue;
205 }
206 const Atom& a1 = atoms[iat2it[irap1]];
207 const Atom& a2 = atoms[iat2it[irap2]];
208 // gather the 4 irreducible spin-channel blocks (zero-filled when absent)
209 std::array<RI::Tensor<Tdata>, 4> Hir;
210 for (int is = 0;is < 4;++is)
211 {
212 const auto& chan = HR_irreducible_soc[is];
213 auto it1 = chan.find(irap1);
214 if (it1 != chan.end())
215 {
216 auto it2 = it1->second.find({ irap2, irR });
217 if (it2 != it1->second.end()) { Hir[is] = it2->second; }
218 }
219 if (Hir[is].empty()) { Hir[is] = RI::Tensor<Tdata>({ static_cast<size_t>(a1.nw), static_cast<size_t>(a2.nw) }); }
220 }
221 for (const std::pair<const int, std::pair<std::pair<int, int>, std::array<int, 3>>>& isym_apR : this->irs_.sector_stars_.at(irapR))
222 {
223 const int& isym = isym_apR.first;
224 const TapR& apR = isym_apR.second;
225 const int& ap1 = apR.first.first;
226 const int& ap2 = apR.first.second;
227 const TC& R = apR.second;
228 // step 1: orbital rotation of each spin channel independently
229 std::array<RI::Tensor<Tdata>, 4> G;
230 for (int is = 0;is < 4;++is) { G[is] = this->rotate_atompair_serial(Hir[is], isym, a1, a2, mode); }
231 // step 2: SU(2) spin mixing of the 4 rotated channels into the output channels
232 const SpinRotation::Su2& U = this->spin_U_[isym];
233 std::array<RI::Tensor<Tdata>, 4> Hout_ch;
234 for (int a = 0;a < 2;++a) {
235 for (int b = 0;b < 2;++b)
236 {
237 RI::Tensor<Tdata> Hout({ static_cast<size_t>(a1.nw), static_cast<size_t>(a2.nw) });
238 for (int c = 0;c < 2;++c) {
239 for (int d = 0;d < 2;++d)
240 {
241 const std::complex<double> coeff = (mode == 'H')
242 ? std::conj(U[c * 2 + a]) * U[d * 2 + b]
243 : U[c * 2 + a] * std::conj(U[d * 2 + b]);
244 Hout += RI::Global_Func::convert<Tdata>(coeff) * G[c * 2 + d];
245 }
246 }
247 Hout_ch[a * 2 + b] = Hout;
248 }
249 }
250 // step 3 (antiunitary elements of the Shubnikov group): apply time reversal
251 // sigma_y (.)^* sigma_y, i.e. the channel remap documented above.
252 if (isym >= this->nsym_)
253 {
254 // NOTE: antiunitary elements only ever exist for nspin=4 (nrotk_anti is 0 otherwise), where Tdata is complex.
255 // conj_elem() is the identity for a
256 // real Tdata, so this branch must not be reached with one -- it would
257 // silently degrade into a bare channel swap.
258 static const int src[4] = { 3, 2, 1, 0 }; // 00<-11, 01<-10, 10<-01, 11<-00
259 static const bool neg[4] = { false, true, true, false };
260 std::array<RI::Tensor<Tdata>, 4> Y = Hout_ch;
261 for (int is = 0;is < 4;++is)
262 {
263 const RI::Tensor<Tdata>& s = Y[src[is]];
264 RI::Tensor<Tdata> t({ static_cast<size_t>(a1.nw), static_cast<size_t>(a2.nw) });
265 for (size_t i = 0;i < t.shape[0];++i) {
266 for (size_t j = 0;j < t.shape[1];++j)
267 {
268 const Tdata v = ModuleSymmetry::conj_elem(s(i, j));
269 t(i, j) = neg[is] ? -v : v;
270 }
271 }
272 Hout_ch[is] = t;
273 }
274 }
275 for (int is = 0;is < 4;++is) { HR_full[is][ap1][{ap2, R}] = Hout_ch[is]; }
276 }
277 }
278 }
279 ModuleBase::timer::end("Symmetry_rotation", "restore_HR_nspin4");
280 return HR_full;
281 }
282
283 template<typename Tdata>
284 inline void set_block(const int starti, const int startj, const RI::Tensor<std::complex<double>>& block,
285 RI::Tensor<Tdata>& obj_tensor)
286 { // no changing row/col order
287 for (int i = 0;i < block.shape[0];++i) {
288 for (int j = 0;j < block.shape[1];++j) {
289 obj_tensor(starti + i, startj + j) = RI::Global_Func::convert<Tdata>(block(i, j));
290}
291}
292 }
293
294 template<typename Tdata>
296 {
297 RI::Tensor<Tdata> T({ static_cast<size_t>(a.nw), static_cast<size_t>(a.nw) }); // check if zero
298 int iw = 0;
299 while (iw < a.nw)
300 {
301 int l = a.iw2l[iw];
302 int nm = 2 * l + 1;
303 set_block(iw, iw, this->get_rotmat_Slm_tensor(isym, l), T);
304 iw += nm;
305 }
306 return T;
307 }
308 template<typename Tdata>
310 const Atom& a1, const Atom& a2, const char mode, const bool output)const
311 { // due to col-contiguous, actually what we know is T^T and H^T (or D^T),
312 // and what we calculate is(H'^T = T ^ T * H ^ T * T^*) or (D'^T = T ^ \dagger * D ^ T * T)
313 assert(mode == 'H' || mode == 'D');
314 bool sametype = (a1.label == a2.label);
315 assert(A.shape[0] == a1.nw);//col
316 assert(A.shape[1] == a2.nw);//row
317 // contrut T matrix
318 const RI::Tensor<Tdata>& T1 = this->set_rotation_matrix<Tdata>(a1, isym);
319 const RI::Tensor<Tdata>& T2 = sametype ? T1 : this->set_rotation_matrix<Tdata>(a2, isym);
320 // rotate
321 RI::Tensor<Tdata>TAT(A.shape);
322 (mode == 'H') ? RI::Sym::T1_HR_T2(TAT.ptr(), A.ptr(), T1, T2) : RI::Sym::T1_DR_T2(TAT.ptr(), A.ptr(), T1, T2);
323 if (output)
324 {
325 print_tensor(A, "A");
326 print_tensor(T1, "T1");
327 print_tensor(T2, "T2");
328 print_tensor(TAT, "TAT");
329 }
330 return TAT;
331 }
332 template<typename Tdata>
333 void Symmetry_rotation::rotate_atompair_serial(Tdata* TAT, const Tdata* A,
334 const int& nw1, const int& nw2, const int isym,
335 const Atom& a1, const Atom& a2, const char mode)const
336 { // due to col-contiguous, actually what we know is T^T and H^T (or D^T),
337 // and what we calculate is(H'^T = T ^ T * H ^ T * T^*) or (D'^T = T ^ \dagger * D ^ T * T)
338 assert(mode == 'H' || mode == 'D');
339 bool sametype = (a1.label == a2.label);
340 assert(nw1 == a1.nw);//col
341 assert(nw2 == a2.nw);//row
342 // contrut T matrix
343 const RI::Tensor<Tdata>& T1 = this->set_rotation_matrix<Tdata>(a1, isym);
344 const RI::Tensor<Tdata>& T2 = sametype ? T1 : this->set_rotation_matrix<Tdata>(a2, isym);
345 // rotate
346 (mode == 'H') ? RI::Sym::T1_HR_T2(TAT, A, T1, T2) : RI::Sym::T1_DR_T2(TAT, A, T1, T2);
347 }
348
349
350 template<typename Tdata>
352 {
353 int nabfs = 0;
354 for (int l = 0;l < this->abfs_l_nchi_[type].size();++l) {nabfs += this->abfs_l_nchi_[type][l] * (2 * l + 1);
355}
356 RI::Tensor<Tdata> T({ static_cast<size_t>(nabfs), static_cast<size_t>(nabfs) }); // check if zero
357 int iw = 0;
358 for (int L = 0;L < this->abfs_l_nchi_[type].size();++L)
359 {
360 int nm = 2 * L + 1;
361 for (int N = 0;N < this->abfs_l_nchi_[type][L];++N)
362 {
363 set_block(iw, iw, this->get_rotmat_Slm_tensor(isym, L), T);
364 iw += nm;
365 // std::cout << "L=" << L << ", N=" << N << ", iw=" << iw << "\n";
366 }
367 }
368 assert(iw == nabfs);
369 return T;
370 }
371
372 template<typename Tdata>
374 const int isym, const Atom& a1, const Atom& a2, const int& type1, bool output)const
375 {
376 assert(this->reduce_Cs_);
377 RI::Tensor<Tdata> Cout(C.shape);
378 assert(C.shape.size() == 3);
379 const int& slice_size = C.shape[1] * C.shape[2];
380 // step 1: multiply 2 AOs' rotation matrices
381 for (int iabf = 0;iabf < C.shape[0];++iabf) {
382 this->rotate_atompair_serial(Cout.ptr() + iabf * slice_size, C.ptr() + iabf * slice_size,
383 a1.nw, a2.nw, isym, a1, a2, 'H');
384}
385 // step 2: multiply the ABFs' rotation matrix from the left
386 const RI::Tensor<Tdata>& Tabfs = this->set_rotation_matrix_abf<Tdata>(type1, isym);
387 RI::Sym::T1_HR(Cout.ptr(), Cout.ptr(), Tabfs, slice_size);
388 return Cout;
389 }
390
391 template<typename Tdata>
392 void Symmetry_rotation::print_HR(const std::map<int, std::map<std::pair<int, TC>, RI::Tensor<Tdata>>>& HR, const std::string name, const double& threshold)
393 {
394 for (auto& HR_ia1 : HR)
395 {
396 int iat1 = HR_ia1.first;
397 for (auto& HR_ia12R : HR_ia1.second)
398 {
399 int iat2 = HR_ia12R.first.first;
400 TC R = HR_ia12R.first.second;
401 const RI::Tensor<Tdata>& HR_tensor = HR_ia12R.second;
402 std::cout << "atom pair (" << iat1 << ", " << iat2 << "), R=(" << R[0] << "," << R[1] << "," << R[2] << "), ";
403 print_tensor(HR_tensor, name, threshold);
404 }
405 }
406 }
407
408}
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
std::string label
atomic symbol
Definition atom_spec.h:51
std::vector< int > iw2l
use iw to find L
Definition atom_spec.h:33
Definition complexmatrix.h:11
int nr
Definition complexmatrix.h:15
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
int rotmat_Slm_version_
Definition symm_rotation_k.h:172
Irred_Sector irs_
irreducible sector
Definition symm_rotation_k.h:190
int nsym_
Definition symm_rotation_k.h:152
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
std::vector< SpinRotation::Su2 > spin_U_
Definition symm_rotation_k.h:187
std::vector< std::vector< RI::Tensor< std::complex< double > > > > rotmat_Slm_tensor_
Definition symm_rotation.h:97
const RI::Tensor< std::complex< double > > & get_rotmat_Slm_tensor(const int isym, const int l) const
Definition symm_rotation_r.hpp:25
bool reduce_Cs_
Definition symm_rotation.h:101
int rotmat_Slm_tensor_version_
Definition symm_rotation.h:98
std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > restore_HR_nspin4(const Symmetry &symm, const Atom *atoms, const std::vector< int > &iat2it, const char mode, const std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > &HR_irreducible_soc) const
Definition symm_rotation_r.hpp:173
std::vector< std::vector< int > > abfs_l_nchi_
number of abfs for each angular momentum
Definition symm_rotation.h:103
RI::Tensor< Tdata > rotate_atompair_serial(const RI::Tensor< Tdata > &A, const int isym, const Atom &a1, const Atom &a2, const char mode, bool output=false) const
Definition symm_rotation_r.hpp:309
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
RI::Tensor< Tdata > set_rotation_matrix_abf(const int &type, const int &isym) const
Definition symm_rotation_r.hpp:351
void print_HR(const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > &HR, const std::string name, const double &threshold=0.0)
Definition symm_rotation_r.hpp:392
RI::Tensor< Tdata > rotate_singleC_serial(const RI::Tensor< Tdata > &C, const int isym, const Atom &a1, const Atom &a2, const int &type1, bool output=false) const
rotate a 3-dim C tensor in RI technique
Definition symm_rotation_r.hpp:373
Symmetry analysis class.
Definition symmetry.h:24
Definition rpa_lri_coeff_v1.h:11
Definition output.h:13
#define N
Definition exp.cpp:24
#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::array< std::complex< double >, 4 > Su2
A 2x2 complex matrix stored row-major: {m00, m01, m10, m11}.
Definition symm_rot_spin.h:37
Definition klist_io.h:13
std::pair< int, int > Tap
Definition irred_sec.h:14
std::array< int, 3 > TC
Definition irred_sec.h:15
RI::Tensor< std::complex< double > > rotmat_Slm_to_tensor(const ModuleBase::ComplexMatrix &block)
Definition symm_rotation_r.hpp:12
std::pair< Tap, TC > TapR
Definition irred_sec.h:16
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_tensor(const RI::Tensor< Tdata > &t, const std::string &name, const double &threshold=0.0)
Definition symm_rotation_r.hpp:49
float conj_elem(const float v)
Definition symm_rotation_r.hpp:43
void print_tensor3(const RI::Tensor< Tdata > &t, const std::string &name, const double &threshold=0.0)
Definition symm_rotation_r.hpp:61
#define threshold
Definition sph_bessel_rec_test.cpp:4