Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tket1 circuit and Hugr interchangeably #178

Closed
ss2165 opened this issue Oct 9, 2023 · 0 comments · Fixed by #243
Closed

Use tket1 circuit and Hugr interchangeably #178

ss2165 opened this issue Oct 9, 2023 · 0 comments · Fixed by #243
Assignees
Labels
enhancement New feature or request py-bindings Python bindings

Comments

@ss2165
Copy link
Member

ss2165 commented Oct 9, 2023

          Having this is nice for avoiding unnecessary roundtrips, but it'd be nice to be able to use this interchangeably with TKET1 circs. Open an issue to investigate options?

Originally posted by @aborgna-q in https://github.com/CQCL-DEV/tket2/pull/177#discussion_r1350269565

@aborgna-q aborgna-q added enhancement New feature or request py-bindings Python bindings labels Oct 9, 2023
@aborgna-q aborgna-q self-assigned this Nov 10, 2023
github-merge-queue bot pushed a commit that referenced this issue Nov 10, 2023
Adds transparent wrappers on `tket2-py` that derive pyclass themselves.
This has multiple goals:

- Cleans up the code. Python stuff goes into the python crate.
Now `tket2:pyo3` and `hugr:pyo3` are only used for the python error
implementations.
(We could potentially move this too, and avoid us the `pyo3` dependency
headache).
  
- Let's us use the `tket2-py` conversion methods for tket1 and tket2
circuits. This is required for #178, which is in turn required for all
the python bindings in #204 that require stable indices.

Closes #148 

---

The code is mostly the same, asides from:
- replacing the custom implementation of `PyPatternMatch` with a
transparent wrapper. (There was a TODO for this).
- updating to tket-json-rs 0.3 (cleans up some calls that use
`Python::with_gil`)
github-merge-queue bot pushed a commit that referenced this issue Nov 15, 2023
Adds a `tket1`/`tket2` to the `with_hugr` helpers, so we always know
what format to output afterwards.

The more noisy part of this commit changing all the GIL-independent
types to capturing references, so we don't have to manually lock
multiple times per call.

Closes #178.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request py-bindings Python bindings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants