pygsti.protocols.freeformsim

ModelTest Protocol objects

Module Contents

Classes

FreeformDataSimulator

Computes arbitrary functions of the state data simulator that also computes user-defined functions

ModelFreeformSimulator

A base class for data simulators that utilize models (probably most of them!).

class pygsti.protocols.freeformsim.FreeformDataSimulator

Bases: pygsti.protocols.protocol.DataSimulator

Computes arbitrary functions of the state data simulator that also computes user-defined functions of the final states.

abstract compute_freeform_data(self, circuit)

Computes the simulated free-form data for a single circuit.

Parameters

circuit (Circuit) – The circuit to compute data for.

Returns

dict

run(self, edesign, memlimit=None, comm=None)

Run this data simulator on an experiment design.

Parameters
  • edesign (ExperimentDesign) – The input experiment design.

  • memlimit (int, optional) – A rough per-processor memory limit in bytes.

  • comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator used to run this data simulator in parallel.

Returns

ProtocolData

apply_fn(self, series)
apply(self, df)

Apply this data simulator to a data frame having a Circuit column.

Parameters

df (pandas.DataFrame) – The data frame to apply to.

Returns

pandas.DataFrame

class pygsti.protocols.freeformsim.ModelFreeformSimulator(models)

Bases: FreeformDataSimulator

A base class for data simulators that utilize models (probably most of them!).

Holds a dictionary of models and provides basic functionality for computing probabilities, final states, and process matrices corresponding to circuits which make implementing :method:`compute_freeform_data` easier.

Parameters

models (dict) – A dictionary whose keys are string labels and values are Model objects, specifying the models used to compute “simluated” data.

compute_process_matrix(self, model, circuit, include_final_state=False, include_probabilities=False)
compute_process_matrices(self, circuit, include_final_state=False, include_probabilities=False)
compute_final_state(self, model, circuit, include_probabilities=False)
compute_final_states(self, circuit, include_probabilities=False)
compute_circuit_probabilities(self, model, circuit)
compute_probabilities(self, circuit, include_probabilities=False)