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

provider for off-diagonal selection weights

This commit is contained in:
Kevin Gasperich 2020-09-14 13:02:57 -05:00
parent 43c7696001
commit ed8b20ba0c

View File

@ -144,6 +144,18 @@ BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, selection_weight_mat, (N_states,N_states) ]
implicit none
BEGIN_DOC
! Weights used in the selection criterion
END_DOC
integer :: istate,jstate
do jstate=1,N_states
do istate=1,N_states
selection_weight_mat(istate,jstate) = dsqrt(selection_weight(istate)*selection_weight(jstate))
enddo
enddo
END_PROVIDER
subroutine get_mask_phase(det1, pm, Nint) subroutine get_mask_phase(det1, pm, Nint)
use bitmasks use bitmasks
@ -2111,12 +2123,12 @@ subroutine fill_buffer_double_complex(i_generator, sp, h1, h2, bannedOrb, banned
! double precision, allocatable :: values(:) ! double precision, allocatable :: values(:)
! integer, allocatable :: keys(:,:) ! integer, allocatable :: keys(:,:)
! integer :: nkeys ! integer :: nkeys
double precision :: s_weight(n_states,n_states) !double precision :: s_weight(n_states,n_states)
do jstate=1,n_states !do jstate=1,n_states
do istate=1,n_states ! do istate=1,n_states
s_weight(istate,jstate) = dsqrt(selection_weight(istate)*selection_weight(jstate)) ! s_weight(istate,jstate) = dsqrt(selection_weight(istate)*selection_weight(jstate))
enddo ! enddo
enddo !enddo
if(sp == 3) then if(sp == 3) then
s1 = 1 s1 = 1
@ -2254,26 +2266,26 @@ subroutine fill_buffer_double_complex(i_generator, sp, h1, h2, bannedOrb, banned
!TODO: check off-diagonals !TODO: check off-diagonals
case(5) case(5)
! Variance selection ! Variance selection
w = w - cdabs(alpha_h_psi * alpha_h_psi) * s_weight(istate,istate) w = w - cdabs(alpha_h_psi * alpha_h_psi) * selection_weight_mat(istate,istate)
do jstate=1,n_states do jstate=1,n_states
if (istate == jstate) cycle if (istate == jstate) cycle
w = w + cdabs(alpha_h_psi * mat(jstate,p1,p2)) * s_weight(istate,jstate) w = w + cdabs(alpha_h_psi * mat(jstate,p1,p2)) * selection_weight_mat(istate,jstate)
enddo enddo
case(6) case(6)
w = w - cdabs(coef(istate) * coef(istate)) * s_weight(istate,istate) w = w - cdabs(coef(istate) * coef(istate)) * selection_weight_mat(istate,istate)
do jstate=1,n_states do jstate=1,n_states
if (istate == jstate) cycle if (istate == jstate) cycle
w = w + cdabs(coef(istate)*coef(jstate)) * s_weight(istate,jstate) w = w + cdabs(coef(istate)*coef(jstate)) * selection_weight_mat(istate,jstate)
enddo enddo
case default case default
! Energy selection ! Energy selection
w = w + e_pert(istate) * s_weight(istate,istate) w = w + e_pert(istate) * selection_weight_mat(istate,istate)
do jstate=1,n_states do jstate=1,n_states
if (istate == jstate) cycle if (istate == jstate) cycle
!TODO: why dabs? !TODO: why dabs?
w = w - dabs(x(istate))*x(jstate) * s_weight(istate,jstate) w = w - dabs(x(istate))*x(jstate) * selection_weight_mat(istate,jstate)
enddo enddo
end select end select