4
1
mirror of https://github.com/pfloos/quack synced 2024-06-23 05:32:15 +02:00
quack/src/HF/mo_fock_exchange_potential.f90

42 lines
866 B
Fortran
Raw Normal View History

2022-01-26 13:05:16 +01:00
subroutine mo_fock_exchange_potential(nBas,c,P,ERI,Vx)
2021-02-15 17:27:06 +01:00
! Compute the exchange potential in the MO basis
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nBas
double precision,intent(in) :: c(nBas,nBas)
2022-01-26 13:05:16 +01:00
double precision,intent(in) :: P(nBas,nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
2021-02-15 17:27:06 +01:00
! Local variables
integer :: mu,nu
2022-01-26 13:05:16 +01:00
integer :: q
double precision,allocatable :: Fx(:,:)
2021-02-15 17:27:06 +01:00
! Output variables
double precision,intent(out) :: Vx(nBas)
! Compute Vx
2022-01-26 13:05:16 +01:00
allocate(Fx(nBas,nBas))
call exchange_matrix_AO_basis(nBas,P,ERI,Fx)
2021-02-15 17:27:06 +01:00
Vx(:) = 0d0
2022-01-26 13:05:16 +01:00
do q=1,nBas
2021-02-15 17:27:06 +01:00
do mu=1,nBas
do nu=1,nBas
2022-01-26 13:05:16 +01:00
Vx(q) = Vx(q) + c(mu,q)*Fx(mu,nu)*c(nu,q)
2021-02-15 17:27:06 +01:00
end do
end do
end do
2022-01-26 13:05:16 +01:00
deallocate(Fx)
2022-01-07 09:56:30 +01:00
end subroutine mo_fock_exchange_potential