# sltcnd_1_tc_ua Function

## private function sltcnd_1_tc_ua(nI, exc, tSign, assert_occupation) result(hel)

### Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: exc
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation

## Source Code

    function sltcnd_1_tc_ua(nI, exc, tSign, assert_occupation) result(hel)
integer, intent(in) :: nI(nel)
type(Excite_1_t), intent(in) :: exc
logical, intent(in) :: tSign
logical, intent(in), optional :: assert_occupation
HElement_t(dp) :: hel
routine_name("sltcnd_1_tc_ua")
integer :: i, j
#ifdef DEBUG_
block
use constants, only: stderr
use util_mod, only: stop_all
logical :: test_occupation

if (present(assert_occupation)) then
test_occupation = assert_occupation
else
test_occupation = .true.
end if

if (test_occupation) then
if (.not. occupation_allowed(nI, exc)) then
write(stderr, *) 'src', exc%val(1, :)
write(stderr, *) 'tgt', exc%val(2, :)
write(stderr, *) 'nI', nI
call stop_all(this_routine, "Not allowed by occupation.")
end if
end if
end block
#endif

hel = sltcnd_1_kernel_ua(nI, exc)

! then add the 3-body correction
do i = 1, nel - 1
do j = i + 1, nel
if (exc%val(1, 1) /= nI(i) .and. exc%val(1, 1) /= nI(j)) then
hel = hel + get_lmat_el_ua(exc%val(1, 1), nI(i), nI(j), exc%val(2, 1), nI(i), nI(j))
end if
end do
end do