encode_matrix_element_real Subroutine

private pure subroutine encode_matrix_element_real(ilut, mat_ele, mat_type)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(inout) :: ilut(0:GugaBits%len_tot)
real(kind=dp), intent(in) :: mat_ele
integer, intent(in) :: mat_type

Contents


Source Code

    pure subroutine encode_matrix_element_real(ilut, mat_ele, mat_type)
        ! encodes the x0 or x1 matrix element needed during the excitation
        ! creation.
        ! mat_ele   ... x0 or x1 matrix element
        ! mat_type  ... 1...x0, 2...x1
        integer(n_int), intent(inout) :: ilut(0:GugaBits%len_tot)
        real(dp), intent(in) :: mat_ele
        integer, intent(in) :: mat_type
        character(*), parameter :: this_routine = "encode_matrix_element_real"

        integer(n_int) :: mat_int ! integer version of real

        ASSERT(mat_type == 1 .or. mat_type == 2)
        ASSERT(sizeof(mat_ele) == sizeof(mat_int))

        mat_int = transfer(mat_ele, mat_int)

        ilut(GugaBits%len_orb + mat_type) = mat_int

    end subroutine encode_matrix_element_real