surface_sim.experiments.arbitrary_experiment.schedule_from_circuit#

schedule_from_circuit(circuit, layouts, gate_to_iterator)[source]#

Returns the equivalent schedule from a stim 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.

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.

Returns:
schedule

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

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. If no observables are defined in the circuit, meas_to_obs = None.

Notes

The format of the schedule is the following. Each element of the list is an operation to be applied to the qubits: - tuple[LogOpCallable, Layout] performs a (logical) single-layout operation - tuple[LogOpCallable, Layout, Layout] performs a (logical) two-qubit gate.

The OBSERVABLE_INCLUDE instructions are only included in schedule if they are Pauli target (e.g., Z0). The rest (e.g., the rec[-k] ones) are included in meas_to_obs.

For example, the following circuit

is translated to