SetSpinOrbs Subroutine

public subroutine SetSpinOrbs(session)

Arguments

Type IntentOptional Attributes Name
type(ExcitGenSessionType), intent(inout) :: session

Contents

Source Code


Source Code

    subroutine SetSpinOrbs(session)
        implicit none
        type(ExcitGenSessionType), intent(inout) :: session
        integer :: i, elecBetaOrbCount, holeBetaOrbCount
        ! initialise totals
        elecBetaOrbCount = 0
        session%elecTotMl = 0
        session%elecSymLabel = 1

        holeBetaOrbCount = 0
        session%holeTotMl = 0
        session%holeSymLabel = 1

        do i = 1, session%rank
            ! fill selected spin orbs from parent determinant
            session%elecSpinOrbs(i) = session%nI(session%elecIndices(i))
            session%holeSpinOrbs(i) = session%holes(session%holeIndices(i))
            ! set total spin value
            if (is_beta(session%elecSpinOrbs(i))) then
                ! odd => beta
                elecBetaOrbCount = elecBetaOrbCount + 1
            end if
            if (is_beta(session%holeSpinOrbs(i))) then
                ! odd => beta
                holeBetaOrbCount = holeBetaOrbCount + 1
            end if
            session%spinDiff = abs(elecBetaOrbCount - holeBetaOrbCount)
            ! set total ml value
            session%elecTotMl = session%elecTotMl + G1(session%elecSpinOrbs(i))%Ml
            session%holeTotMl = session%holeTotMl + G1(session%holeSpinOrbs(i))%Ml
            ! accumulate total point group symmetry label
            session%elecSymLabel = RandExcitSymLabelProd( &
                                   session%elecSymLabel, SpinOrbSymLabel(session%elecSpinOrbs(i)))
            session%holeSymLabel = RandExcitSymLabelProd( &
                                   session%holeSymLabel, SpinOrbSymLabel(session%holeSpinOrbs(i)))
        end do

    end subroutine SetSpinOrbs