CQCL/tket2

Add a python-defined layer over the bindings.

Closed this issue · 2 comments

Move the bindings to a tket2._tket2 submodule and re-define all structures from python, backed by their binded counterparts.

See Quantomatic/quizx for an example.

This gives us more flexibility on the python interface, where we can define methods that better reflect the python conventions.
Additionally, typing information is simpler and less error-prone; we only need the hand-written .pyi for the reduced binded methods and missing values will not affect the external API.

Summary of in-person discussion:
Following on from #465, we intend to use hugr-py Node, Port, Wire types in the surface python layer. For ops and types, things like HugrType or TK2Ops should implement the hugr-py Op and Type protocols for compatibility. They should also compare as equal to their hugr-py counterparts.

Closing this, as it will be included in any new tket2 bindings support / replaced by hugr-py uses.