10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 04:43:45 +01:00

Dynamic weights for better selection

This commit is contained in:
Anthony Scemama 2019-05-15 12:29:39 +02:00
parent 662d141cd3
commit 098643d22f
3 changed files with 26 additions and 1 deletions

View File

@ -333,6 +333,14 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
pt2(k) = 0.d0 pt2(k) = 0.d0
enddo 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 end subroutine

View File

@ -1,11 +1,20 @@
use bitmasks 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) ] BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Weights used in the selection criterion ! Weights used in the selection criterion
END_DOC 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 END_PROVIDER

View File

@ -131,6 +131,14 @@ subroutine ZMQ_selection(N_in, pt2, variance, norm)
norm(k) = norm(k) * f(k) norm(k) = norm(k) * f(k)
enddo 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 end subroutine