4
1
mirror of https://github.com/pfloos/quack synced 2024-06-22 21:22:20 +02:00
quack/src/HF/density_matrix.f90

31 lines
547 B
Fortran
Raw Normal View History

2019-03-19 10:13:33 +01:00
subroutine density_matrix(nBas,ON,c,P)
! Compute density matrix based on the occupation numbers
implicit none
! Input variables
integer,intent(in) :: nBas
double precision,intent(in) :: ON(nBas),c(nBas,nBas)
! Local variables
integer :: mu,nu,i
! Output variables
double precision,intent(out) :: P(nBas,nBas)
P(:,:) = 0d0
2022-12-10 09:03:28 +01:00
do i=1,nBas
2019-03-19 10:13:33 +01:00
do nu=1,nBas
2022-12-10 09:03:28 +01:00
do mu=1,nBas
2019-03-19 10:13:33 +01:00
P(mu,nu) = P(mu,nu) + 2d0*ON(i)*c(mu,i)*c(nu,i)
enddo
enddo
enddo
end subroutine density_matrix