NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library
cntr_getset_herm_matrix_timestep_inc.hpp
Go to the documentation of this file.
1 
22 template <typename T>
23 inline void get_mat(const int m, std::complex<T> &G_mat, herm_matrix_timestep<T> &G,
24  herm_matrix_timestep<T> &Gcc){
25  assert(m <= G.ntau());
26  assert(G.ntau() == Gcc.ntau());
27  assert(G.size1() == Gcc.size1());
28  assert(G.size2() == Gcc.size2());
29  assert(G.sig() == Gcc.sig());
30 
31  G_mat = *G.matptr(m);
32 }
33 
55 template <typename T>
56 inline void get_mat(const int m, cdmatrix &G_mat, herm_matrix_timestep<T> &G, herm_matrix_timestep<T> &Gcc){
57  assert(m <= G.ntau());
58  assert(G.ntau() == Gcc.ntau());
59  assert(G.size1() == Gcc.size1());
60  assert(G.size2() == Gcc.size2());
61  assert(G.sig() == Gcc.sig());
62  std::complex<T> *mat;
63  int size1=G.size1(), size2=G.size2();
64 
65  mat = G.matptr(m);
66  map_ptr2matrix(size1, size2, mat, G_mat);
67 }
68 
69 
70 
90 template <typename T>
91 inline void get_mat(const int m, std::complex<T> &G_mat, herm_matrix_timestep<T> &G){
92  assert(m <= G.ntau());
93 
94  G_mat = *G.matptr(m);
95 }
96 
116 template <typename T>
117 inline void get_mat(const int m, cdmatrix &G_mat, herm_matrix_timestep<T> &G){
118  assert(m <= G.ntau());
119  std::complex<T> *mat;
120  int size1=G.size1(), size2=G.size2();
121 
122  mat = G.matptr(m);
123  map_ptr2matrix(size1, size2, mat, G_mat);
124 }
125 
126 
127 
152 template <typename T>
153 inline void get_les(const int i, const int j, std::complex<T> &G_les, herm_matrix_timestep<T> &G,
154  herm_matrix_timestep<T> &Gcc){
155  assert(i <= G.tstp() && j <= G.tstp());
156  assert(i == G.tstp() || j == G.tstp());
157  assert(i <= Gcc.tstp() && j <= Gcc.tstp());
158  assert(i == Gcc.tstp() || j == Gcc.tstp());
159  assert(G.tstp() == Gcc.tstp());
160  assert(G.ntau() == Gcc.ntau());
161  assert(G.size1() == Gcc.size1());
162  assert(G.size2() == Gcc.size2());
163  assert(G.sig() == Gcc.sig());
164 
165  if (G.tstp() == j){
166  G_les = *G.lesptr(i);
167  } else if (G.tstp() == i) {
168  G_les = *Gcc.lesptr(j);
169  G_les = -std::conj(G_les);
170  }
171 }
172 
197 template <typename T>
198 void get_les(const int i, const int j, cdmatrix &G_les, herm_matrix_timestep<T> &G,
199  herm_matrix_timestep<T> &Gcc){
200  assert(i <= G.tstp() && j <= G.tstp());
201  assert(i == G.tstp() || j == G.tstp());
202  assert(i <= Gcc.tstp() && j <= Gcc.tstp());
203  assert(i == Gcc.tstp() || j == Gcc.tstp());
204  assert(G.tstp() == Gcc.tstp());
205  assert(G.ntau() == Gcc.ntau());
206  assert(G.size1() == Gcc.size1());
207  assert(G.size2() == Gcc.size2());
208  assert(G.sig() == Gcc.sig());
209  std::complex<T> *les;
210  int size1=G.size1(), size2=G.size2();
211 
212  if (G.tstp() == j){
213  les = G.lesptr(i);
214  map_ptr2matrix(size1, size2, les, G_les);
215  } else if (G.tstp() == i) {
216  les = Gcc.lesptr(j);
217  map_ptr2matrix(size1, size2, les, G_les);
218  G_les.adjointInPlace();
219  G_les = -G_les;
220  }
221 }
222 
223 
224 
250 template <typename T>
251 inline void get_ret(const int i, const int j, std::complex<T> &G_ret, herm_matrix_timestep<T> &G,
252  herm_matrix_timestep<T> &Gcc){
253  assert(i <= G.tstp() && j <= G.tstp());
254  assert(i == G.tstp() || j == G.tstp());
255  assert(i <= Gcc.tstp() && j <= Gcc.tstp());
256  assert(i == Gcc.tstp() || j == Gcc.tstp());
257  assert(G.tstp() == Gcc.tstp());
258  assert(G.ntau() == Gcc.ntau());
259  assert(G.size1() == Gcc.size1());
260  assert(G.size2() == Gcc.size2());
261  assert(G.sig() == Gcc.sig());
262 
263  if (G.tstp() == i){
264  G_ret = *G.retptr(j);
265  } else if (G.tstp() == j) {
266  G_ret = *Gcc.retptr(i);
267  G_ret = -std::conj(G_ret);
268  }
269 }
270 
296 template <typename T>
297 void get_ret(const int i, const int j, cdmatrix &G_ret, herm_matrix_timestep<T> &G,
298  herm_matrix_timestep<T> &Gcc){
299  assert(i <= G.tstp() && j <= G.tstp());
300  assert(i == G.tstp() || j == G.tstp());
301  assert(i <= Gcc.tstp() && j <= Gcc.tstp());
302  assert(i == Gcc.tstp() || j == Gcc.tstp());
303  assert(G.tstp() == Gcc.tstp());
304  assert(G.ntau() == Gcc.ntau());
305  assert(G.size1() == Gcc.size1());
306  assert(G.size2() == Gcc.size2());
307  assert(G.sig() == Gcc.sig());
308  std::complex<T> *ret;
309  int size1=G.size1(), size2=G.size2();
310 
311 
312  if (G.tstp() == i){
313  ret = G.retptr(j);
314  map_ptr2matrix(size1, size2, ret, G_ret);
315  } else if (G.tstp() == j) {
316  ret = Gcc.retptr(i);
317  map_ptr2matrix(size1, size2, ret, G_ret);
318  G_ret.adjointInPlace();
319  G_ret = -G_ret;
320  }
321 }
322 
323 
324 
325 
350 template <typename T>
351 inline void get_tv(const int i, const int m, std::complex<T> &G_tv, herm_matrix_timestep<T> &G,
352  herm_matrix_timestep<T> &Gcc){
353  assert(i == G.tstp());
354  assert(m <= G.ntau());
355  assert(G.tstp() == Gcc.tstp());
356  assert(G.ntau() == Gcc.ntau());
357  assert(G.size1() == Gcc.size1());
358  assert(G.size2() == Gcc.size2());
359  assert(G.sig() == Gcc.sig());
360 
361  G_tv = *G.tvptr(m);
362 }
363 
388 template <typename T>
389 void get_tv(const int i, const int m, cdmatrix &G_tv, herm_matrix_timestep<T> &G, herm_matrix_timestep<T> &Gcc){
390  assert(i == G.tstp());
391  assert(m <= G.ntau());
392  assert(G.tstp() == Gcc.tstp());
393  assert(G.ntau() == Gcc.ntau());
394  assert(G.size1() == Gcc.size1());
395  assert(G.size2() == Gcc.size2());
396  assert(G.sig() == Gcc.sig());
397  int size1 = G.size1(), size2 = G.size2();
398  std::complex<T> *tv;
399 
400  tv = G.tvptr(m);
401  map_ptr2matrix(size1, size2, tv, G_tv);
402 }
403 
404 
405 
406 
407 
408 
409 
434 template <typename T>
435 inline void get_vt(const int m, const int i, std::complex<T> &G_vt, herm_matrix_timestep<T> &G,
436  herm_matrix_timestep<T> &Gcc){
437  assert(i == G.tstp());
438  assert(m <= G.ntau());
439  assert(G.tstp() == Gcc.tstp());
440  assert(G.ntau() == Gcc.ntau());
441  assert(G.size1() == Gcc.size1());
442  assert(G.size2() == Gcc.size2());
443  assert(G.sig() == Gcc.sig());
444 
445  G_vt = *Gcc.tvptr(G.ntau() - m);
446  G_vt = std::complex<T>(-G.sig(),0.0) * std::conj(G_vt);
447 }
448 
473 template <typename T>
474 void get_vt(const int m, const int i, cdmatrix &G_vt, herm_matrix_timestep<T> &G,
475  herm_matrix_timestep<T> &Gcc){
476  assert(i == G.tstp());
477  assert(m <= G.ntau());
478  assert(G.tstp() == Gcc.tstp());
479  assert(G.ntau() == Gcc.ntau());
480  assert(G.size1() == Gcc.size1());
481  assert(G.size2() == Gcc.size2());
482  assert(G.sig() == Gcc.sig());
483  int size1 = G.size1(), size2 = G.size2();
484  std::complex<T> *vt;
485 
486  vt = Gcc.tvptr(G.ntau() - m);
487  map_ptr2matrix(size1, size2, vt, G_vt);
488  G_vt.adjointInPlace();
489  G_vt = std::complex<T>(-G.sig(),0.0) * G_vt;
490 }
491 
492 
493 
494 
495 
519 template <typename T>
520 inline void get_gtr(const int i, const int j, std::complex<T> &G_gtr, herm_matrix_timestep<T> &G,
521  herm_matrix_timestep<T> &Gcc){
522  std::complex<T> G_les, G_ret;
523 
524  get_les(i, j, G_les, G, Gcc);
525  get_ret(i, j, G_ret, G, Gcc);
526  G_gtr = G_les + G_ret;
527 }
528 
553 template <typename T>
554 void get_gtr(const int i, const int j, cdmatrix &G_gtr, herm_matrix_timestep<T> &G,
555  herm_matrix_timestep<T> &Gcc){
556  cdmatrix G_les, G_ret;
557 
558  get_les(i, j, G_les, G, Gcc);
559  get_ret(i, j, G_ret, G, Gcc);
560  G_gtr.noalias() = G_les + G_ret;
561 }
562 
563 
564 
587 template <typename T>
588 inline void get_les(const int i, const int j, std::complex<T> &G_les, herm_matrix_timestep<T> &G){
589  get_les(i, j, G_les, G, G);
590 }
591 
614 template <typename T>
615 void get_les(const int i, const int j, cdmatrix &G_les, herm_matrix_timestep<T> &G){
616  get_les(i, j, G_les, G, G);
617 }
618 
619 
620 
644 template <typename T>
645 inline void get_ret(const int i, const int j, std::complex<T> &G_ret, herm_matrix_timestep<T> &G){
646  get_ret(i, j, G_ret, G, G);
647 }
648 
672 template <typename T>
673 void get_ret(const int i, const int j, cdmatrix &G_ret, herm_matrix_timestep<T> &G){
674  get_ret(i, j, G_ret, G, G);
675 }
676 
677 
678 
679 
702 template <typename T>
703 inline void get_tv(const int i, const int m, std::complex<T> &G_tv, herm_matrix_timestep<T> &G){
704  get_tv(i, m, G_tv, G);
705 }
706 
729 template <typename T>
730 void get_tv(const int i, const int m, cdmatrix &G_tv, herm_matrix_timestep<T> &G){
731  get_tv(i, m, G_tv, G);
732 }
733 
734 
735 
736 
737 
738 
739 
762 template <typename T>
763 inline void get_vt(const int m, const int i, std::complex<T> &G_vt, herm_matrix_timestep<T> &G){
764  get_vt(m, i, G_vt, G);
765 }
766 
789 template <typename T>
790 void get_vt(const int m, const int i, cdmatrix &G_vt, herm_matrix_timestep<T> &G){
791  get_vt(m, i, G_vt, G);
792 }
793 
794 
795 
796 
797 
819 template <typename T>
820 inline void get_gtr(const int i, const int j, std::complex<T> &G_gtr, herm_matrix_timestep<T> &G){
821  get_gtr(i, j, G_gtr, G, G);
822 }
823 
846 template <typename T>
847 void get_gtr(const int i, const int j, cdmatrix &G_gtr, herm_matrix_timestep<T> &G){
848  get_gtr(i, j, G_gtr, G, G);
849 }
void get_vt(const int m, const int i, std::complex< T > &G_vt, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the right-mixing component of a general contour function at given times. ...
void get_gtr(const int i, const int j, std::complex< T > &G_gtr, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the greater component of a general contour function at given times.
void get_tv(const int i, const int m, std::complex< T > &G_tv, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the left-mixing component of a general contour function at given times. ...
void get_mat(const int m, std::complex< T > &G_mat, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the Matsubara component of a general contour function at given times.
void get_les(const int i, const int j, std::complex< T > &G_les, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the lesser component of a general contour function at given times.
void get_ret(const int i, const int j, std::complex< T > &G_ret, herm_matrix_timestep< T > &G, herm_matrix_timestep< T > &Gcc)
Returns the retarded component of a general contour function at given times.