9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Changed default weight_selection to 1

This commit is contained in:
Anthony Scemama 2020-09-03 16:16:16 +02:00
parent c07232aae3
commit fd7825ea74
3 changed files with 30 additions and 10 deletions

View File

@ -287,9 +287,9 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
call omp_set_nested(.false.)
print '(A)', '========== ================= =========== =============== =============== ================='
print '(A)', ' Samples Energy Stat. Err Variance Norm^2 Seconds '
print '(A)', '========== ================= =========== =============== =============== ================='
print '(A)', '========== ======================= ========= ========== ========== ========== ========== '
print '(A)', ' Samples Energy Variance Norm^2 Seconds'
print '(A)', '========== ======================= ==================== ===================== =========='
PROVIDE global_selection_buffer
@ -529,7 +529,14 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2_data, pt2_data_
if ((time - time1 > 1.d0) .or. (n==N_det_generators)) then
time1 = time
print '(G10.3, 2X, F16.10, 2X, G10.3, 2X, G14.6, 2X, G14.6, 2X, F10.4)', c, avg+E, eqt, avg2, avg3(pt2_stoch_istate), time-time0
print '(I10, X, F11.7, X, G10.3, X, G10.3, X, G10.3, X, G10.3, X, G10.3, X, F10.4)', c, &
pt2_data % pt2(pt2_stoch_istate) +E, &
pt2_data_err % pt2(pt2_stoch_istate), &
pt2_data % variance(pt2_stoch_istate), &
pt2_data_err % variance(pt2_stoch_istate), &
pt2_data % overlap(pt2_stoch_istate,pt2_stoch_istate), &
pt2_data_err % overlap(pt2_stoch_istate,pt2_stoch_istate), &
time-time0
if (stop_now .or. ( &
(do_exit .and. (dabs(pt2_data_err % pt2(pt2_stoch_istate)) / &
(1.d-20 + dabs(pt2_data % pt2(pt2_stoch_istate)) ) <= relative_error))) ) then

View File

@ -683,7 +683,12 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
double precision, allocatable :: values(:)
integer, allocatable :: keys(:,:)
integer :: nkeys
double precision :: s_weight(N_states,N_states)
do jstate=1,N_states
do istate=1,N_states
s_weight(istate,jstate) = dsqrt(selection_weight(istate)*selection_weight(jstate))
enddo
enddo
if(sp == 3) then
s1 = 1
@ -829,17 +834,25 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
case(5)
! Variance selection
w = w - alpha_h_psi * alpha_h_psi * selection_weight(istate)
w = w - alpha_h_psi * alpha_h_psi * s_weight(istate,istate)
do jstate=1,N_states
if (istate == jstate) cycle
w = w + alpha_h_psi*mat(jstate,p1,p2) * s_weight(istate,jstate)
enddo
case(6)
w = w - coef(istate) * coef(istate) * selection_weight(istate)
w = w - coef(istate) * coef(istate) * s_weight(istate,istate)
do jstate=1,N_states
if (istate == jstate) cycle
w = w + coef(istate)*coef(jstate) * s_weight(istate,jstate)
enddo
case default
! Energy selection
w = w + e_pert(istate) * selection_weight(istate)
w = w + e_pert(istate) * s_weight(istate,istate)
do jstate=1,N_states
if (istate == jstate) cycle
w = w - dabs(X(istate))*X(jstate) * sqrt(selection_weight(istate)*selection_weight(jstate))
w = w - dabs(X(istate))*X(jstate) * s_weight(istate,jstate)
enddo
end select

View File

@ -44,7 +44,7 @@ default: 2
type: integer
doc: Weight used in the selection. 0: input state-average weight, 1: 1./(c_0^2), 2: rPT2 matching, 3: variance matching, 4: variance and rPT2 matching, 5: variance minimization and matching, 6: CI coefficients 7: input state-average multiplied by variance and rPT2 matching 8: input state-average multiplied by rPT2 matching 9: input state-average multiplied by variance matching
interface: ezfio,provider,ocaml
default: 2
default: 1
[threshold_generators]
type: Threshold