mirror of
https://github.com/pfloos/quack
synced 2024-08-16 17:48:35 +02:00
138 lines
3.9 KiB
Fortran
138 lines
3.9 KiB
Fortran
subroutine GF2_ppBSE2_static_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nOO,lambda,ERI,eGF,KD_sta)
|
|
|
|
! Compute the resonant part of the static BSE2 matrix
|
|
|
|
implicit none
|
|
include 'parameters.h'
|
|
|
|
! Input variables
|
|
|
|
integer,intent(in) :: ispin
|
|
integer,intent(in) :: nBas
|
|
integer,intent(in) :: nC
|
|
integer,intent(in) :: nO
|
|
integer,intent(in) :: nV
|
|
integer,intent(in) :: nR
|
|
integer,intent(in) :: nOO
|
|
double precision,intent(in) :: eta
|
|
double precision,intent(in) :: lambda
|
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
|
double precision,intent(in) :: eGF(nBas)
|
|
|
|
! Local variables
|
|
|
|
double precision :: dem,num
|
|
integer :: i,j,k,l,m
|
|
integer :: e
|
|
integer :: ij,kl
|
|
|
|
! Output variables
|
|
|
|
double precision,intent(out) :: KD_sta(nOO,nOO)
|
|
|
|
! Initialization
|
|
|
|
KD_sta(:,:) = 0d0
|
|
|
|
! Second-order correlation kernel for the block D of the singlet manifold
|
|
|
|
if(ispin == 1) then
|
|
|
|
ij = 0
|
|
do i=nC+1,nO
|
|
do j=i,nO
|
|
ij = ij + 1
|
|
|
|
kl = 0
|
|
do k=nC+1,nO
|
|
do l=k,nO
|
|
kl = kl + 1
|
|
|
|
do m=nC+1,nO
|
|
do e=nO+1,nBas-nR
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(i,e,k,m)*ERI(j,m,l,e) - ERI(i,e,k,m)*ERI(j,m,e,l) &
|
|
- ERI(i,e,m,k)*ERI(j,m,l,e) + 2d0*ERI(i,e,m,k)*ERI(j,m,e,l)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) + 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(j,e,k,m)*ERI(i,m,l,e) - ERI(j,e,k,m)*ERI(i,m,e,l) &
|
|
- ERI(j,e,m,k)*ERI(i,m,l,e) + 2d0*ERI(j,e,m,k)*ERI(i,m,e,l)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) - 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(i,m,k,e)*ERI(j,e,l,m) - ERI(i,m,k,e)*ERI(j,e,m,l) &
|
|
- ERI(i,m,e,k)*ERI(j,e,l,m) + 2d0*ERI(i,m,e,k)*ERI(j,e,m,l)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) + 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(j,m,k,e)*ERI(i,e,l,m) - ERI(j,m,k,e)*ERI(i,e,m,l) &
|
|
- ERI(j,m,e,k)*ERI(i,e,l,m) + 2d0*ERI(j,m,e,k)*ERI(i,e,m,l)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) - 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
end do
|
|
end do
|
|
|
|
end do
|
|
end do
|
|
|
|
end do
|
|
end do
|
|
|
|
end if
|
|
|
|
! Second-order correlation kernel for the block D of the triplet manifold
|
|
|
|
if(ispin == 2) then
|
|
|
|
ij = 0
|
|
do i=nC+1,nO
|
|
do j=i+1,nO
|
|
ij = ij + 1
|
|
|
|
kl = 0
|
|
do k=nC+1,nO
|
|
do l=k+1,nO
|
|
kl = kl + 1
|
|
|
|
do m=nC+1,nO
|
|
do e=nO+1,nBas-nR
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(i,e,k,m)*ERI(j,m,l,e) - ERI(i,e,k,m)*ERI(j,m,e,l) - ERI(i,e,m,k)*ERI(j,m,l,e)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) + 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(j,e,k,m)*ERI(i,m,l,e) - ERI(j,e,k,m)*ERI(i,m,e,l) - ERI(j,e,m,k)*ERI(i,m,l,e)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) - 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(i,m,k,e)*ERI(j,e,l,m) - ERI(i,m,k,e)*ERI(j,e,m,l) - ERI(i,m,e,k)*ERI(j,e,l,m)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) + 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
dem = - eGF(e) + eGF(m)
|
|
num = 2d0*ERI(j,m,k,e)*ERI(i,e,l,m) - ERI(j,m,k,e)*ERI(i,e,m,l) - ERI(j,m,e,k)*ERI(i,e,l,m)
|
|
|
|
KD_sta(ij,kl) = KD_sta(ij,kl) - 0.5d0*num*dem/(dem**2 + eta**2)
|
|
|
|
end do
|
|
end do
|
|
|
|
end do
|
|
end do
|
|
|
|
end do
|
|
end do
|
|
|
|
end if
|
|
|
|
end subroutine
|