get_heisenberg_exchange Function

private function get_heisenberg_exchange(src, tgt) result(hel)


Type IntentOptional Attributes Name
integer, intent(in) :: src
integer, intent(in) :: tgt

Return Value real(kind=dp)


Source Code

    function get_heisenberg_exchange(src, tgt) result(hel)
        ! this is the wrapper function to get the heisenberg exchange
        ! contribution. which will substitute get_umat in the
        ! necessary places..
        ! NOTE: only in the debug mode the neighboring condition is tested
        ! also that that both orbitals src and tgt are occupied by opposite
        ! spins have to be checked before this function call!
        integer, intent(in) :: src, tgt
        HElement_t(dp) :: hel
#ifdef DEBUG_
        character(*), parameter :: this_routine = "get_heisenberg_exchange"

        ASSERT(src > 0)
        ASSERT(src <= nbasis)
        ASSERT(tgt > 0)
        ASSERT(tgt <= nbasis)

        ! i also want to get 0 matrix elements ofc.. so leave the possibility

        hel = h_cast(exchange_matrix(src, tgt))

    end function get_heisenberg_exchange