cirq.TrialResult

class cirq.TrialResult(*, params: cirq.study.resolver.ParamResolver, measurements: Dict[str, numpy.ndarray])[source]
The results of multiple executions of a circuit with fixed parameters.
Stored as a Pandas DataFrame that can be accessed through the “data”
attribute. The repetition number is the row index and measurement keys
are the columns of the DataFrame. Each element is a big endian integer
representation of measurement outcomes for the measurement key in that
repitition.
params

A ParamResolver of settings used when sampling result.

__init__(*, params: cirq.study.resolver.ParamResolver, measurements: Dict[str, numpy.ndarray]) → None[source]
Parameters
  • params – A ParamResolver of settings used for this result.

  • measurements – A dictionary from measurement gate key to measurement results. The value for each key is a 2-D array of booleans, with the first index running over the repetitions, and the second index running over the qubits for the corresponding measurements.

Methods

from_single_parameter_set(*, params, …)

Packages runs of a single parameterized circuit into a TrialResult.

histogram(*, key[, fold_func])

Counts the number of times a measurement result occurred.

multi_measurement_histogram(*, keys[, fold_func])

Counts the number of times combined measurement results occurred.

Attributes

data

measurements

repetitions