CQCL / tket2

Version 2 of the TKET quantum compiler
http://crates.io/crates/tket2
Apache License 2.0
24 stars 5 forks source link

Add a python-defined layer over the bindings. #350

Closed aborgna-q closed 1 month ago

aborgna-q commented 3 months ago

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.

ss2165 commented 2 months ago

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.

aborgna-q commented 1 month ago

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