is_var_state Function

public function is_var_state(ilut, nI) result(var_state)

Arguments

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

Return Value logical


Contents

Source Code


Source Code

    function is_var_state(ilut, nI) result(var_state)

        use FciMCData, only: var_space, var_space_size_int
        use hash, only: FindWalkerHash

        integer(n_int), intent(in) :: ilut(0:NIfTot)
        integer, intent(in) :: nI(:)
        integer(int64) :: hash_val
        integer(int64) :: pos
        logical :: var_state

        hash_val = FindWalkerHash(nI, var_space_size_int)

        call var_ht%callback_lookup(hash_val, pos, var_state, loc_verify)
    contains

        function loc_verify(ind) result(match)
            integer(int64), intent(in) :: ind
            logical :: match

            match = all(ilut(0:nifd) == var_space(0:nifd, ind))

        end function loc_verify
    end function is_var_state