diff --git a/src/SAMPLING/dmc_step.irp.f b/src/SAMPLING/dmc_step.irp.f index 769a91d..ca5f703 100644 --- a/src/SAMPLING/dmc_step.irp.f +++ b/src/SAMPLING/dmc_step.irp.f @@ -86,19 +86,29 @@ END_SHELL call system_clock(cpu0, count_rate, count_max) cpu2 = cpu0 do while (loop) + ! Move to the next projection step dmc_projection_step = mod(dmc_projection_step+1,dmc_projection)+1 + ! Remove contribution of the old value of the weight at the new + ! projection step pop_weight_mult *= 1.d0/pop_weight(dmc_projection_step) + + ! Compute the new weight of the population pop_weight(dmc_projection_step) = 0.d0 do k=1,walk_num pop_weight(dmc_projection_step) += dmc_weight(k) enddo + ! Normalize the weight of the walkers by the weight of the population do k=1,walk_num dmc_weight(k) = dmc_weight(k)/pop_weight(dmc_projection_step) enddo + ! Normalize the weight of the population at the current projection step by + ! the number of walkers pop_weight(dmc_projection_step) = pop_weight(dmc_projection_step)/dble(walk_num) + + ! Update the running population weight pop_weight_mult *= pop_weight(dmc_projection_step) BEGIN_SHELL [ /usr/bin/python ] diff --git a/src/SAMPLING/vmc_step.irp.f b/src/SAMPLING/vmc_step.irp.f index 0cac8d2..d22021b 100644 --- a/src/SAMPLING/vmc_step.irp.f +++ b/src/SAMPLING/vmc_step.irp.f @@ -178,6 +178,17 @@ END_SHELL enddo if (qmc_method == t_DMC) then +! if ( (trapped_walk(i_walk) < trapped_walk_max).and. & +! (psi_value * psi_value_save(i_walk) > 0.d0).and. & +! (dabs(E_ref-E_loc)*time_step_sq < -.2d0*E_ref) ) then + if ( (trapped_walk(i_walk) < trapped_walk_max).and. & + (psi_value * psi_value_save(i_walk) >= 0.d0) ) then + dmc_weight(i_walk) = dexp(dtime_step*(E_ref - E_loc)) + else + dmc_weight(i_walk) = 0.d0 + trapped_walk(i_walk) = 0 + endif + psi_value_save(i_walk) = psi_value !DIR$ VECTOR ALIGNED !DIR$ LOOP COUNT (200) @@ -187,22 +198,10 @@ END_SHELL psi_grad_psi_inv_save(i,3,i_walk) = psi_grad_psi_inv_z(i) enddo -! if ( (trapped_walk(i_walk) < trapped_walk_max).and. & -! (psi_value * psi_value_save(i_walk) > 0.d0).and. & -! (dabs(E_ref-E_loc)*time_step_sq < -.2d0*E_ref) ) then - if ( (trapped_walk(i_walk) < trapped_walk_max).and. & - (psi_value * psi_value_save(i_walk) > 0.d0) ) then - dmc_weight(i_walk) = exp(time_step*(E_ref - E_loc)) - - else - dmc_weight(i_walk) = 0.d0 - trapped_walk(i_walk) = 0 - endif endif enddo - double precision :: factor factor = 1.d0/block_weight SOFT_TOUCH block_weight