GAS_singles_uniform_possible_holes Function

private function GAS_singles_uniform_possible_holes(this, nI, ilutI, src, use_lookup, store) result(unoccupied)

@brief For a determinant nI and a spin orbital src return the GAS allowed orbitals with the same spin as src which are not occupied in nI.

Type Bound

GAS_singles_PC_uniform_ExcGenerator_t

Arguments

Type IntentOptional Attributes Name
class(GAS_singles_PC_uniform_ExcGenerator_t), intent(in) :: this
integer, intent(in) :: nI(nel)
integer(kind=n_int), intent(in) :: ilutI(0:nIfD)
integer, intent(in) :: src
logical, intent(in) :: use_lookup
type(excit_gen_store_type), intent(in), optional :: store

Return Value integer, allocatable, (:)


Contents


Source Code

    function GAS_singles_uniform_possible_holes(this, nI, ilutI, src, use_lookup, store) result(unoccupied)
        class(GAS_singles_PC_uniform_ExcGenerator_t), intent(in) :: this
        integer, intent(in) :: nI(nel), src
        integer(n_int), intent(in) :: ilutI(0 : nIfD)
        logical, intent(in) :: use_lookup
        type(excit_gen_store_type), optional, intent(in) :: store
        integer, allocatable :: unoccupied(:)
        integer(n_int) :: ilut_unoccupied(0 : nIfD)
        integer :: i_sg
        character(*), parameter :: this_routine = 'GAS_PC_possible_holes'

#ifdef DEBUG_
    block
        use util_mod, only: stop_all
        use constants, only: stderr
        if (.not. (use_lookup .implies. present(store))) then
            write(stderr, *) ""
            write(stderr, *) "Assertion use_lookup .implies. present(store)"
            write(stderr, *) "failed in /scratch/jenkins/jobs/existing_branch_doc/workspace/build_config/gfortran-doc/src/gasci_sin&
                &gles_main.fpp:266"
            call stop_all (this_routine, "Assert fail: use_lookup .implies. present(store)")
        end if
    end block
#endif
        if (use_lookup) then
            i_sg = this%indexer%lookup_supergroup_idx(store%idx_curr_dets, nI)
        else
            i_sg = this%indexer%idx_nI(nI)
        end if

        ilut_unoccupied = iand(this%allowed_holes(:, src, i_sg), not(ilutI))
        allocate(unoccupied(sum(popcnt(ilut_unoccupied))))
        call decode_bit_det(unoccupied, ilut_unoccupied)
    end function GAS_singles_uniform_possible_holes