mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-21 11:03:29 +01:00
Fixed print_energy
This commit is contained in:
parent
ebf49ce789
commit
25663a89cd
@ -8,23 +8,26 @@ program print_energy
|
|||||||
! psi_coef_sorted are the wave function stored in the |EZFIO| directory.
|
! psi_coef_sorted are the wave function stored in the |EZFIO| directory.
|
||||||
read_wf = .True.
|
read_wf = .True.
|
||||||
touch read_wf
|
touch read_wf
|
||||||
|
PROVIDE N_states
|
||||||
call run
|
call run
|
||||||
end
|
end
|
||||||
|
|
||||||
subroutine run
|
subroutine run
|
||||||
implicit none
|
implicit none
|
||||||
integer :: i
|
integer :: i,j
|
||||||
double precision :: i_H_psi_array(N_states)
|
double precision :: i_H_psi_array(N_states)
|
||||||
double precision :: E(N_states)
|
double precision :: E(N_states)
|
||||||
double precision :: norm(N_states)
|
double precision :: norm(N_states)
|
||||||
|
|
||||||
E(:) = nuclear_repulsion
|
E(1:N_states) = nuclear_repulsion
|
||||||
norm(:) = 0.d0
|
norm(1:N_states) = 0.d0
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
call i_H_psi(psi_det(1,1,i), psi_det, psi_coef, N_int, N_det, &
|
call i_H_psi(psi_det(1,1,i), psi_det, psi_coef, N_int, N_det, &
|
||||||
size(psi_coef,1), N_states, i_H_psi_array)
|
size(psi_coef,1), N_states, i_H_psi_array)
|
||||||
norm(:) += psi_coef(i,:)**2
|
do j=1,N_states
|
||||||
E(:) += i_H_psi_array(:) * psi_coef(i,:)
|
norm(j) += psi_coef(i,j)*psi_coef(i,j)
|
||||||
|
E(j) += i_H_psi_array(j) * psi_coef(i,j)
|
||||||
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
print *, 'Energy:'
|
print *, 'Energy:'
|
||||||
|
Loading…
Reference in New Issue
Block a user