You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#671
Allows you to load pytket circuits as function definitions that use
arrays as both inputs and outputs:
```
circ = Circuit(2)
circ.measure_all()
guppy.load_pytket("guppy_circ", circ)
@guppy
def foo(q: array[qubit, 2]) -> array[qubit, 2]:
return guppy_circ(q)
```
Note that:
- If using more registers than just the default register, this relies on
the user sticking to lexicographic order for registers based on their
names, with the default qubit and bit registers being `q` and `c`
respectively. This is done because the tket2 conversion to HUGR relies
on this order for qubit / bit ordering. It may be worth treating default
registers differently in the future but that depends on user preferences
- I think the original idea was to use arrays when the user specifies
them as such in the explicit function signature - I've decided to go
with the implicit version as this a) seems to be used more often by
users and b) would have been more complicated to implement with more
questions with regards to how much flexibility you want to give / would
be expected in the signature definition, but this should be a follow up
issue (#859)
BREAKING CHANGE: `load_pytket` takes arrays by default (pass
`use_arrays=False` for qubit arguments)
Follow up from
load_pytket_with_arrays
implementation, some feedback on what would be useful neededThe text was updated successfully, but these errors were encountered: