mirror of
https://github.com/LCPQ/quantum_package
synced 2024-07-03 18:05:59 +02:00
Added 1/c0^2 weight in selection
This commit is contained in:
parent
764dced552
commit
e68bd1f98a
|
@ -366,6 +366,12 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
|
||||||
end if
|
end if
|
||||||
end do pullLoop
|
end do pullLoop
|
||||||
|
|
||||||
|
if (zmq_abort(zmq_to_qp_run_socket) == -1) then
|
||||||
|
call sleep(1)
|
||||||
|
if (zmq_abort(zmq_to_qp_run_socket) == -1) then
|
||||||
|
print *, irp_here, ': Error in sending abort signal (2)'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if(tooth == comb_teeth+1) then
|
if(tooth == comb_teeth+1) then
|
||||||
pt2(pt2_stoch_istate) = sum(pt2_detail(pt2_stoch_istate,:))
|
pt2(pt2_stoch_istate) = sum(pt2_detail(pt2_stoch_istate,:))
|
||||||
|
|
|
@ -40,11 +40,11 @@ doc: Force the wave function to be an eigenfunction of S^2
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: True
|
default: True
|
||||||
|
|
||||||
[use_l3_weight]
|
[used_weight]
|
||||||
type: logical
|
type: integer
|
||||||
doc: If true, set the state-averaged weight to 1/(Norm_L3(Psi))
|
doc: 0: 1/(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi))
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: False
|
default: 0
|
||||||
|
|
||||||
|
|
||||||
[threshold_generators]
|
[threshold_generators]
|
||||||
|
|
|
@ -365,7 +365,7 @@ end
|
||||||
BEGIN_PROVIDER [ double precision, l3_weight, (N_states) ]
|
BEGIN_PROVIDER [ double precision, l3_weight, (N_states) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Weight of the states in the selection : 1/(sum_i c_i^4)
|
! Weight of the states in the selection : 1/(sum_i |c_i|^3)
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: i,k
|
integer :: i,k
|
||||||
double precision :: c
|
double precision :: c
|
||||||
|
@ -388,6 +388,30 @@ BEGIN_PROVIDER [ double precision, l3_weight, (N_states) ]
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, c0_weight, (N_states) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Weight of the states in the selection : 1/c_0^2
|
||||||
|
END_DOC
|
||||||
|
integer :: i,k
|
||||||
|
double precision :: c
|
||||||
|
do i=1,N_states
|
||||||
|
c0_weight(i) = 1.d-31
|
||||||
|
c = maxval(psi_coef(:,i) * psi_coef(:,i))
|
||||||
|
c0_weight(i) = 1.d0/c
|
||||||
|
c0_weight(i) = min(c0_weight(i), 100.d0)
|
||||||
|
enddo
|
||||||
|
if (mpi_master) then
|
||||||
|
print *, ''
|
||||||
|
print *, 'c0 weights'
|
||||||
|
print *, '----------'
|
||||||
|
print *, ''
|
||||||
|
print *, c0_weight(1:N_states)
|
||||||
|
print *, ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ]
|
BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ]
|
||||||
implicit none
|
implicit none
|
||||||
|
@ -397,8 +421,12 @@ BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ]
|
||||||
logical :: exists
|
logical :: exists
|
||||||
|
|
||||||
state_average_weight(:) = 1.d0
|
state_average_weight(:) = 1.d0
|
||||||
if (use_l3_weight) then
|
if (used_weight == 0) then
|
||||||
state_average_weight(:) = l3_weight(:)
|
state_average_weight(:) = c0_weight(:)
|
||||||
|
else if (used_weight == 1) then
|
||||||
|
state_average_weight(:) = 1./N_states
|
||||||
|
else if (used_weight == 3) then
|
||||||
|
state_average_weight(:) = l3_weight
|
||||||
else
|
else
|
||||||
call ezfio_has_determinants_state_average_weight(exists)
|
call ezfio_has_determinants_state_average_weight(exists)
|
||||||
if (exists) then
|
if (exists) then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user