QCHackers / tqec

Design automation software tools for Topological Quantum Error Correction
https://tqec.app
Apache License 2.0
58 stars 15 forks source link

Validate `ComposedTemplate` #242

Open nelimee opened 1 month ago

nelimee commented 1 month ago

Is your feature request related to a problem? Please describe. Some instances of ComposedTemplate are invalid when scaled up. For example, image will eventually be invalid as, when k grows, the two scalable templates at the bottom will eventually overlap.

It would be nice to be able to check that kind of problems directly within the ComposedTemplate class and return a nice error message when an error is found.

Describe the solution you'd like Following #241, and assuming that template bounding boxes cannot overlap (which might not be valid if we have a ComposedTemplate instance containing non-atomic templates, such as other ComposedTemplate instances), we might be able to compute if two template might eventually overlap from their scalable bounding box. If such a case happens, an error should be raised.