pure subroutine calc_fullstart_fullstop_mixed_ex(ilutI, csf_i, ilutJ, csf_j, excitInfo, &
mat_ele, t_hamil, rdm_ind, rdm_mat)
integer(n_int), intent(in) :: ilutI(0:niftot), ilutJ(0:niftot)
type(CSF_Info_t), intent(in) :: csf_i, csf_j
type(ExcitationInformation_t), intent(in) :: excitInfo
HElement_t(dp), intent(out) :: mat_ele
logical, intent(in), optional :: t_hamil
integer(int_rdm), intent(out), allocatable, optional :: rdm_ind(:)
real(dp), intent(out), allocatable, optional :: rdm_mat(:)
integer(n_int) :: tmp_I(0:nifguga), tmp_J(0:nifguga)
logical :: t_hamil_
integer :: delta_b(nSpatOrbs)
def_default(t_hamil_, t_hamil, .true.)
! set default for early exits
mat_ele = h_cast(0.0_dp)
delta_b = csf_i%B_int - csf_j%B_int
associate (ii => excitInfo%i, jj => excitInfo%j, kk => excitInfo%k, &
ll => excitInfo%l, start => excitInfo%fullstart, &
ende => excitInfo%fullEnd)
if (any(abs(delta_b) > 2)) return
call convert_ilut_toGUGA(ilutI, tmp_I)
call convert_ilut_toGUGA(ilutJ, tmp_J)
if (t_hamil_ .or. (tFillingStochRDMOnFly .and. present(rdm_mat))) then
if (present(rdm_mat)) then
call calc_mixed_contr_integral(tmp_I, csf_i, tmp_J, start, ende, &
mat_ele, rdm_ind, rdm_mat)
else
call calc_mixed_contr_integral(tmp_I, csf_i, tmp_J, start, ende, &
mat_ele)
end if
end if
end associate
end subroutine calc_fullstart_fullstop_mixed_ex