calcRemainingSwitches_excitInfo_single Subroutine

public subroutine calcRemainingSwitches_excitInfo_single(csf_i, excitInfo, posSwitches, negSwitches)

Arguments

Type IntentOptional Attributes Name
type(CSF_Info_t), intent(in) :: csf_i
type(ExcitationInformation_t), intent(in) :: excitInfo
real(kind=dp), intent(out) :: posSwitches(nSpatOrbs)
real(kind=dp), intent(out) :: negSwitches(nSpatOrbs)

Contents


Source Code

    subroutine calcRemainingSwitches_excitInfo_single(csf_i, excitInfo, &
                                                      posSwitches, negSwitches)
        ! subroutine to determine the number of remaining switches for single
        ! excitations between orbitals s, p given in type of excitationInformation.
        ! The switches are given
        ! as a list, to access it for each spatial orbital
        ! stepValue = 1 -> positive delta B switch possibility
        ! stepValue = 2 -> negative delta B switch possibility
        ! assume exitInfo is already calculated
        type(CSF_Info_t), intent(in) :: csf_i
        type(ExcitationInformation_t), intent(in) :: excitInfo
        real(dp), intent(out) :: posSwitches(nSpatOrbs), negSwitches(nSpatOrbs)

        integer :: iOrb
        real(dp) :: oneCount, twoCount

        ! ignore b > 0 forced switches for now. As they only change the bias
        ! do not make the excitations calculations wrong if ignored.

        oneCount = 0.0_dp
        twoCount = 0.0_dp
        posSwitches = 0.0_dp
        negSwitches = 0.0_dp
        ! have to count from the reversed ilut entries
        do iOrb = excitInfo%fullEnd - 1, excitInfo%fullStart, -1
            posSwitches(iOrb) = twoCount
            negSwitches(iOrb) = oneCount

            select case (csf_i%stepvector(iOrb))
            case (1)
                oneCount = oneCount + 1.0_dp
            case (2)
                twoCount = twoCount + 1.0_dp
            end select
        end do

    end subroutine calcRemainingSwitches_excitInfo_single