4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/LR/unrestricted_linear_response_B_pp.f90

111 lines
2.4 KiB
Fortran
Raw Normal View History

2021-12-15 11:41:06 +01:00
subroutine unrestricted_linear_response_B_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb,nPt,nHaa, &
2021-12-31 12:49:13 +01:00
nHab,nHbb,nHt,lambda,ERI_aaaa,ERI_aabb,ERI_bbbb,B_pp)
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
double precision,intent(out) :: B_pp(nPt,nHt)
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
2021-12-31 12:49:13 +01:00
B_pp(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
B_pp(ab,ij) = lambda*(ERI_aaaa(a,b,i,j) - ERI_aaaa(a,b,j,i))
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
B_pp(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
end subroutine unrestricted_linear_response_B_pp