From 3c0d4046611f14724794b698f2fa947d5ef81d24 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 16 Jul 2018 18:48:42 +0200 Subject: [PATCH] Fixed BeH with pseudos --- src/SAMPLING/srmc_step.irp.f | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/SAMPLING/srmc_step.irp.f b/src/SAMPLING/srmc_step.irp.f index e32f076..02441fe 100644 --- a/src/SAMPLING/srmc_step.irp.f +++ b/src/SAMPLING/srmc_step.irp.f @@ -100,9 +100,7 @@ END_SHELL block_weight = 0.d0 real, external :: accep_rate - double precision :: delta, thr - - thr = 2.d0/time_step_sq + double precision :: delta logical :: first_loop first_loop = .True. @@ -160,6 +158,11 @@ END_SHELL srmc_weight(i_walk) = 2.d0-dexp(dtime_step*delta) endif + ! Trick to avoid holes in DMC PES. + if (dabs(delta/E_ref) * time_step_sq > p ) then + srmc_weight(i_walk) = 1.d-1 + endif + ! if (accepted) then ! ! Compute correction to past weights @@ -186,7 +189,7 @@ END_SHELL ! endif - if ( (psi_value * psi_value_save(i_walk) >= 0.d0).and.(srmc_weight(i_walk) > 1.d-4) ) then + if ( psi_value * psi_value_save(i_walk) >= 0.d0 ) then elec_coord(elec_num+1,1) += p*time_step elec_coord(elec_num+1,2) = E_loc elec_coord(elec_num+1,3) = srmc_weight(i_walk) * srmc_pop_weight_mult @@ -261,6 +264,13 @@ END_SHELL srmc_projection_step = 1 endif + if (srmc_pop_weight_mult > 1.d0/time_step_sq) then + srmc_pop_weight_mult = 1.d0 + endif + if (srmc_pop_weight_mult < time_step_sq) then + srmc_pop_weight_mult = 1.d0 + endif + ! Eventually, recompute the weight of the population if (srmc_projection_step == 1) then srmc_pop_weight_mult = 1.d0