gen_rand_excit_pcpp Subroutine

public subroutine gen_rand_excit_pcpp(nI, iLut, nJ, ilutnJ, exFlag, IC, ExcitMat, tParity, pGen, HElGen, store, part_type)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nel)
integer(kind=n_int), intent(in) :: iLut(0:niftot)
integer, intent(out) :: nJ(nel)
integer(kind=n_int), intent(out) :: ilutnJ(0:niftot)
integer, intent(in) :: exFlag
integer, intent(out) :: IC
integer, intent(out) :: ExcitMat(2,maxExcit)
logical, intent(out) :: tParity
real(kind=dp), intent(out) :: pGen
real(kind=dp), intent(out) :: HElGen
type(excit_gen_store_type), intent(inout), target :: store
integer, intent(in), optional :: part_type

Contents

Source Code


Source Code

    subroutine gen_rand_excit_pcpp(nI, ilut, nJ, ilutnJ, exFlag, ic, ExcitMat, tParity, pGen, &
                                   HElGen, store, part_type)
        implicit none
        ! The interface is common to all excitation generators, see proc_ptrs.F90
        integer, intent(in) :: nI(nel), exFlag
        integer(n_int), intent(in) :: iLut(0:niftot)
        integer, intent(out) :: nJ(nel), IC, ExcitMat(2, maxExcit)
        logical, intent(out) :: tParity
        real(dp), intent(out) :: pGen
        type(excit_gen_store_type), intent(inout), target :: store

        ! Not used
        integer(n_int), intent(out) :: ilutnJ(0:niftot)
        HElement_t(dp), intent(out) :: HElGen

        integer, intent(in), optional :: part_type

        real(dp) :: r
        integer :: elec_map(nel)

        unused_var(exFlag); unused_var(part_type)

        HElgen = 0.0

        ! create the map for the electrons
        if (.not. store%tFilled) then
            store%elec_map = create_elec_map(ilut)
            store%tFilled = .true.
        end if
        elec_map = store%elec_map
        ! decide whether to generate a single or double excitation
        r = genrand_real2_dSFMT()
        if (r < pDoubles) then
            call generate_double_pcpp(nI, elec_map, ilut, nJ, excitMat, tParity, pGen)
            IC = 2
            pGen = pGen * pDoubles
        else
            call generate_single_pcpp(nI, elec_map, ilut, nJ, excitMat, tParity, pGen)
            IC = 1
            pGen = pGen * pSingles
        end if

        ! assign ilutnJ
        if (nJ(1) == 0) then
            ilutnJ = 0_n_int
        else
            call EncodeBitDet(nJ, ilutnJ)
        end if

    end subroutine gen_rand_excit_pcpp