surface_sim.experiments.experiment_from_circuit#
- experiment_from_circuit(circuit, layouts, model, detectors, gate_to_iterator, anc_reset=True, anc_detectors=None)[source]#
Returns the encoded version of the given circuit.
- Parameters:
- circuit
Stim circuit.
- layouts
List of layouts whose index match the qubit index in
circuit. This function only works for layouts that only have one logical qubit.- model
Noise model for the gates.
- detectors
Object to build the detectors.
- gate_to_iterator
Dictionary mapping the names of stim circuit instructions used in
circuitto the functions that generate the equivalent logical circuit. Note thatTICKalways refers to a QEC round for all layouts.- anc_reset
If
True, ancillas are reset at the beginning of the QEC round. By defaultTrue.- anc_detectors
List of ancilla qubits for which to define the detectors. If
None, adds all detectors. By defaultNone.
- Returns:
- experiment
Stim circuit corresponding to the encoded version of
circuit. Ifcircuitcontains observable definitions, then the observables inexperimentcorrespond to those. If not, there is one observable for each measurement incircuit.
Notes
For more information, check the documentation of:
schedule_from_circuitandexperiment_from_schedule.