get_bit_excitation Subroutine

public subroutine get_bit_excitation(iLutI, iLutJ, IC, exc, tParity)

Create canonical excitation from ilutI to ilutJ where the excitation level is already known.

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: iLutI(0:NIfTot)

Two Slater determinants in bitmask format.

integer(kind=n_int), intent(in) :: iLutJ(0:NIfTot)

Two Slater determinants in bitmask format.

integer, intent(in) :: IC

The excitation level. (1=Excite_1_t, 2=Excite_2_t, …)

class(Excitation_t), intent(out), allocatable :: exc

The parity of the excitation.

logical, intent(out) :: tParity

Contents

Source Code


Source Code

    subroutine get_bit_excitation(ilutI, ilutJ, IC, exc, tParity)
        !> Two Slater determinants in bitmask format.
        integer(kind=n_int), intent(in) :: iLutI(0:NIfTot), iLutJ(0:NIfTot)
        !>  The excitation level. (1=Excite_1_t, 2=Excite_2_t, ...)
        integer, intent(in) :: IC
        !>  The parity of the excitation.
        class(Excitation_t), allocatable, intent(out) :: exc
        logical, intent(out) :: tParity
        routine_name("get_bit_excitation")

        exc = create_excitation(ic)
        tParity = .false.

        ! The compiler has to statically know, what the type of exc is.
        select type (exc)
        type is (Excite_0_t)
            continue
        type is (Excite_1_t)
            exc%val(1, 1) = IC
            call GetBitExcitation(iLutI, iLutJ, exc%val, tParity)
            exc = canonicalize(exc)
        type is (Excite_2_t)
            exc%val(1, 1) = IC
            call GetBitExcitation(iLutI, iLutJ, exc%val, tParity)
            exc = canonicalize(exc)
        type is (Excite_3_t)
            exc%val(1, 1) = IC
            call GetBitExcitation(iLutI, iLutJ, exc%val, tParity)
            exc = canonicalize(exc)
        type is (Excite_Further_t)
            continue
        class default
            call stop_all(this_routine, "Excitation type invalid.")
        end select
    end subroutine get_bit_excitation