-
Notifications
You must be signed in to change notification settings - Fork 2
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
Load circuit as a function definition #657
Comments
We want to allow users to declare pytket circuits to be used within Guppy at the module level: from pytket import Circuit
pytket_circ = Circuit(2)
pytket_circ.H(0)
pytket_circ.CX(0, 1)
@guppy.pytket(pytket_circ)
def guppy_circ(q1: qubit, q2: qubit) -> None:
"""Explicit stub for the circuit."""
# Alternatively, we also want to support loading without declaring a stub
guppy_circ = guppy.load_pytket(circ)
@guppy
def main() -> None:
q1, q2 = qubit(), qubit()
guppy_circ(q1, q2)
measure(q1)
measure(q2) The benefit of the stub approach is that it will allow the user to specify whether they want to use arrays for registers or pass qubits one by one. To implement this feature, we need to add new kind of
In |
py
circuit as a function definition rather than valueCloses #657, however the following limitations still exist which are covered by further issues: - #669: ~~Classical bits and measurements aren't currently supported as this requires some checks related to ownership and return values.~~ They are supported but without taking ownership. - #670: It would be nice to not have to provide an explicit function stub for the circuit and also have `load_pytket` method which infers it. - #671: It would also be nice to be able to provide arrays of qubits in the function stub.
So that function value execution isn't required
Use uuids for circuits - can use circuit names or custom names in future once we have #563 and use that for circuits
The text was updated successfully, but these errors were encountered: