function count_holes_in_currentDets() result(holes)
integer :: holes
integer(n_int), pointer :: ilut_parent(:)
integer :: nI_parent(nel), unused_flags, idet
real(dp) :: parent_sign(lenof_sign)
holes = 0
do idet = 1, int(TotWalkers)
ilut_parent => CurrentDets(:, idet)
call extract_bit_rep(ilut_parent, nI_parent, parent_sign, unused_flags, idet, &
fcimc_excit_gen_store)
if (IsUnoccDet(parent_sign)) then
holes = holes + 1
end if
end do
end function count_holes_in_currentDets