class_docstr: Measurement process that computes the probability of each computational basis state.
  
  Please refer to :func:`probs` for detailed documentation.
  
  Args:
      obs (Union[.Operator, .MeasurementValue]): The observable that is to be measured
          as part of the measurement process. Not all measurement processes require observables
          (for example ``Probability``); this argument is optional.
      wires (.Wires): The wires the measurement process applies to.
          This can only be specified if an observable was not provided.
      eigvals (array): A flat array representing the eigenvalues of the measurement.
          This can only be specified if an observable was not provided.
      id (str): custom label given to a measurement instance, can be useful for some applications
          where the instance has to be identified
class_docstr_tok: ["Measurement","process","that","computes","the","probability","of","each","computational","basis","state",".","Please","refer","to",":","func",":","`","probs","`","for","detailed","documentation",".","Args",":","obs","(","Union","[",".Operator",",",".MeasurementValue","]",")",":","The","observable","that","is","to","be","measured","as","part","of","the","measurement","process",".","Not","all","measurement","processes","require","observables","(","for","example","``","Probability","``",")",";","this","argument","is","optional",".","wires","(",".Wires",")",":","The","wires","the","measurement","process","applies","to",".","This","can","only","be","specified","if","an","observable","was","not","provided",".","eigvals","(","array",")",":","A","flat","array","representing","the","eigenvalues","of","the","measurement",".","This","can","only","be","specified","if","an","observable","was","not","provided",".","id","(","str",")",":","custom","label","given","to","a","measurement","instance",",","can","be","useful","for","some","applications","where","the","instance","has","to","be","identified"]
code: def process_samples(
      self,
      samples: Sequence[complex],
      wire_order: Wires,
      shot_range: Tuple[int] = None,
      bin_size: int = None,
  ):
      wire_map = dict(zip(wire_order, range(len(wire_order))))
      mapped_wires = [wire_map[w] for w in self.wires]
      if shot_range is not None:
          # Indexing corresponds to: (potential broadcasting, shots, wires). Note that the last
          # colon (:) is required because shots is the second-to-last axis and the
          # Ellipsis (...) otherwise would take up broadcasting and shots axes.
          samples = samples[..., slice(*shot_range), :]
  
      if mapped_wires:
          # if wires are provided, then we only return samples from those wires
          samples = samples[..., mapped_wires]
  
      num_wires = qml.math.shape(samples)[-1]
      # convert samples from a list of 0, 1 integers, to base 10 representation
      powers_of_two = 2 ** qml.math.arange(num_wires)[::-1]
      indices = samples @ powers_of_two
  
      # `samples` typically has two axes ((shots, wires)) but can also have three with
      # broadcasting ((batch_size, shots, wires)) so that we simply read out the batch_size.
      batch_size = (
          samples.shape[0] if qml.math.ndim(samples) == 3 else None
      )
      dim = 2**num_wires
      # count the basis state occurrences, and construct the probability vector
      new_bin_size = bin_size or samples.shape[-2]
      new_shape = (
          (-1, new_bin_size)
          if batch_size is None
          else (batch_size, -1, new_bin_size)
      )
      indices = indices.reshape(new_shape)
      prob = self._count_samples(indices, batch_size, dim)
      return qml.math.squeeze(prob) if bin_size is None else prob
  
file_path: pennylane/pennylane/measurements/probs.py
imports: from typing import Sequence, Tuple
  import numpy
  import pennylane
  from pennylane.wires import Wires
  from .measurements import Probability, SampleMeasurement, StateMeasurement
  from .mid_measure import MeasurementValue
label_desc: Use image node_id 4 for calling the ProbabilityMP obj's underlying member method code with example usage: obj.process_samples(samples, wire_order, shot_range, bin_size) and returns: unknown