NESSi  v1.0.2 The NonEquilibrium Systems Simulation Library

## ◆ vie2_timestep_sin_omp()

template<typename T >
 void cntr::vie2_timestep_sin_omp ( int omp_num_threads, int tstp, herm_matrix< T > & G, function< T > & Gsin, herm_matrix< T > & F, herm_matrix< T > & Fcc, function< T > & Fsin, herm_matrix< T > & Q, function< T > & Qsin, T beta, T h, const int SolveOrder )

One step VIE solver $$(1+F)*G=Q$$ for Green's function with instantaneous contributions for given integration order. OpenMP parallelized

Purpose

OpenMP version of 'vie2_timestep_sin'. One solves the linear equation $$(1+F)*G=Q$$ for a hermitian matrix $$G(t, t^\prime)$$. Here, are given: input kernel $$F(t, t^\prime)$$, its hermitian conjugate $$F^\ddagger(t, t^\prime)$$, the source term $$Q(t, t^\prime)$$, and the integrator class 'I'. The Green's functions $$G(t, t^\prime)$$ and $$Q(t, t^\prime)$$ have instantaneous contributions.

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 &G [herm_matrix] solution &Gsin [function] singular component fo G &F [herm_matrix] green's function on left-hand side &Fcc [herm_matrix] Complex conjugate of F &Fsin [function] singular component fo F &Q [herm_matrix] green's function on right-hand side &Qsin [function] singular component of Q beta [double] inverse temperature h [double] time interval SolveOrder [int] integrator order

Definition at line 2352 of file cntr_vie2_impl.hpp.

2354  {
2355
2356  int n1=(tstp<=SolveOrder && tstp>=0 ? 0 : tstp);
2357  int n2=(tstp<=SolveOrder && tstp>=0 ? SolveOrder : tstp);
2358  int nt=F.nt(),ntau=F.ntau(),size1=F.size1(),sig=F.sig();
2359
2360  assert(tstp >= 0);
2361  assert(ntau > 0);
2362  assert(SolveOrder > 0 && SolveOrder <= 5);
2363  assert(SolveOrder <= 2 * ntau + 2);
2364  assert(ntau == Fcc.ntau());
2365  assert(ntau == F.ntau());
2366  assert(ntau == Q.ntau());
2367  assert(F.sig()== G.sig());
2368  assert(Fcc.sig()== G.sig());
2369  assert(Q.sig()== G.sig());
2370  assert(F.size1()== size1);
2371  assert(F.size2()== size1);
2372  assert(Fcc.size1()== size1);
2373  assert(Fcc.size2()== size1);
2374  assert(Q.size1()== size1);
2375  assert(Q.size2()== size1);
2376  assert(n1 <= F.nt());
2377  assert(n1 <= Fcc.nt());
2378  assert(n1 <= G.nt());
2379  assert(n1 <= Q.nt());
2380
2381  function<T> funFinv(n2,size1);
2382
2383  cntr::herm_matrix<T> tmpF(nt,ntau,size1,sig),tmpFcc(nt,ntau,size1,sig),tmpF1(nt,ntau,size1,sig),tmpQ(nt,ntau,size1,sig);
2384  cdmatrix cdF,cdFinv,cdQ,cdG;
2385  //Check consistency
2386  assert(G.sig()==F.sig());
2387  assert(G.nt()==F.nt());
2388  assert(G.nt()==Q.nt());
2389
2390  for(int n=-1;n<=n2;n++){
2391  Fsin.get_value(n,cdF);
2392  Qsin.get_value(n,cdQ);
2393  cdF=cdF+cdmatrix::Identity(size1,size1);
2394  cdFinv=cdF.inverse(); //Expected that these matrices are small
2395  cdG=cdFinv*cdQ;
2396  funFinv.set_value(n,cdFinv);
2397  Gsin.set_value(n,cdG);
2398  }
2399
2400  tmpF=F;
2401  tmpFcc=Fcc;
2402  tmpQ=Q;
2403
2404  //Set new F and Q
2405  for(int n=-1;n<=n2;n++){
2406  tmpF.left_multiply(n,funFinv,1.0);
2407  tmpFcc.right_multiply(n,funFinv,1.0);
2408  tmpQ.left_multiply(n,funFinv,1.0);
2409  }
2410  tmpF1=tmpF;
2411
2412  for(int n=-1;n<=n2;n++){
2413  tmpF1.right_multiply(n,Gsin,1.0);
2414  }
2415  for(int i=-1;i<=n2;i++){
2416  tmpQ.incr_timestep(i,tmpF1,-1.0);
2417  }
2418