ProgramSetQuantumTaskResult

class braket.tasks.program_set_quantum_task_result.MeasuredEntry(measurements, counts, probabilities, measured_qubits, measurements_from_device, probabilities_from_device, program, inputs, observable)[source]

Bases: object

Result of a single executable in a program.

Parameters:
  • measurements (numpy.ndarray) – 2d array - row is shot and column is qubit. The columns are in the order of measured_qubits.

  • counts (Counter) – A Counter of measurements. Key is the measurements in a big endian binary string. Value is the number of times that measurement occurred.

  • probabilities (dict[str, float]) – A dictionary of probabilistic results. Key is the measurements in a big endian binary string. Value is the probability the measurement occurred.

  • measured_qubits (list[int]) – The indices of the measured qubits.

  • measurements_from_device (bool) – flag whether measurements were copied from device. If false, measurements are calculated from device data.

  • probabilities_from_device (bool) – flag whether measurement_probabilities were copied from device. If false, measurement_probabilities are calculated from device data.

  • program (str) – The program this executable ran.

  • inputs (dict[str, float] | None) – The input parameters to this program, if any.

  • observable (Observable | None) – The observable of this program, if any.

measurements: ndarray
counts: Counter
probabilities: dict[str, float]
measured_qubits: list[int]
measurements_from_device: bool
probabilities_from_device: bool
program: str
inputs: dict[str, float] | None
observable: Observable | None
property expectation: float | None

The expectation value of this entry’s observable if there is one.

Type:

float | None

class braket.tasks.program_set_quantum_task_result.CompositeEntry(entries, program, inputs, observables, shots_per_executable, additional_metadata)[source]

Bases: object

Results of a program in a program set

Parameters:
  • entries (list[MeasuredEntry]) – The results of each executable in this program

  • program (Program) – The program that was run

  • inputs (ParameterSets) – The input values this program was run with

  • observables (Sum | list[Observable] | None) – The Sum Hamiltonian or observables that were measured, if any.

  • shots_per_executable (int) – The number of shots each underlying executable was run with

  • additional_metadata (AdditionalMetadata) – Additional metadata about this program

entries: list[MeasuredEntry]
program: Program
inputs: ParameterSets
observables: Sum | list[Observable] | None
shots_per_executable: int
additional_metadata: AdditionalMetadata
expectation(i=None)[source]

float | None: The expectation value of the Hamiltonian whose terms are the observables of the underlying entries, if observables were specified.

Parameters:

i (int | None)

Return type:

float | None

class braket.tasks.program_set_quantum_task_result.ProgramSetQuantumTaskResult(entries, task_metadata, num_executables, program_set)[source]

Bases: object

The result of a program set task.

Parameters:
  • entries (list[CompositeEntry]) – The results of each program in this program set

  • task_metadata (ProgramSetTaskMetadata)

  • num_executables (int) – The total number of executables in this program set task

  • program_set (ProgramSet | None) – The program set that was run; if specified, information from the program set such as observable expectation values can be automatically computed.

entries: list[CompositeEntry]
task_metadata: ProgramSetTaskMetadata
num_executables: int
program_set: ProgramSet | None
static from_object(result_schema, program_set=None)[source]

Create ProgramSetQuantumTaskResult from ProgramSetTaskResult object.

Parameters:
  • result_schema (ProgramSetTaskResult) – The result returned by the device; programs and metadata may be specified as relative S3 paths, in which case they will be downloaded to populate the instance.

  • program_set (ProgramSet) – The program set that was run; if specified, information from the program set such as observable expectation values can be automatically computed. Default: None.

Return type:

ProgramSetQuantumTaskResult

Returns:

ProgramSetQuantumTaskResult – A ProgramSetQuantumTaskResult based on the given schema object; all data stored in S3 is downloaded.

property programs: list[Program]

The OpenQASM programs specified in the program set

Type:

list[Program]