mirror of
https://gitlab.com/scemama/qp_plugins_scemama.git
synced 2024-11-07 14:43:41 +01:00
Updated variance for stopping
This commit is contained in:
parent
39250742fd
commit
569faa4e23
Binary file not shown.
@ -94,9 +94,12 @@ program variance
|
|||||||
call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det)
|
call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det)
|
||||||
call print_extrapolated_energy()
|
call print_extrapolated_energy()
|
||||||
N_iter += 1
|
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
|
! Add selected determinants
|
||||||
call copy_H_apply_buffer_to_wf()
|
call copy_H_apply_buffer_to_wf()
|
||||||
call save_wavefunction
|
call save_wavefunction
|
||||||
@ -112,28 +115,4 @@ program variance
|
|||||||
if (qp_stop()) exit
|
if (qp_stop()) exit
|
||||||
enddo
|
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
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user