mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-21 19:13:29 +01:00
print_energy.irp.f
This commit is contained in:
parent
547fea1d58
commit
3cf55e2676
34
src/tools/print_energy.irp.f
Normal file
34
src/tools/print_energy.irp.f
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
program print_wf
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Prints the energy of the wave function stored in the |EZFIO| directory.
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
! this has to be done in order to be sure that N_det, psi_det and
|
||||||
|
! psi_coef_sorted are the wave function stored in the |EZFIO| directory.
|
||||||
|
read_wf = .True.
|
||||||
|
touch read_wf
|
||||||
|
call run
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine run
|
||||||
|
implicit none
|
||||||
|
integer :: i
|
||||||
|
double precision :: i_H_psi_array(N_states)
|
||||||
|
double precision :: E(N_states)
|
||||||
|
double precision :: norm(N_states)
|
||||||
|
|
||||||
|
E(:) = nuclear_repulsion
|
||||||
|
norm(:) = 0.d0
|
||||||
|
do i=1,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)
|
||||||
|
norm(:) += psi_coef(i,:)**2
|
||||||
|
E(:) += i_H_psi_array(:) * psi_coef(i,:)
|
||||||
|
enddo
|
||||||
|
|
||||||
|
print *, 'Energy:'
|
||||||
|
do i=1,N_states
|
||||||
|
print *, E(i)/norm(i)
|
||||||
|
enddo
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user