sltcnd_3_tc Function

private function sltcnd_3_tc(nI, ex, tSign, assert_occupation) result(hel)

Arguments

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

Return Value real(kind=dp)


Contents

Source Code


Source Code

    function sltcnd_3_tc(nI, ex, tSign, assert_occupation) result(hel)
        integer, intent(in) :: nI(nel)
        type(Excite_3_t), intent(in) :: ex
        logical, intent(in) :: tSign
        logical, intent(in), optional :: assert_occupation
        HElement_t(dp) :: hel
        debug_function_name("sltcnd_3_tc")
        integer :: dummy(1)
#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, ex)) then
                write(stderr, *) 'src', ex%val(1, :)
                write(stderr, *) 'tgt', ex%val(2, :)
                write(stderr, *) 'nI', nI
                call stop_all(this_routine, "Not allowed by occupation.")
            end if
        end if
    end block
#endif

        ! this is directly the fully symmetrized entry of the L-matrix
        if(t_use_tchint_lib) then
            hel = external_lMat_matel(dummy, ex%val)
        else
            associate(ex => ex%val)
                hel = get_lmat_el(ex(1, 1), ex(1, 2), ex(1, 3), &
                                  ex(2, 1), ex(2, 2), ex(2, 3))
            end associate
        endif
        ! take fermi sign into account
        if (tSign) hel = -hel
    end function sltcnd_3_tc