4
1
mirror of https://github.com/pfloos/quack synced 2024-06-02 11:25:28 +02:00
quack/src/GW/GW_self_energy_diag.f90

91 lines
2.0 KiB
Fortran
Raw Permalink Normal View History

2023-07-21 13:04:29 +02:00
subroutine GW_self_energy_diag(eta,nBas,nC,nO,nV,nR,nS,e,Om,rho,EcGM,Sig,Z)
2019-03-19 10:13:33 +01:00
2023-07-12 14:13:45 +02:00
! Compute diagonal of the correlation part of the self-energy and the renormalization factor
2019-03-19 10:13:33 +01:00
implicit none
include 'parameters.h'
! Input variables
2019-09-22 21:15:53 +02:00
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)
2023-07-21 13:04:29 +02:00
double precision,intent(in) :: Om(nS)
2019-09-22 21:15:53 +02:00
double precision,intent(in) :: rho(nBas,nBas,nS)
2019-03-19 10:13:33 +01:00
! Local variables
2023-07-23 22:03:42 +02:00
integer :: i,a,p,m
2023-07-12 14:13:45 +02:00
double precision :: num,eps
2019-03-19 10:13:33 +01:00
! Output variables
2023-07-12 14:13:45 +02:00
double precision,intent(out) :: Sig(nBas)
double precision,intent(out) :: Z(nBas)
2019-03-19 10:13:33 +01:00
double precision,intent(out) :: EcGM
! Initialize
2023-07-12 14:13:45 +02:00
Sig(:) = 0d0
Z(:) = 0d0
2019-03-19 10:13:33 +01:00
!----------------!
! GW self-energy !
!----------------!
2019-03-19 10:13:33 +01:00
! Occupied part of the correlation self-energy
2019-03-19 10:13:33 +01:00
do p=nC+1,nBas-nR
2019-03-19 10:13:33 +01:00
do i=nC+1,nO
2023-07-23 22:03:42 +02:00
do m=1,nS
2020-09-21 16:54:38 +02:00
2023-07-23 22:03:42 +02:00
eps = e(p) - e(i) + Om(m)
num = 2d0*rho(p,i,m)**2
Sig(p) = Sig(p) + num*eps/(eps**2 + eta**2)
Z(p) = Z(p) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2020-09-21 16:54:38 +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
2023-07-23 22:03:42 +02:00
do m=1,nS
2023-07-12 14:13:45 +02:00
2023-07-23 22:03:42 +02:00
eps = e(p) - e(a) - Om(m)
num = 2d0*rho(p,a,m)**2
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-07-12 14:13:45 +02:00
2020-09-21 16:54:38 +02:00
end do
end do
end do
2019-03-19 10:13:33 +01:00
! Galitskii-Migdal correlation energy
2019-03-19 10:13:33 +01:00
EcGM = 0d0
do i=nC+1,nO
do a=nO+1,nBas-nR
2023-07-23 22:03:42 +02:00
do m=1,nS
2023-07-12 14:13:45 +02:00
2023-07-23 22:03:42 +02:00
eps = e(a) - e(i) + Om(m)
num = 4d0*rho(a,i,m)**2
EcGM = EcGM - num*eps/(eps**2 + eta**2)
2023-07-12 14:13:45 +02:00
2020-09-21 16:54:38 +02:00
end do
end do
end do
2020-09-21 16:54:38 +02:00
2023-07-12 14:13:45 +02:00
! Compute renormalization factor from derivative
Z(:) = 1d0/(1d0 - Z(:))
2023-07-04 10:44:20 +02:00
end subroutine