ReturnAlphaOpenDet Subroutine

public subroutine ReturnAlphaOpenDet(nI, nJ, iLutnI, iLutSym, tCalciLutSym, tCalcnISym, tSwapped)

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: nI(NEl)
integer, intent(inout) :: nJ(NEl)
integer(kind=n_int), intent(inout) :: iLutnI(0:NIfTot)
integer(kind=n_int), intent(inout) :: iLutSym(0:NIfTot)
logical, intent(in) :: tCalciLutSym
logical, intent(in) :: tCalcnISym
logical, intent(out) :: tSwapped

Contents

Source Code


Source Code

    SUBROUTINE ReturnAlphaOpenDet(nI, nJ, iLutnI, iLutSym, tCalciLutSym, tCalcnISym, tSwapped)
        INTEGER(KIND=n_int), intent(inout) :: iLutSym(0:NIfTot), iLutnI(0:NIfTot)
        integer(kind=n_int) :: iLutTemp(0:NIfTot)
        INTEGER :: i, nTemp(NEl)
        integer, intent(inout) :: nJ(NEl), nI(NEl)
        LOGICAL, intent(in) :: tCalciLutSym, tCalcnISym
        logical, intent(out) :: tSwapped

        IF(tCalciLutSym) THEN
            CALL FindExcitBitDetSym(iLutnI, iLutSym)
        end if
        IF(tCalcnISym) THEN
            CALL FindDetSpinSym(nI, nJ, NEl)
        end if

        ! iLutnI is 'less' than iLutSym, so iLutSym is the determinant with
        ! the first open-shell = alpha. Swap them around.
        ! Only count up to NIfD to avoid Yamanouchi symbol etc.
        i = DetBitLT(iLutnI, iLutSym, NIfD)
        IF(i == 1) THEN
            iLutTemp(:) = iLutnI(:)
            iLutnI(:) = iLutSym(:)
            iLutSym(:) = iLutTemp(:)
!            CALL FindDetSpinSym(nI,nJ,NEl)
            nTemp(:) = nI(:)
            nI(:) = nJ(:)
            nJ(:) = nTemp(:)
            tSwapped = .true.
        else if(i == 0) THEN
            CALL Stop_All("ReturnAlphaOpenDet", "Shouldn't have closed shell determinants in here")
        ELSE
            tSwapped = .false.
        end if

    END SUBROUTINE ReturnAlphaOpenDet