calc_orb_pgen_uniform_singles Function

public function calc_orb_pgen_uniform_singles(csf_i, excitInfo) result(pgen)

Arguments

Type IntentOptional Attributes Name
type(CSF_Info_t), intent(in) :: csf_i
type(ExcitationInformation_t), intent(in) :: excitInfo

Return Value real(kind=dp)


Contents


Source Code

    function calc_orb_pgen_uniform_singles(csf_i, excitInfo) result(pgen)
        debug_function_name("calc_orb_pgen_uniform_singles")
        type(CSF_Info_t), intent(in) :: csf_i
        type(ExcitationInformation_t), intent(in) :: excitInfo
        real(dp) :: pgen

        integer :: nOrb, so_elec, cc_i, nOcc, sym_index, nUnocc

        ASSERT(1 <= excitInfo%i .and. excitInfo%i <= nSpatOrbs)
        ASSERT(1 <= excitInfo%j .and. excitInfo%j <= nSpatOrbs)

        if (excitInfo%i == excitInfo%j &
                .or. csf_i%stepvector(excitInfo%i) == 3 &
                .or. csf_i%stepvector(excitInfo%j) == 0) then
            pgen = 0.0_dp
        else
            nOcc = count(csf_i%Occ_int /= 0)
            so_elec = 2 * excitInfo%j

            cc_i = ClassCountInd(1, SpinOrbSymLabel(so_elec), G1(so_elec)%ml)
            nOrb = OrbClassCount(cc_i)
            ! get the symmetry index for later use
            sym_index = SymLabelCounts2(1, cc_i)

            associate(sym_allowed_orbs => sym_label_list_spat(sym_index : sym_index + nOrb - 1))
                nUnocc = count(csf_i%stepvector(sym_allowed_orbs) /= 3 &
                               .and. sym_allowed_orbs /= excitInfo%j)
            end associate

            pgen = 1.0_dp / real(nOcc * nUnocc, dp)
        end if
    end function calc_orb_pgen_uniform_singles