subroutine extract_trial_ht_entry(hash_val, i, ht_entry, source_ht)
implicit none
integer(n_int), intent(out) :: ht_entry(0:NConEntry)
integer, intent(in) :: hash_val, i
type(trial_hashtable), intent(inout) :: source_ht(:)
integer :: clashes
character(*), parameter :: this_routine = "extract_trial_ht_entry"
! get the stores state
ht_entry = source_ht(hash_val)%states(:, i)
! then remove it from the table
clashes = source_ht(hash_val)%nclash
call remove_trial_ht_entry(hash_val, i, clashes, source_ht)
end subroutine extract_trial_ht_entry