function get_pgen_pick_hole_from_active_space(this, ilut, srcGASInd, spin_idx) result(pgenVal)
class(GAS_disc_ExcGenerator_t), intent(in) :: this
integer(n_int), intent(in) :: ilut(0:NIfD)
integer, intent(in) :: srcGASInd, spin_idx
real(dp) :: pgenVal
integer :: nEmpty
nEmpty = this%GAS_size(srcGASInd) &
- sum(popCnt(iand(ilut(0:NIfD), &
this%GAS_spin_orbs(0:NIfD, srcGASInd, spin_idx) &
) &
) &
)
! if the excitation is not possible, pgen is void
if (nEmpty == 0) then
pgenVal = 1.0_dp
else
! adjust pgen
pgenVal = 1.0_dp / real(nEmpty, dp)
end if
end function get_pgen_pick_hole_from_active_space