2019-10-07 22:31:45 +02:00
|
|
|
subroutine linear_response_C_pp(ispin,nBas,nC,nO,nV,nR,nOO,nVV,e,ERI,C_pp)
|
2019-10-05 22:06:25 +02:00
|
|
|
|
|
|
|
! Compute the C matrix of the pp channel
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: ispin
|
|
|
|
integer,intent(in) :: nBas,nC,nO,nV,nR,nOO,nVV
|
|
|
|
double precision,intent(in) :: e(nBas),ERI(nBas,nBas,nBas,nBas)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
2019-10-06 20:08:38 +02:00
|
|
|
double precision :: eF
|
2019-10-05 22:06:25 +02:00
|
|
|
double precision,external :: Kronecker_delta
|
|
|
|
|
|
|
|
integer :: a,b,c,d,ab,cd
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: C_pp(nVV,nVV)
|
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
! Define the chemical potential
|
|
|
|
|
|
|
|
eF = e(nO) + e(nO+1)
|
2020-03-24 12:28:56 +01:00
|
|
|
eF = 0d0
|
2019-10-07 22:31:45 +02:00
|
|
|
|
|
|
|
! Build C matrix for the singlet manifold
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
if(ispin == 1) then
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
ab = 0
|
|
|
|
do a=nO+1,nBas-nR
|
2020-03-19 10:21:18 +01:00
|
|
|
do b=a,nBas-nR
|
2019-10-07 22:31:45 +02:00
|
|
|
ab = ab + 1
|
|
|
|
cd = 0
|
|
|
|
do c=nO+1,nBas-nR
|
2020-03-19 10:21:18 +01:00
|
|
|
do d=c,nBas-nR
|
2019-10-07 22:31:45 +02:00
|
|
|
cd = cd + 1
|
|
|
|
|
|
|
|
C_pp(ab,cd) = + (e(a) + e(b) - eF)*Kronecker_delta(a,c)*Kronecker_delta(b,d) &
|
|
|
|
+ (ERI(a,b,c,d) + ERI(a,b,d,c))/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d)))
|
|
|
|
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
end if
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
! Build C matrix for the triplet manifold
|
|
|
|
|
|
|
|
if(ispin == 2) then
|
|
|
|
|
|
|
|
ab = 0
|
|
|
|
do a=nO+1,nBas-nR
|
2020-03-19 10:21:18 +01:00
|
|
|
do b=a+1,nBas-nR
|
2019-10-07 22:31:45 +02:00
|
|
|
ab = ab + 1
|
|
|
|
cd = 0
|
|
|
|
do c=nO+1,nBas-nR
|
2020-03-19 10:21:18 +01:00
|
|
|
do d=c+1,nBas-nR
|
2019-10-07 22:31:45 +02:00
|
|
|
cd = cd + 1
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
C_pp(ab,cd) = + (e(a) + e(b) - eF)*Kronecker_delta(a,c)*Kronecker_delta(b,d) &
|
|
|
|
+ ERI(a,b,c,d) - ERI(a,b,d,c)
|
|
|
|
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2019-10-06 20:08:38 +02:00
|
|
|
|
2019-10-07 22:31:45 +02:00
|
|
|
end if
|
2019-10-05 22:06:25 +02:00
|
|
|
|
2019-10-23 08:22:36 +02:00
|
|
|
! Build C matrix for the spinorbital basis
|
|
|
|
|
|
|
|
if(ispin == 3) 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
|
|
|
|
|
|
|
|
C_pp(ab,cd) = + (e(a) + e(b) - eF)*Kronecker_delta(a,c)*Kronecker_delta(b,d) &
|
|
|
|
+ ERI(a,b,c,d) - ERI(a,b,d,c)
|
|
|
|
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
2019-10-05 22:06:25 +02:00
|
|
|
end subroutine linear_response_C_pp
|