The Elk Code
 
Loading...
Searching...
No Matches
gwtails.f90
Go to the documentation of this file.
1
2! Copyright (C) 2018 A. Davydov, J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: gwtails
8! !INTERFACE:
9pure complex(8) function gwtails(ge)
10! !USES:
11use modmain
12use modgw
13! !INPUT/OUTPUT PARAMETERS:
14! ge : Green's function at the Matsubara end points (in,complex(4))
15! !DESCRIPTION:
16! Sums the tails of the Green's function over the Matsubara frequencies as
17! part of the evaluation of the density matrix. Thus if the Green's function
18! $G(ij{\bf k},\omega_n)$ has been determined numerically over all Fermionic
19! Matsubara frequencies up to $\pm \omega_{N_{\rm F}}$, then the density
20! matrix is approximated by
21! $$ \gamma_{ij{\bf k}}=\frac{1}{\beta}\sum_{n\;{\rm odd}}^{\pm N_{\rm F}}
22! \left[G(ij{\bf k},\omega_n)+\frac{a_2}{\omega_n^2}
23! -\frac{a_4}{\omega_n^4}\right]+\frac{1}{\beta}\left[\frac{\beta}{2}a_1
24! -\frac{\beta^2}{4}a_2+\frac{\beta^4}{48}a_4\right], $$
25! where $a_1$, $a_2$ and $a_4$ are chosen so that the Green's function is
26! equal to
27! $$ g(z)=\frac{a_1}{z}+\frac{a_2}{z^2}+\frac{a_3}{z^3}+\frac{a_4}{z^4} $$
28! at the points $n\in \{-n_{\rm F}, -n_{\rm F}+2, n_{\rm F}-2, n_{\rm F}\}$.
29!
30! !REVISION HISTORY:
31! Created April 2018 (A. Davydov)
32! Increased Laurent series order to 4, December 2023 (JKD)
33!EOP
34!BOC
35implicit none
36! arguments
37complex(8), intent(in) :: ge(4)
38! local variables
39integer iw
40real(8) sm2,sm4,t1,t2,t3
41real(8) c2,c3,c4,d2,d3,d4
42complex(8) a1,a2,a4,z1,z2
43! π / β
45t2=1.d0/(8.d0*dble(nwfm-1))
46t3=dble(nwfm)
47c2=t3**2
48c3=c2*t3
49c4=c3*t3
50t3=dble(nwfm-2)
51d2=t3**2
52d3=d2*t3
53d4=d3*t3
54! determine the coefficients a1, a2 and a4
55a1=(d3*(ge(2)-ge(3))+c3*(ge(4)-ge(1)))*t1*t2
56a1=zi*a1
57z1=ge(2)+ge(3)
58z2=ge(1)+ge(4)
59t3=t1**2
60a2=(d4*z1-c4*z2)*t3*t2
61t3=t3**2
62a4=(d2*z1-c2*z2)*c2*d2*t3*t2
63! evaluate the sums analytically over all Matsubara frequencies
64t1=1.d0/(2.d0*kboltz*tempk)
65t2=t1**2
66gwtails=a1*t1-a2*t2+a4*(t2**2)/3.d0
67! remove the contributions over the finite set of frequencies
68sm2=0.d0
69sm4=0.d0
70do iw=0,nwfm
71 t1=aimag(wfm(iw))**2
72 sm2=sm2+1.d0/t1
73 sm4=sm4+1.d0/t1**2
74end do
75gwtails=gwtails+sm2*a2-sm4*a4
76end function
77!EOC
78
pure complex(8) function gwtails(ge)
Definition gwtails.f90:10
Definition modgw.f90:6
complex(8), dimension(:), allocatable wfm
Definition modgw.f90:25
integer nwfm
Definition modgw.f90:19
real(8), parameter pi
Definition modmain.f90:1229
complex(8), parameter zi
Definition modmain.f90:1239
real(8), parameter kboltz
Definition modmain.f90:1262
real(8) tempk
Definition modmain.f90:684