NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ convolution_timestep_omp() [1/4]

template<typename T >
void cntr::convolution_timestep_omp ( int  omp_num_threads,
int  tstp,
herm_matrix< T > &  C,
herm_matrix< T > &  A,
herm_matrix< T > &  Acc,
function< T > &  ft,
herm_matrix< T > &  B,
herm_matrix< T > &  Bcc,
beta,
h,
int  SolveOrder 
)

Returns convolution \(C = A\ast f\ast B\) at a given time step

Purpose

Computes contour convolution C=A*f*B of the objects with class 'herm_matrix' at a given time step 't=nh'. Works for a scalar and square matrices. openMP parallelized version.

Parameters
omp_num_threads

[int] The number of openMP threads to be used. Set to the number of threads in the current team.

tstp

[int] time step

C

[herm_matrix] Matrix to which the result of the convolution on Matsubara axis is given

A

[herm_matrix] contour Green's function

Acc

[herm_matrix] hermitian conjugate of A

ft

[herm_matrix] function \(f\)

B

[herm_matrix] contour Green's function

Bcc

[herm_matrix] hermitian conjugate of B

beta

inversed temperature

h

time step interval

SolveOrder

[int] integrator order

Definition at line 5231 of file cntr_convolution_impl.hpp.

5234  {
5235  int ntmin = (tstp == -1 || tstp > SolveOrder ? tstp : SolveOrder);
5236  if (tstp < -1)
5237  return;
5238  int size1 = A.size1();
5239  std::complex<T> *fttemp;
5240  assert(C.size1()==size1);
5241  assert(ft.size1()==size1);
5242  assert(B.size1()==size1);
5243  assert(Bcc.size1()==size1);
5244  assert(Acc.size1()==size1);
5245  assert(SolveOrder>=0 && SolveOrder <=5);
5246  assert(C.ntau()>=SolveOrder);
5247  assert(C.nt()>=ntmin);
5248  assert(A.nt()>=ntmin);
5249  assert(Acc.nt()>=ntmin);
5250  assert(B.nt()>=ntmin);
5251  assert(Bcc.nt()>=ntmin);
5252  assert(ft.nt()>=ntmin);
5253  assert(C.ntau()==A.ntau());
5254  assert(C.ntau()==Acc.ntau());
5255  assert(C.ntau()==B.ntau());
5256  assert(C.ntau()==Bcc.ntau());
5257  C.set_timestep_zero(tstp);
5258  fttemp = (tstp == -1 ? ft.ptr(-1) : ft.ptr(0));
5259 
5260  switch (size1) {
5261  case 1:
5262  incr_convolution_omp<T, herm_matrix<T>, 1>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5263  Acc, ft.ptr(-1), fttemp, B, Bcc,
5264  integration::I<T>(SolveOrder), beta, h);
5265  break;
5266  case 2:
5267  incr_convolution_omp<T, herm_matrix<T>, 2>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5268  Acc, ft.ptr(-1), fttemp, B, Bcc,
5269  integration::I<T>(SolveOrder), beta, h);
5270  break;
5271  case 3:
5272  incr_convolution_omp<T, herm_matrix<T>, 3>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5273  Acc, ft.ptr(-1), fttemp, B, Bcc,
5274  integration::I<T>(SolveOrder), beta, h);
5275  break;
5276  case 4:
5277  incr_convolution_omp<T, herm_matrix<T>, 4>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5278  Acc, ft.ptr(-1), fttemp, B, Bcc,
5279  integration::I<T>(SolveOrder), beta, h);
5280  break;
5281  case 5:
5282  incr_convolution_omp<T, herm_matrix<T>, 5>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5283  Acc, ft.ptr(-1), fttemp, B, Bcc,
5284  integration::I<T>(SolveOrder), beta, h);
5285  break;
5286  case 6:
5287  incr_convolution_omp<T, herm_matrix<T>, 6>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5288  Acc, ft.ptr(-1), fttemp, B, Bcc,
5289  integration::I<T>(SolveOrder), beta, h);
5290  break;
5291  case 8:
5292  incr_convolution_omp<T, herm_matrix<T>, 8>(omp_num_threads, tstp, CPLX(1, 0), C, A,
5293  Acc, ft.ptr(-1), fttemp, B, Bcc,
5294  integration::I<T>(SolveOrder), beta, h);
5295  break;
5296  default:
5297  incr_convolution_omp<T, herm_matrix<T>, LARGESIZE>(
5298  omp_num_threads, tstp, CPLX(1, 0), C, A, Acc, ft.ptr(-1), fttemp, B, Bcc,
5299  integration::I<T>(SolveOrder), beta, h);
5300  break;
5301  }
5302 }