1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-06-02 11:25:23 +02:00

Updated variance for stopping

This commit is contained in:
Anthony Scemama 2019-05-27 17:54:29 +02:00
parent 39250742fd
commit 569faa4e23
2 changed files with 6 additions and 27 deletions

Binary file not shown.

View File

@ -94,9 +94,12 @@ program variance
call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det)
call print_extrapolated_energy()
N_iter += 1
if (qp_stop()) exit
if ( (maxval(abs(pt2(1:N_states))) <= pt2_max) .or. &
(maxval(abs(var(1:N_states))) <= variance_max) .or. &
qp_stop() ) then
exit
endif
! Add selected determinants
call copy_H_apply_buffer_to_wf()
call save_wavefunction
@ -112,28 +115,4 @@ program variance
if (qp_stop()) exit
enddo
if (.not.qp_stop()) then
if (N_det < N_det_max) then
call diagonalize_CI
call save_wavefunction
rpt2(:) = 0.d0
call save_energy(psi_energy_with_nucl_rep, rpt2)
endif
pt2 = 0.d0
var = 0.d0
norm = 0.d0
call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,var, &
norm,0) ! Stochastic PT2
call save_energy(psi_energy_with_nucl_rep, pt2)
do k=1,N_states
rpt2(:) = pt2(:)/(1.d0 + norm(k))
enddo
call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,var,norm,N_det,N_occ_pattern,N_states,psi_s2)
call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det)
call print_extrapolated_energy()
endif
end