subroutine refresh_semistochastic_space()
logical :: tStartedFromCoreGround
! The reinitialization of the semistochastic space can affect population
! because of stochastic rounds. To log this correctly, set the iter_data to 0 here
iter_data_fciqmc%nborn = 0.0_dp
iter_data_fciqmc%nremoved = 0.0_dp
tStaticCore = .false.
! as the important determinants might change over time, this
! resets the semistochastic space taking the current population to get a new one
call end_semistoch()
! the flag_deterministic flag has to be cleared from all determinants as it is
! assumed that no states have that flag when init_semi_stochastic starts
call reset_core_space()
! Now, generate the new deterministic space
call init_semi_stochastic(ss_space_in, tStartedFromCoreGround)
! Changing the semi-stochastic space can involve some roundings
! if determinants with population < realSpawnCutoff stop being
! in the corespace. Then, we need to log these events.
iter_data_fciqmc%update_growth = iter_data_fciqmc%update_growth + iter_data_fciqmc%nborn &
- iter_data_fciqmc%nremoved
end subroutine refresh_semistochastic_space