2020-08-01 11:45:17 +02:00
|
|
|
subroutine restricted_auxiliary_energy(nBas,nEns,nO,eps,Eaux,occnum)
|
2020-03-30 22:45:05 +02:00
|
|
|
|
|
|
|
! Compute the auxiliary KS energies
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
integer,intent(in) :: nO
|
|
|
|
double precision,intent(in) :: eps(nBas)
|
2020-08-01 11:45:17 +02:00
|
|
|
double precision,intent(in),dimension(2,2,3) :: occnum
|
|
|
|
|
2020-03-30 22:45:05 +02:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iEns
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Eaux(nEns)
|
|
|
|
|
|
|
|
! Ground state density matrix
|
|
|
|
|
|
|
|
iEns = 1
|
|
|
|
|
|
|
|
Eaux(iEns) = 2d0*sum(eps(1:nO))
|
|
|
|
|
2020-04-26 23:17:27 +02:00
|
|
|
! Singly-excited state density matrix
|
2020-03-30 22:45:05 +02:00
|
|
|
|
|
|
|
iEns = 2
|
|
|
|
|
|
|
|
if(nO > 1) then
|
|
|
|
Eaux(iEns) = 2d0*sum(eps(1:nO-1))
|
|
|
|
else
|
|
|
|
Eaux(iEns) = 0d0
|
|
|
|
end if
|
2020-08-01 11:45:17 +02:00
|
|
|
Eaux(iEns) = Eaux(iEns) + sum(occnum(:,1,iEns))*eps(nO) + sum(occnum(:,2,iEns))*eps(nO+1)
|
2020-03-30 22:45:05 +02:00
|
|
|
|
2020-04-26 23:17:27 +02:00
|
|
|
|
|
|
|
! Doubly-excited state density matrix
|
|
|
|
|
|
|
|
iEns = 3
|
|
|
|
|
|
|
|
if(nO > 1) then
|
|
|
|
Eaux(iEns) = 2d0*sum(eps(1:nO-1))
|
|
|
|
else
|
|
|
|
Eaux(iEns) = 0d0
|
|
|
|
end if
|
2020-08-01 11:45:17 +02:00
|
|
|
Eaux(iEns) = Eaux(iEns) + sum(occnum(:,1,iEns))*eps(nO) + sum(occnum(:,2,iEns))*eps(nO+1)
|
2020-04-26 23:17:27 +02:00
|
|
|
|
2020-03-30 22:45:05 +02:00
|
|
|
|
|
|
|
end subroutine restricted_auxiliary_energy
|