mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-08-25 05:31:48 +02:00
Dynamic weights for better selection
This commit is contained in:
parent
89843eaf0b
commit
122650e6d9
@ -333,6 +333,14 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
|
||||
pt2(k) = 0.d0
|
||||
enddo
|
||||
|
||||
! Adjust PT2 weights for next selection
|
||||
double precision :: pt2_avg
|
||||
pt2_avg = sum(pt2) / dble(N_states)
|
||||
do k=1,N_states
|
||||
pt2_match_weight(k) *= (pt2(k)/pt2_avg)**2
|
||||
enddo
|
||||
SOFT_TOUCH pt2_match_weight
|
||||
|
||||
end subroutine
|
||||
|
||||
|
||||
|
@ -1,11 +1,20 @@
|
||||
use bitmasks
|
||||
|
||||
BEGIN_PROVIDER [ double precision, pt2_match_weight, (N_states) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Weights adjusted along the selection to make the PT2 contributions
|
||||
! of each state coincide.
|
||||
END_DOC
|
||||
pt2_match_weight = 1.d0
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Weights used in the selection criterion
|
||||
END_DOC
|
||||
selection_weight(1:N_states) = c0_weight(1:N_states)
|
||||
selection_weight(1:N_states) = c0_weight(1:N_states) * pt2_match_weight(1:N_states)
|
||||
END_PROVIDER
|
||||
|
||||
|
||||
|
@ -131,6 +131,14 @@ subroutine ZMQ_selection(N_in, pt2, variance, norm)
|
||||
norm(k) = norm(k) * f(k)
|
||||
enddo
|
||||
|
||||
! Adjust PT2 weights for next selection
|
||||
double precision :: pt2_avg
|
||||
pt2_avg = sum(pt2) / dble(N_states)
|
||||
do k=1,N_states
|
||||
pt2_match_weight(k) *= (pt2(k)/pt2_avg)**2
|
||||
enddo
|
||||
SOFT_TOUCH pt2_match_weight
|
||||
|
||||
end subroutine
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user