mirror of
https://github.com/pfloos/quack
synced 2024-11-09 15:43:56 +01:00
237 lines
6.3 KiB
Fortran
237 lines
6.3 KiB
Fortran
subroutine unrestricted_regularized_self_energy_GF2(nBas,nC,nO,nV,nR,eta,ERI_aa,ERI_ab,ERI_bb,eHF,eGF2,SigC,Z)
|
|
|
|
! Perform unrestricted GF2 self-energy and its renormalization factor
|
|
|
|
implicit none
|
|
include 'parameters.h'
|
|
|
|
|
|
! Input variables
|
|
|
|
integer,intent(in) :: nBas
|
|
integer,intent(in) :: nC(nspin)
|
|
integer,intent(in) :: nO(nspin)
|
|
integer,intent(in) :: nV(nspin)
|
|
integer,intent(in) :: nR(nspin)
|
|
double precision,intent(in) :: eta
|
|
double precision,intent(in) :: ERI_aa(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: ERI_ab(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: ERI_bb(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: eHF(nBas,nspin)
|
|
double precision,intent(in) :: eGF2(nBas,nspin)
|
|
|
|
! Local variables
|
|
|
|
integer :: p,q
|
|
integer :: i,j,a,b
|
|
double precision :: eps,num
|
|
|
|
double precision :: kappa
|
|
double precision :: fk,dfk
|
|
|
|
! Output variables
|
|
|
|
double precision,intent(out) :: SigC(nBas,nBas,nspin)
|
|
double precision,intent(out) :: Z(nBas,nspin)
|
|
|
|
!---------------------!
|
|
! Compute self-energy |
|
|
!---------------------!
|
|
|
|
SigC(:,:,:) = 0d0
|
|
Z(:,:) = 0d0
|
|
|
|
!-----------------------------------------!
|
|
! Parameters for regularized calculations !
|
|
!-----------------------------------------!
|
|
|
|
kappa = 1.1d0
|
|
|
|
!----------------!
|
|
! Spin-up sector
|
|
!----------------!
|
|
|
|
do p=nC(1)+1,nBas-nR(1)
|
|
do q=nC(1)+1,nBas-nR(1)
|
|
|
|
! Addition part: aa
|
|
|
|
do i=nC(1)+1,nO(1)
|
|
do a=nO(1)+1,nBas-nR(1)
|
|
do b=nO(1)+1,nBas-nR(1)
|
|
|
|
eps = eGF2(p,1) + eHF(i,1) - eHF(a,1) - eHF(b,1)
|
|
num = ERI_aa(i,q,a,b)*ERI_aa(a,b,i,p) &
|
|
- ERI_aa(i,q,a,b)*ERI_aa(a,b,p,i)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,1) = SigC(p,q,1) + num*fk
|
|
if(p == q) Z(p,1) = Z(p,1) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Addition part: ab
|
|
|
|
do i=nC(2)+1,nO(2)
|
|
do a=nO(2)+1,nBas-nR(2)
|
|
do b=nO(1)+1,nBas-nR(1)
|
|
|
|
eps = eGF2(p,1) + eHF(i,2) - eHF(a,2) - eHF(b,1)
|
|
num = ERI_ab(q,i,b,a)*ERI_ab(b,a,p,i)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,1) = SigC(p,q,1) + num*fk
|
|
if(p == q) Z(p,1) = Z(p,1) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Removal part: aa
|
|
|
|
do i=nC(1)+1,nO(1)
|
|
do a=nO(1)+1,nBas-nR(1)
|
|
do j=nC(1)+1,nO(1)
|
|
|
|
eps = eGF2(p,1) + eHF(a,1) - eHF(i,1) - eHF(j,1)
|
|
num = ERI_aa(a,q,i,j)*ERI_aa(i,j,a,p) &
|
|
- ERI_aa(a,q,i,j)*ERI_aa(i,j,p,a)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,1) = SigC(p,q,1) + num*fk
|
|
if(p == q) Z(p,1) = Z(p,1) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Removal part: ab
|
|
|
|
do i=nC(2)+1,nO(2)
|
|
do a=nO(2)+1,nBas-nR(2)
|
|
do j=nC(1)+1,nO(1)
|
|
|
|
eps = eGF2(p,1) + eHF(a,2) - eHF(i,2) - eHF(j,1)
|
|
num = ERI_ab(q,a,j,i)*ERI_ab(j,i,p,a)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,1) = SigC(p,q,1) + num*fk
|
|
if(p == q) Z(p,1) = Z(p,1) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
enddo
|
|
enddo
|
|
|
|
!------------------!
|
|
! Spin-down sector !
|
|
!------------------!
|
|
|
|
do p=nC(2)+1,nBas-nR(2)
|
|
do q=nC(2)+1,nBas-nR(2)
|
|
|
|
! Addition part: bb
|
|
|
|
do i=nC(2)+1,nO(2)
|
|
do a=nO(2)+1,nBas-nR(2)
|
|
do b=nO(2)+1,nBas-nR(2)
|
|
|
|
eps = eGF2(p,2) + eHF(i,2) - eHF(a,2) - eHF(b,2)
|
|
num = ERI_bb(i,q,a,b)*ERI_bb(a,b,i,p) &
|
|
- ERI_bb(i,q,a,b)*ERI_bb(a,b,p,i)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,2) = SigC(p,q,2) + num*eps/(eps**2 + eta**2)
|
|
if(p == q) Z(p,2) = Z(p,2) - num*(eps**2 - eta**2)/(eps**2 + eta**2)**2
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Addition part: ab
|
|
|
|
do i=nC(1)+1,nO(1)
|
|
do a=nO(1)+1,nBas-nR(1)
|
|
do b=nO(2)+1,nBas-nR(2)
|
|
|
|
eps = eGF2(p,2) + eHF(i,1) - eHF(a,1) - eHF(b,2)
|
|
num = ERI_ab(i,q,a,b)*ERI_ab(a,b,i,p)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,2) = SigC(p,q,2) + num*fk
|
|
if(p == q) Z(p,2) = Z(p,2) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Removal part: bb
|
|
|
|
do i=nC(2)+1,nO(2)
|
|
do a=nO(2)+1,nBas-nR(2)
|
|
do j=nC(2)+1,nO(2)
|
|
|
|
eps = eGF2(p,2) + eHF(a,2) - eHF(i,2) - eHF(j,2)
|
|
num = ERI_bb(a,q,i,j)*ERI_bb(i,j,a,p) &
|
|
- ERI_bb(a,q,i,j)*ERI_bb(i,j,p,a)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,2) = SigC(p,q,2) + num*fk
|
|
if(p == q) Z(p,2) = Z(p,2) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
! Removal part: ab
|
|
|
|
do i=nC(1)+1,nO(1)
|
|
do a=nO(1)+1,nBas-nR(1)
|
|
do j=nC(2)+1,nO(2)
|
|
|
|
eps = eGF2(p,2) + eHF(a,1) - eHF(i,1) - eHF(j,2)
|
|
num = ERI_ab(a,q,i,j)*ERI_ab(i,j,a,p)
|
|
|
|
fk = (1d0 - exp(-kappa*abs(eps)))**2/eps
|
|
dfk = - 1d0/eps + 2d0*kappa*exp(-kappa*abs(eps))/(1d0 - exp(-kappa*abs(eps)))
|
|
dfk = dfk*fk
|
|
|
|
SigC(p,q,2) = SigC(p,q,2) + num*fk
|
|
if(p == q) Z(p,2) = Z(p,2) - num*dfk
|
|
|
|
enddo
|
|
enddo
|
|
enddo
|
|
|
|
enddo
|
|
enddo
|
|
|
|
Z(:,:) = 1d0/(1d0 - Z(:,:))
|
|
|
|
end subroutine unrestricted_regularized_self_energy_GF2
|