encode_excit_info_indices_vec Subroutine

private subroutine encode_excit_info_indices_vec(excit_info_int, inds)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: excit_info_int
integer, intent(in) :: inds(4)

Contents


Source Code

    subroutine encode_excit_info_indices_vec(excit_info_int, inds)
        debug_function_name("encode_excit_info_indices_vec")
        integer(int64), intent(inout) :: excit_info_int
        integer, intent(in) :: inds(4)

        integer :: i

        ! i already used 5 bits for the excit-type: so 64-5 = 59 remaining
        ! 59/4 = 14.. so theoretically 14 bits remaining for each SPATIAL
        ! orbital.. 2^14 > 16k orbitals... not necessary.. maybe store more
        ! info. for now i use 8 bits: 256 SPATIAL orbital max.. that
        ! should be enough..
        ASSERT(all(inds > 0) .and. all(inds <= nSpatOrbs))
        ASSERT(nSpatOrbs <= 256)

        do i = 1, 4
            call mvbits(int(inds(i), int64), 0, n_excit_index_bits, &
                excit_info_int, n_excit_type_bits + (i - 1) * n_excit_index_bits)
        end do

    end subroutine encode_excit_info_indices_vec