mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Dynamic weights for better selection
This commit is contained in:
parent
662d141cd3
commit
098643d22f
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user