surface_sim.circuit_blocks.rot_surface_code_css.encoding_qubits_iterator#

encoding_qubits_iterator(model, layout, physical_reset_op, primitive_gates, single_layer_resets=False)[source]#

Yields stim circuit blocks which as a whole correspond to an encoding circuit to a rotated surface code of the given model without the detectors. Note that this encoding circuit is not fault tolerant.

Parameters:
model

Noise model for the gates.

layout

Code layout.

physical_reset_op

Reset operation to be applied to the physical qubit that will grow to a rotated surface code.

primitive_gates

Set of primitive gates to use. The available options are: (1) "cnot", which uses Rx, RZ, and CNOT gates, and (2) "cz", which uses RZ, H, and CZ gates. Note that the physical_reset_op will not be decomposed into primitive gates.

single_layer_resets

Flag to put all resets in a single operation layer at the beginning of the encoding circuit. By default False.

Notes

The implementation follows Figures 1 and 2 from:

Claes, Jahan. “Lower-depth local encoding circuits for the surface code.” arXiv preprint arXiv:2509.09779 (2025).