2022-01-07 09:13:38 +01:00
|
|
|
subroutine hartree_potential(nBas,P,ERI,J)
|
2021-11-30 09:29:50 +01:00
|
|
|
|
|
|
|
! Compute the unrestricted version of the Hartree potential
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
double precision,intent(in) :: P(nBas,nBas)
|
|
|
|
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: mu,nu,la,si
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: J(nBas,nBas)
|
|
|
|
|
|
|
|
J(:,:) = 0d0
|
|
|
|
do si=1,nBas
|
|
|
|
do la=1,nBas
|
|
|
|
do nu=1,nBas
|
|
|
|
do mu=1,nBas
|
|
|
|
J(mu,nu) = J(mu,nu) + P(la,si)*ERI(mu,la,nu,si)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
2022-01-07 09:13:38 +01:00
|
|
|
end subroutine hartree_potential
|