gen_all_excits Subroutine

private subroutine gen_all_excits(this, nI, n_excits, det_list, ic)

Get all excitated determinants from det_I that are allowed under GAS constraints.

Type Bound

GASSpec_t

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: this

GAS specification

integer, intent(in) :: nI(:)

Starting determinant

integer, intent(out) :: n_excits

Number of determinants

integer(kind=n_int), intent(out), allocatable :: det_list(:,:)

Allocatable array of determinants in ilut format

integer, intent(in), optional :: ic

Optional input for excitation level (ic=1 => singles, ic=2 => doubles) If ommited generate all.


Source Code

    subroutine gen_all_excits(this, nI, n_excits, det_list, ic)
    !!  Get all excitated determinants from
    !!  det_I that are allowed under GAS constraints.
        class(GASSpec_t), intent(in) :: this
            !!  GAS specification
        integer, intent(in) :: nI(:)
            !!  Starting determinant
        integer, intent(out) :: n_excits
            !!  Number of determinants
        integer(n_int), intent(out), allocatable :: det_list(:,:)
            !!  Allocatable array of determinants in ilut format
        integer, intent(in), optional :: ic
            !!  Optional input for excitation level (ic=1 => singles, ic=2 => doubles)
            !!      If ommited generate all.

        integer, allocatable :: singles(:, :), doubles(:, :)
        integer :: i, j

        if (present(ic)) then
            select case(ic)
            case(1)
                singles = this%get_available_singles(nI)
                allocate(doubles(0, 0))
            case(2)
                allocate(singles(0, 0))
                doubles = this%get_available_doubles(nI)
            end select
        else
            singles = this%get_available_singles(nI)
            doubles = this%get_available_doubles(nI)
        end if

        n_excits = size(singles, 2) + size(doubles, 2)
        allocate(det_list(0:niftot, n_excits))
        j = 1
        do i = 1, size(singles, 2)
            call EncodeBitDet(singles(:, i), det_list(:, j))
            j = j + 1
        end do

        do i = 1, size(doubles, 2)
            call EncodeBitDet(doubles(:, i), det_list(:, j))
            j = j + 1
        end do

        call sort(det_list, ilut_lt, ilut_gt)
    end subroutine gen_all_excits