The main difference between the different surface codes variants in surface_sim.circuit_blocks is the qec_cycle.
To avoid code duplication, it is better to create a different file (e.g. util.py) with the common blocks and then import each of this in each different surface code variant.
For example
#utils.py
def qubit_coords(...):
(...)
return
and
#surface_code_css.py
from .utils import qubit_coords
(...)
The main difference between the different surface codes variants in
surface_sim.circuit_blocks
is theqec_cycle
. To avoid code duplication, it is better to create a different file (e.g.util.py
) with the common blocks and then import each of this in each different surface code variant.For example
and