convert_ilut_toGUGA Subroutine

public pure subroutine convert_ilut_toGUGA(ilutN, ilutG, HElement, delta_b)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: ilutN(0:niftot)
integer(kind=n_int), intent(out) :: ilutG(0:GugaBits%len_tot)
real(kind=dp), intent(in), optional :: HElement
integer, intent(in), optional :: delta_b

Contents

Source Code


Source Code

    pure subroutine convert_ilut_toGUGA(ilutN, ilutG, HElement, delta_b)
        integer(n_int), intent(in) :: ilutN(0:niftot)
        integer(n_int), intent(out) :: ilutG(0:GugaBits%len_tot)
        HElement_t(dp), intent(in), optional :: HElement
        integer, intent(in), optional :: delta_b

        ilutG = 0_n_int

        ! need only the det part essentially..
        ilutG(0:GugaBits%len_orb) = ilutN(0:GugaBits%len_orb)

        if (present(HElement)) then
            call encode_matrix_element(ilutG, 0.0_dp, 2)
            call encode_matrix_element(ilutG, HElement, 1)
        else
            ! and set matrix elements to 1 and delta b to 0
            call encode_matrix_element(ilutG, 1.0_dp, 1)
            call encode_matrix_element(ilutG, 0.0_dp, 2)
        end if

        if (present(delta_b)) then
            call setDeltaB(delta_b, ilutG)
        else
            call setDeltaB(0, ilutG)
        end if

    end subroutine convert_ilut_toGUGA