function calc_off_diag_guga_ref_direct(ilut, csf_i, run, exlevel) result(hel)
integer(n_int), intent(in) :: ilut(0:niftot)
type(CSF_Info_t), intent(in) :: csf_i
integer, intent(in), optional :: run
integer, intent(out), optional :: exlevel
HElement_t(dp) :: hel
integer :: run_
type(ExcitationInformation_t) :: excitInfo
def_default(run_, run, 1)
call calc_guga_matrix_element(ilut, csf_i, ilutRef(0:niftot, run_), csf_ref(run_), excitInfo, hel, .true.)
if (present(exlevel)) then
if (excitInfo%valid) then
exlevel = merge(1, 2, excitInfo%typ == excit_type%single)
else
! non-valid > 3 excit
exlevel = nel
end if
end if
end function calc_off_diag_guga_ref_direct