Utilities
Comparing Green’s functions
To compare the data of two Green’s functions on a given timestep, one can use:
|
Returns a difference measure \(\Delta[A,B]_{\tt tstp}\) (see below) between |
The type GType of
AandBiscntr::herm_matrix<T>orcntr::herm_matrix_timestep<T>, the return type isT(template parameter)Size requirements:
AandBmust have equalsize1andntauFor
X=A,B: IfXisherm_matrix, thenX.nt()>=tstpis required; ifXisherm_matrix_timestep, thenX.tstp()==tstpis required.
The difference is defined as the \(L_2\)-norm difference \(|| M ||\) for \(M=A(t,t')-B(t,t')\) of the individual elements, summed over all time-arguments of the timestep:
\(|| M ||\) is the standard matrix \(L_2\) norm.
It is also possible to compare the individual components entering (16) separately. For tstp>=0, one obtains the differences of the retarded/lesser/left-mixing components by cntr::distance_norm2_ret/cntr::distance_norm2_les/cntr::distance_norm2_tv. The interface is identical to cntr::distance_norm2.
Example:
A typical application is to check for convergence in self-consistent simulations:
// int nt= ...
// int ntau= ...
// int sig=...
GREEN G(nt,ntau,size1,sig);
// int tstp= ...
// some iterative procedure to determine G on timestep tstp:
{
GREEN_TSTP tG(tstp,ntau,size1,sig); //temporary variable
double convergence_error;
int iter_max=100;
for(int iter=0;iter<=iter_max;iter++){
tG.set_timestep(tstp,G); // store values of G before iteration
// ... some code to update G on timestep tstp ...
convergence_error = cntr::distance_norm2(tstp,G,tG);
if( convergence_error < some_sufficiently_small_number) break;
}
if(iter>iter_max){
cout << "no convergence!" << endl;
}
}
Timestep extrapolation
Extrapolation:
|
Extrapolate from timesteps |
The type GType of
Aiscntr::herm_matrix<T>orcntr::function<T>If
Aisherm_matrix, all entries \(A(t,t')\) on timesteptstp+1are written; ifAisfunction, the valueA(tstp+1)is written.Size requirements:
tstp>=ExtrapolationOrderandA.nt()>=tstp+1requiredThe
ExtrapolationOrdermust be between1andMAX_SOLVE_ORDER(=5).
Continuation from Imaginary time to Real time 0:
|
Sets the values at timestep |
Size requirements:
A.nt()>=0required
Continuity of \(A(t,t')\) implies that the point 0 on the lower real-time branch and on the imaginary time branch of the contour are identical. This implies timestep 0 can be set from timestep -1 using the relation (\(\xi\) is the FERMION or BOSON sign):
\(G^{\rceil}(0,j\Delta \tau) = \xi G^M(({\tt ntau} - j)\Delta \tau)\) for
j=0,...,ntau\(G^{<}(0,0) = G^{\rceil}(0,0)\)
\(G^{R}(0,0) = i G^M(0) - G^{<}(0,0)\)
Note
A two-time function need not be continuous if it explicitly depends on a parameter which changes discontinuously from the imaginary time to real-time contour. For example, the self-energy depends on the interaction U, which changes discontinuously for an interaction quench at time 0.
Differentiation
In order to perform differentiation on the real part of the contour, one can use:
|
Calculates the left derivative |
|
Calculates the right derivative |
The type
GtypeofA,Acc, anddAiscntr::herm_matrix<T>. Currently, the routines are implemented only for objects ofsize1=1Accis the conjugate function toA(similar as in Convolution). IfAis hermitian, simply provideAcc=A.For the computation of timestep
tstp, \(A(t,t')\) is addressed at \(t,t' \leq \max(n,k)\), where \(k\) is the solver order. Note thattstp=0..kcan be computed only ifAis given for \(t,t'\leq k\).The possible contribution proportional to \(\delta(t,t')\), arising from the step discontinuity of a Green’s function at equal times, is subtracted in these routines.