10
1
mirror of https://github.com/pfloos/quack synced 2024-12-23 21:03:47 +01:00
QuAcK/src/GT/GTpp_ppBSE_static_kernel_C.f90

155 lines
3.4 KiB
Fortran
Raw Normal View History

2023-07-20 15:54:24 +02:00
subroutine GTpp_ppBSE_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nOO,nVV,nOOx,nVVx,lambda,Om1,rho1,Om2,rho2,TC)
2022-09-09 21:48:50 +02:00
! Compute the VVVV block of the static T-matrix
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: ispin
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) :: nOO
integer,intent(in) :: nVV
integer,intent(in) :: nOOx
integer,intent(in) :: nVVx
double precision,intent(in) :: lambda
double precision,intent(in) :: Om1(nVV)
double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: Om2(nOO)
double precision,intent(in) :: rho2(nBas,nBas,nOO)
! Local variables
double precision,external :: Kronecker_delta
double precision :: chi
double precision :: eps
integer :: a,b,c,d,ab,cd,ef,mn
! Output variables
double precision,intent(out) :: TC(nVVx,nVVx)
!===============!
! singlet block !
!===============!
if(ispin == 1) then
ab = 0
do a=nO+1,nBas-nR
do b=a,nBas-nR
ab = ab + 1
cd = 0
do c=nO+1,nBas-nR
do d=c,nBas-nR
cd = cd + 1
chi = 0d0
do ef=1,nVV
eps = + Om1(ef)
2022-09-27 14:07:31 +02:00
chi = chi + rho1(a,b,ef)*rho1(c,d,ef)*eps/(eps**2 + eta**2) &
+ rho1(a,b,ef)*rho1(d,c,ef)*eps/(eps**2 + eta**2)
2022-09-09 21:48:50 +02:00
end do
do mn=1,nOO
eps = - Om2(mn)
2022-09-27 14:07:31 +02:00
chi = chi + rho2(a,b,mn)*rho2(c,d,mn)*eps/(eps**2 + eta**2) &
+ rho2(a,b,mn)*rho2(d,c,mn)*eps/(eps**2 + eta**2)
2022-09-09 21:48:50 +02:00
end do
2022-09-27 14:07:31 +02:00
TC(ab,cd) = 0.5d0*lambda*chi/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d)))
2022-09-09 21:48:50 +02:00
end do
end do
end do
end do
end if
!===============!
! triplet block !
!===============!
if(ispin == 2 .or. ispin == 4) then
ab = 0
do a=nO+1,nBas-nR
do b=a+1,nBas-nR
ab = ab + 1
cd = 0
do c=nO+1,nBas-nR
do d=c+1,nBas-nR
cd = cd + 1
chi = 0d0
do ef=1,nVV
eps = + Om1(ef)
chi = chi + rho1(a,b,ef)*rho1(c,d,ef)*eps/(eps**2 + eta**2)
end do
do mn=1,nOO
eps = - Om2(mn)
chi = chi + rho2(a,b,mn)*rho2(c,d,mn)*eps/(eps**2 + eta**2)
end do
TC(ab,cd) = lambda*chi
end do
end do
end do
end do
end if
!==================!
! alpha-beta block !
!==================!
if(ispin == 3) then
ab = 0
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
ab = ab + 1
cd = 0
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
cd = cd + 1
chi = 0d0
do ef=1,nVV
eps = + Om1(ef)
chi = chi + rho1(a,b,ef)*rho1(c,d,ef)*eps/(eps**2 + eta**2)
end do
do mn=1,nOO
eps = - Om2(mn)
chi = chi + rho2(a,b,mn)*rho2(c,d,mn)*eps/(eps**2 + eta**2)
end do
TC(ab,cd) = lambda*chi
end do
end do
end do
end do
end if
2023-07-20 14:59:02 +02:00
end subroutine