10
1
mirror of https://github.com/pfloos/quack synced 2024-12-24 21:33:45 +01:00
QuAcK/src/GT/GTeh_self_energy_diag.f90

92 lines
2.1 KiB
Fortran
Raw Normal View History

2023-07-12 14:13:45 +02:00
subroutine GTeh_self_energy_diag(eta,nBas,nC,nO,nV,nR,nS,e,Om,rhoL,rhoR,EcGM,Sig,Z)
2023-06-29 18:54:00 +02:00
2023-07-12 14:13:45 +02:00
! Compute diagonal of the correlation part of the self-energy and the renormalization factor
2023-06-29 18:54:00 +02:00
implicit none
include 'parameters.h'
! Input variables
double precision,intent(in) :: eta
integer,intent(in) :: nBas
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nV
integer,intent(in) :: nR
integer,intent(in) :: nS
double precision,intent(in) :: e(nBas)
double precision,intent(in) :: Om(nS)
2023-07-27 10:11:35 +02:00
double precision,intent(in) :: rhoL(nBas,nBas,nS,2)
double precision,intent(in) :: rhoR(nBas,nBas,nS,2)
2023-06-29 18:54:00 +02:00
! Local variables
2023-07-17 13:35:24 +02:00
integer :: i,a,p,m
2023-07-12 14:13:45 +02:00
double precision :: num,eps
2023-06-29 18:54:00 +02:00
! Output variables
2023-07-12 14:13:45 +02:00
double precision,intent(out) :: Sig(nBas)
double precision,intent(out) :: Z(nBas)
2023-06-29 18:54:00 +02:00
double precision,intent(out) :: EcGM
! Initialize
2023-07-12 14:13:45 +02:00
Sig(:) = 0d0
Z(:) = 0d0
2023-06-29 18:54:00 +02:00
!-----------------------------
! GW self-energy
!-----------------------------
! Occupied part of the correlation self-energy
do p=nC+1,nBas-nR
do i=nC+1,nO
do m=1,nS
2023-07-12 14:13:45 +02:00
2023-06-29 18:54:00 +02:00
eps = e(p) - e(i) + Om(m)
2023-07-27 16:43:15 +02:00
num = rhoL(i,p,m,1)*rhoR(i,p,m,2)
2023-07-12 14:13:45 +02:00
Sig(p) = Sig(p) + num*eps/(eps**2 + eta**2)
Z(p) = Z(p) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2023-06-29 18:54:00 +02:00
end do
end do
end do
! Virtual part of the correlation self-energy
do p=nC+1,nBas-nR
do a=nO+1,nBas-nR
do m=1,nS
2023-07-12 14:13:45 +02:00
2023-06-29 18:54:00 +02:00
eps = e(p) - e(a) - Om(m)
2023-07-27 16:43:15 +02:00
num = rhoL(p,a,m,1)*rhoR(p,a,m,2)
2023-07-12 14:13:45 +02:00
Sig(p) = Sig(p) + num*eps/(eps**2 + eta**2)
Z(p) = Z(p) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2023-06-29 18:54:00 +02:00
end do
end do
end do
! GM correlation energy
EcGM = 0d0
2023-07-17 13:35:24 +02:00
! do i=nC+1,nO
! do a=nO+1,nBas-nR
! do m=1,nS
2023-07-12 14:13:45 +02:00
2023-07-17 13:35:24 +02:00
! eps = e(a) - e(i) + Om(m)
! num = rhoL(i,a,m)*rhoR(i,a,m)
! EcGM = EcGM - num*eps/(eps**2 + eta**2)
2023-07-12 14:13:45 +02:00
2023-07-17 13:35:24 +02:00
! end do
! end do
! end do
2023-06-29 18:54:00 +02:00
2023-07-12 14:13:45 +02:00
! Compute renormalization factor from derivative
Z(:) = 1d0/(1d0 - Z(:))
2023-06-29 18:54:00 +02:00
end subroutine