4
1
mirror of https://github.com/pfloos/quack synced 2024-11-19 04:22:39 +01:00
quack/src/QuAcK/linear_response_B_pp.f90

69 lines
1.3 KiB
Fortran
Raw Normal View History

2019-10-07 22:31:45 +02:00
subroutine linear_response_B_pp(ispin,nBas,nC,nO,nV,nR,nOO,nVV,e,ERI,B_pp)
2019-10-05 22:06:25 +02:00
! Compute the B 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
double precision,external :: Kronecker_delta
integer :: a,b,i,j,ab,ij
! Output variables
double precision,intent(out) :: B_pp(nVV,nOO)
2019-10-07 22:31:45 +02:00
! Build B matrix for the singlet manifold
if(ispin == 1) then
ab = 0
do a=nO+1,nBas-nR
do b=nO+1,a
ab = ab + 1
ij = 0
do i=nC+1,nO
do j=nC+1,i
ij = ij + 1
B_pp(ab,ij) = (ERI(a,b,i,j) + ERI(a,b,j,i))/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(i,j)))
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 the B matrix for the triplet manifold
2019-10-05 22:06:25 +02:00
2019-10-07 22:31:45 +02:00
if(ispin == 2) 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
do b=nO+1,a-1
ab = ab + 1
ij = 0
do i=nC+1,nO
do j=nC+1,i-1
ij = ij + 1
2019-10-05 22:06:25 +02:00
2019-10-07 22:31:45 +02:00
B_pp(ab,ij) = ERI(a,b,i,j) - ERI(a,b,j,i)
end do
end do
end do
end do
end if
2019-10-05 22:06:25 +02:00
end subroutine linear_response_B_pp