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

53 lines
1.3 KiB
Fortran
Raw Permalink Normal View History

2023-07-30 22:01:44 +02:00
double precision function UGW_dSigC(p,w,eta,nBas,nC,nO,nV,nR,nS,e,Om,rho)
2020-09-23 14:23:40 +02:00
! Compute the derivative of the correlation part of the self-energy
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: p
double precision,intent(in) :: w
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-30 22:01:44 +02:00
double precision,intent(in) :: Om(nS)
2020-09-24 14:39:37 +02:00
double precision,intent(in) :: rho(nBas,nBas,nS)
2020-09-23 14:23:40 +02:00
! Local variables
2023-10-25 13:19:21 +02:00
integer :: i,a,m
2023-07-30 22:01:44 +02:00
double precision :: num,eps
2020-09-23 14:23:40 +02:00
! Initialize
2023-07-30 22:01:44 +02:00
UGW_dSigC = 0d0
2020-09-23 14:23:40 +02:00
! Occupied part of the correlation self-energy
do i=nC+1,nO
2023-10-25 13:19:21 +02:00
do m=1,nS
eps = w - e(i) + Om(m)
num = rho(p,i,m)**2
UGW_dSigC = UGW_dSigC - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2020-09-23 14:23:40 +02:00
end do
end do
! Virtual part of the correlation self-energy
do a=nO+1,nBas-nR
2023-10-25 13:19:21 +02:00
do m=1,nS
eps = w - e(a) - Om(m)
num = rho(p,a,m)**2
UGW_dSigC = UGW_dSigC - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2020-09-23 14:23:40 +02:00
end do
end do
2023-07-30 22:01:44 +02:00
end function