get_3body_sign Function

private function get_3body_sign(ex)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ex(2,3)

Return Value logical


Contents

Source Code


Source Code

    logical function get_3body_sign(ex)
        ! i need to find some sign convention on the 3-body term, depending
        ! on the spin of the involved orbitals
        integer, intent(in) :: ex(2, 3)

        integer :: src(3), tgt(3), i, elec_pos, orb_pos

        ! we also have to define an order of the parallel spins..
        ! or is this ensured? i guess it should..
        src = get_src(ex)
        tgt = get_tgt(ex)

        if (sum(get_spin_pn(src)) == -1) then
            ! then alpha is the opposite spin
            do i = 1, 3
                if (is_alpha(src(i))) elec_pos = i
                if (is_alpha(tgt(i))) orb_pos = i
            end do

        else
            ! otherwise beta is minority
            do i = 1, 3
                if (is_beta(src(i))) elec_pos = i
                if (is_beta(tgt(i))) orb_pos = i
            end do

        end if

        if (elec_pos == orb_pos .or. abs(elec_pos - orb_pos) == 2) then
            get_3body_sign = .false.
        else
            get_3body_sign = .true.
        end if

    end function get_3body_sign