4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/GF/self_energy_GF2_diag.f90

70 lines
1.6 KiB
Fortran
Raw Normal View History

2021-03-07 22:44:37 +01:00
subroutine self_energy_GF2_diag(eta,nBas,nC,nO,nV,nR,nS,eHF,eGF2,ERI,SigC,Z)
2021-03-06 15:27:35 +01:00
2021-03-06 23:08:43 +01:00
! Compute diagonal part of the GF2 self-energy and its renormalization factor
2021-03-06 15:27:35 +01:00
implicit none
include 'parameters.h'
! Input variables
double precision,intent(in) :: eta
integer,intent(in) :: nBas,nC,nO,nV,nR,nS
double precision,intent(in) :: eHF(nBas)
double precision,intent(in) :: eGF2(nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
! Local variables
integer :: i,j,a,b
2021-03-06 23:08:43 +01:00
integer :: p
2021-03-06 15:27:35 +01:00
double precision :: eps
double precision :: num
! Output variables
2021-03-06 23:08:43 +01:00
double precision,intent(out) :: SigC(nBas)
2021-03-06 15:27:35 +01:00
double precision,intent(out) :: Z(nBas)
! Initialize
2021-03-06 23:08:43 +01:00
SigC(:) = 0d0
Z(:) = 0d0
2021-03-06 15:27:35 +01:00
! Compute GF2 self-energy
do p=nC+1,nBas-nR
2021-03-06 23:08:43 +01:00
do i=nC+1,nO
do j=nC+1,nO
do a=nO+1,nBas-nR
2021-03-06 15:27:35 +01:00
2021-03-06 23:08:43 +01:00
eps = eGF2(p) + eHF(a) - eHF(i) - eHF(j)
num = (2d0*ERI(p,a,i,j) - ERI(p,a,j,i))*ERI(p,a,i,j)
2021-03-06 15:27:35 +01:00
2021-03-06 23:08:43 +01:00
SigC(p) = SigC(p) + num*eps/(eps**2 + eta**2)
Z(p) = Z(p) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2021-03-06 15:27:35 +01:00
end do
end do
end do
end do
do p=nC+1,nBas-nR
2021-03-06 23:08:43 +01:00
do i=nC+1,nO
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
2021-03-06 15:27:35 +01:00
2021-03-06 23:08:43 +01:00
eps = eGF2(p) + eHF(i) - eHF(a) - eHF(b)
num = (2d0*ERI(p,i,a,b) - ERI(p,i,b,a))*ERI(p,i,a,b)
2021-03-06 15:27:35 +01:00
2021-03-06 23:08:43 +01:00
SigC(p) = SigC(p) + num*eps/(eps**2 + eta**2)
Z(p) = Z(p) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
2021-03-06 15:27:35 +01:00
end do
end do
end do
end do
Z(:) = 1d0/(1d0 - Z(:))
2021-03-06 23:08:43 +01:00
end subroutine self_energy_GF2_diag