NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ correlation_energy() [2/2]

template<typename T >
T cntr::correlation_energy ( int  tstp,
herm_matrix< T > &  G,
herm_matrix< T > &  Sigma,
integration::Integrator< T > &  I,
beta,
h 
)

Returns the result of the correlation energy at a given time-step from the time-diagonal convolution

Purpose

Calculates the correlation energy given by \( -i/2\) Tr \([G*\Sigma]^<\) at a given time step 'tstp'. The objects 'G' and 'Sigma' are of the class type 'herm_matrix'.

Parameters
tstp

[int] time step

G

[herm_matrix] contour Green's function

Sigma

[herm_matrix] self-energy

I

[Integrator] integrator class

beta

inversed temperature

h

time interval

Definition at line 490 of file cntr_utilities_impl.hpp.

References integration::I(), and cntr::herm_matrix< T >::size1().

491  {
492  int size1=G.size1();
493  std::complex<T> trGxSGM;
494  std::complex<T> *GxSGM = new std::complex<T>[size1*size1];
495 
496  convolution_density_matrix<T,herm_matrix<T>>(tstp, GxSGM, Sigma, G, I, beta, h);
497  trGxSGM = (0.0,0.0);
498  for(int i=0; i< size1; i++){
499  trGxSGM += GxSGM[i*size1 + i];
500  }
501  delete GxSGM;
502  return 0.5*trGxSGM.real();
503 }
Integrator< T > & I(int k)
+ Here is the call graph for this function: