9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-25 04:53:32 +01:00

Merge branch 'dev' into features_spack

This commit is contained in:
Anthony Scemama 2020-02-27 10:19:40 +01:00
commit a712441069
5 changed files with 148 additions and 92 deletions

2
configure vendored
View File

@ -314,7 +314,6 @@ printf "\e[m\n"
if [[ -f ${QP_ROOT}/build.ninja ]] ; then
[[ -z ${TRAVIS} ]] && echo "You can now run ${QP_ROOT}/bin/qpsh to enter in the QP shell mode :)"
else
echo ""
echo "${QP_ROOT}/build.ninja does not exist,"
echo "you need to specify the COMPILATION configuration file."
@ -324,4 +323,3 @@ fi
exit 0

View File

@ -11,7 +11,6 @@ declarations
decls_main
deinit_thread
init_main
filter_integrals
filter2p
filter2h2p_double
filter2h2p_single
@ -106,12 +105,6 @@ class H_apply(object):
s["do_double_excitations"] = d[do_double_exc]
s["keys_work"] += "call fill_H_apply_buffer_no_selection(key_idx,keys_out,N_int,iproc)"
s["filter_integrals"] = "array_pairs = .True."
if SingleRef:
s["filter_integrals"] = """
call get_mo_bielec_integrals_existing_ik(i_a,j_a,mo_num,array_pairs,mo_integrals_map)
"""
s["generate_psi_guess"] = """
! Sort H_jj to find the N_states lowest states
integer :: i

View File

@ -783,6 +783,8 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
norm(istate) = norm(istate) + coef * coef
!!!DEBUG
! pt2(istate) = pt2(istate) - e_pert + alpha_h_psi**2/delta_E
!
! integer :: k
! double precision :: alpha_h_psi_2,hij
! alpha_h_psi_2 = 0.d0

View File

@ -0,0 +1,34 @@
program print_energy
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

View File

@ -0,0 +1,29 @@
program print_hamiltonian
implicit none
BEGIN_DOC
! Prints the Hamiltonian matrix defined in the space of determinants
! present 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, j
double precision :: hij
do j=1,N_det
do i=1,N_det
call i_H_j(psi_det(1,1,i), psi_det(1,1,j), N_int, hij)
if (dabs(hij) > 1.d-20) then
print *, i, j, hij
endif
enddo
enddo
end