cirq.google.unpack_results

cirq.google.unpack_results(data: bytes, repetitions: int, key_sizes: Sequence[Tuple[str, int]]) → Dict[str, numpy.ndarray][source]

Unpack data from a bitstring into individual measurement results.

Parameters:
  • data – Packed measurement results, in the form <rep0><rep1>… where each repetition is <key0_0>..<key0_{size0-1}><key1_0>… with bits packed in little-endian order in each byte.
  • repetitions – number of repetitions.
  • key_sizes – Keys and sizes of the measurements in the data.
Returns:

Dict mapping measurement key to a 2D array of boolean results. Each array has shape (repetitions, size) with size for that measurement.