2020-07-06 20:57:27 +02:00
|
|
|
subroutine unrestricted_fock_exchange_energy(nBas,P,Fx,Ex)
|
|
|
|
|
|
|
|
! Compute the (exact) Fock exchange energy
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
double precision,intent(in) :: P(nBas,nBas)
|
|
|
|
double precision,intent(in) :: Fx(nBas,nBas)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
double precision,external :: trace_matrix
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Ex
|
|
|
|
|
|
|
|
! Compute HF exchange energy
|
|
|
|
|
2021-01-26 21:28:05 +01:00
|
|
|
Ex = 0.5d0*trace_matrix(nBas,matmul(P,Fx))
|
2020-07-06 20:57:27 +02:00
|
|
|
|
|
|
|
end subroutine unrestricted_fock_exchange_energy
|