NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ response_convolution() [2/4]

template<typename T >
void cntr::response_convolution ( int  tstp,
CPLX &  cc,
GREEN_TSTP &  W,
int  a1,
int  a2,
function< T > &  f,
int  b1,
int  b2,
int  SolveOrder,
beta,
h 
)

Definition at line 68 of file cntr_response_convolution_impl.hpp.

69  {
70  int ntau = W.ntau();
71  T dtau = beta / ntau;
72  int sizew = W.size1(), idxw = a1 * sizew + a2, sw = sizew * sizew;
73  int sizef = f.size1(), idxf = b1 * sizef + b2, sf = sizef * sizef;
74  CPLX res;
75 
76  assert(W.tstp() >= tstp);
77  assert(tstp == -1 || tstp >= SolveOrder);
78  assert(SolveOrder <= ntau);
79  assert(b1 >= 0 && b1 <= sizef-1);
80  assert(b2 >= 0 && b2 <= sizef-1);
81  assert(a1 >= 0 && a1 <= sizew-1);
82  assert(a2 >= 0 && a2 <= sizew-1);
83 
84  if (tstp == -1) {
85  response_integrate<T>(ntau, dtau, res, W.matptr(0), sw, idxw, integration::I<T>(SolveOrder));
86  cc = res * f.ptr(-1)[idxf];
87  } else {
88  response_integrate<T>(ntau, dtau, res, W.tvptr(0), sw, idxw, integration::I<T>(SolveOrder));
89  cc = res * (CPLX(0, -1.0) * f.ptr(-1)[idxf]);
90  response_integrate<T>(tstp, h, res, W.retptr(0), sw, idxw, f.ptr(0), sf, idxf,
91  integration::I<T>(SolveOrder));
92  cc += res;
93  }
94 }