4
1
mirror of https://github.com/pfloos/quack synced 2024-06-02 11:25:28 +02:00
quack/src/LR/ppULR_B.f90

110 lines
2.3 KiB
Fortran
Raw Permalink Normal View History

2023-07-21 13:04:29 +02:00
subroutine ppULR_B(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb,nPt,nHaa,nHab,nHbb,nHt,lambda,ERI_aaaa,ERI_aabb,ERI_bbbb,Bpp)
2021-12-15 11:41:06 +01:00
! Compute linear response
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: ispin
integer,intent(in) :: nBas
integer,intent(in) :: nC(nspin)
integer,intent(in) :: nO(nspin)
integer,intent(in) :: nV(nspin)
integer,intent(in) :: nR(nspin)
integer,intent(in) :: nPaa
integer,intent(in) :: nPab
integer,intent(in) :: nPbb
integer,intent(in) :: nPt
integer,intent(in) :: nHaa
integer,intent(in) :: nHab
integer,intent(in) :: nHbb
integer,intent(in) :: nHt
2021-12-31 12:49:13 +01:00
double precision,intent(in) :: lambda
2021-12-15 11:41:06 +01:00
double precision,intent(in) :: ERI_aaaa(nBas,nBas,nBas,nBas)
double precision,intent(in) :: ERI_aabb(nBas,nBas,nBas,nBas)
double precision,intent(in) :: ERI_bbbb(nBas,nBas,nBas,nBas)
! Local variables
double precision :: eF
double precision,external :: Kronecker_delta
integer :: i,j,a,b,c,d,ij,ab
! Output variables
2023-07-21 13:04:29 +02:00
double precision,intent(out) :: Bpp(nPt,nHt)
2021-12-15 11:41:06 +01:00
eF = 0d0
2022-02-15 13:51:18 +01:00
if(ispin == 3) then
2021-12-15 11:41:06 +01:00
2021-12-31 12:49:13 +01:00
! abab block
2021-12-15 11:41:06 +01:00
ab = 0
do a=nO(1)+1,nBas-nR(1)
2021-12-31 12:49:13 +01:00
do b=nO(2)+1,nBas-nR(2)
2021-12-15 11:41:06 +01:00
ab = ab + 1
ij = 0
do i=nC(1)+1,nO(1)
2021-12-31 12:49:13 +01:00
do j=nC(2)+1,nO(2)
2021-12-15 11:41:06 +01:00
ij = ij + 1
2023-07-21 13:04:29 +02:00
Bpp(ab,ij) = lambda*ERI_aabb(a,b,i,j)
2021-12-15 11:41:06 +01:00
end do
end do
end do
end do
end if
2022-02-15 13:51:18 +01:00
if(ispin == 4) then
2021-12-15 11:41:06 +01:00
2021-12-31 12:49:13 +01:00
! aaaa block
2021-12-15 11:41:06 +01:00
ab = 0
do a=nO(1)+1,nBas-nR(1)
2021-12-31 12:49:13 +01:00
do b=a+1,nBas-nR(1)
2021-12-15 11:41:06 +01:00
ab = ab + 1
ij = 0
do i=nC(1)+1,nO(1)
2021-12-31 12:49:13 +01:00
do j=i+1,nO(1)
2021-12-15 11:41:06 +01:00
ij = ij + 1
2021-12-31 12:49:13 +01:00
2023-07-21 13:04:29 +02:00
Bpp(ab,ij) = lambda*(ERI_aaaa(a,b,i,j) - ERI_aaaa(a,b,j,i))
2021-12-31 12:49:13 +01:00
end do
end do
end do
end do
end if
2021-12-16 12:28:28 +01:00
2022-02-15 13:51:18 +01:00
if (ispin == 7) then
2021-12-16 12:28:28 +01:00
2021-12-31 12:49:13 +01:00
! bbbb block
ab = 0
do a=nO(2)+1,nBas-nR(2)
do b=a+1,nBas-nR(2)
ab = ab + 1
ij = 0
do i=nC(2)+1,nO(2)
do j=i+1,nO(2)
ij = ij + 1
2023-07-21 13:04:29 +02:00
Bpp(ab,ij) = lambda*(ERI_bbbb(a,b,i,j) - ERI_bbbb(a,b,j,i))
2021-12-16 12:28:28 +01:00
2021-12-15 11:41:06 +01:00
end do
end do
end do
end do
end if
2023-07-21 13:04:29 +02:00
end subroutine