MarcSerraPeralta / surface-sim

Repository for simulations of surface code experiments
MIT License
0 stars 1 forks source link

Avoid code repetition in `circuit_blocks` #21

Closed MarcSerraPeralta closed 2 months ago

MarcSerraPeralta commented 2 months ago

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

(...)