surface_sim.experiments.small_stellated_dodecahedron_code.repeated_swap_c_like_experiment#

repeated_swap_c_like_experiment(model, layout, detectors, num_swap_gates, num_rounds_per_gate, gate_to_iterator={'I': 'idle_iterator n=1', 'M': 'log_meas_z_iterator bZ', 'MX': 'log_meas_x_iterator bX', 'MZ': 'log_meas_z_iterator bZ', 'R': 'init_qubits_z0_iterator bZ', 'RX': 'init_qubits_x0_iterator bX', 'RZ': 'init_qubits_z0_iterator bZ', 'TICK': 'qec_round_iterator'}, init_qubits_iterator=<function init_qubits_iterator>, data_init=None, rot_basis=False, anc_reset=True, anc_detectors=None)[source]#

Returns the circuit for running a repeated-(SWAP-like) experiment.

Parameters:
model

Noise model for the gates.

layout

Code layout.

detectors

Detector definitions to use.

num_swap_gates

Number of logical (transversal) SWAP-like gates to run in the experiment.

num_rounds_per_gate

Number of QEC round to be run after each logical SWAP-like gate.

gate_to_iterator

Dictonary mapping stim.CircuitInstuction names to LogOpCallable functions that return a generator with the physical implementation of the logical operation.

init_qubits_iterator

If data_init is not None, the reset iterator is built from this specified function. It should have the following inputs: (model, layout, data_init, rot_basis) and return a valid generator for the initialization of the data qubits. By default, None.

data_init

Bitstring for initializing the data qubits. By default None mearning that it initializes the qubits using the reset given by gate_to_iterator.

rot_basis

If True, the experiment is performed in the X basis. If False, the experiment is performed in the Z basis. By deafult False.

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.