surface_sim.experiments.arbitrary_experiment.experiment_from_schedule#

experiment_from_schedule(schedule, model, detectors, anc_reset=True, anc_detectors=None, meas_to_obs=None, reset_state=True, num_log_meas=0)[source]#

Returns a stim circuit corresponding to a logical experiment corresponding to the given schedule.

Parameters:
schedule

List of operations to be applied to a single qubit or pair of qubits. See Notes of schedule_from_circuit for more information about the format.

model

Noise model for the gates.

detectors

Object to build the detectors.

anc_reset

If True, ancillas are reset at the beginning of the QEC round. By default True.

anc_detectors

List of ancilla qubits for which to define the detectors. If None, adds all detectors. By default None.

meas_to_obs

Dictionary with keys corresponding to the logical measurement indices and values corresponding to the observable indices that the measurement has support on. This information is used to build the observables in the circuit. By default, it defines an observable for every logical measurement.

reset_state

Flag to reset the state of model and detectors. It is useful when building circuits sequentially in chuncks so that the state is kept. If False, the qubit coordinates are not included in experiment. By default, True.

num_log_meas

Number of logical measurements in the circuit before processing the operations in the given schedule. It is useful when building circuits sequentially in chuncks so that the state is kept. By default, 0.

Returns:
experiment

Stim circuit corresponding to the logical equivalent of the given schedule.

Notes

The scheduling of the gates between QEC rounds is not optimal as there could be more idling than necessary. This is caused by using merge_logical_operations.