mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-01-03 09:05:39 +01:00
complex print_energy
This commit is contained in:
parent
6a4659bc10
commit
10bcd38c45
@ -8,7 +8,11 @@ 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
|
||||||
|
if (is_complex) then
|
||||||
|
call run_complex
|
||||||
|
else
|
||||||
call run
|
call run
|
||||||
|
endif
|
||||||
end
|
end
|
||||||
|
|
||||||
subroutine run
|
subroutine run
|
||||||
@ -32,3 +36,25 @@ subroutine run
|
|||||||
print *, E(i)/norm(i)
|
print *, E(i)/norm(i)
|
||||||
enddo
|
enddo
|
||||||
end
|
end
|
||||||
|
|
||||||
|
subroutine run_complex
|
||||||
|
implicit none
|
||||||
|
integer :: i
|
||||||
|
complex*16 :: 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_complex(psi_det(1,1,i), psi_det, psi_coef_complex, N_int, N_det, &
|
||||||
|
size(psi_coef_complex,1), N_states, i_H_psi_array)
|
||||||
|
norm(:) += cdabs(psi_coef_complex(i,:))**2
|
||||||
|
E(:) += dble(i_h_psi_array(:) * dconjg(psi_coef_complex(i,:)))
|
||||||
|
enddo
|
||||||
|
|
||||||
|
print *, 'Energy:'
|
||||||
|
do i=1,N_states
|
||||||
|
print *, E(i)/norm(i)
|
||||||
|
enddo
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user