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 circuit to the functions that generate the equivalent logical circuit. Note that TICK always refers to a QEC round for all layouts.

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.

Returns:
experiment

Stim circuit corresponding to the encoded version of circuit. If circuit contains observable definitions, then the observables in experiment correspond to those. If not, there is one observable for each measurement in circuit.

Notes

For more information, check the documentation of: schedule_from_circuit and experiment_from_schedule.