-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat!: Add remaining tket2 ops #107
Conversation
guppy/prelude/quantum.py
Outdated
@guppy.hugr_op(quantum, quantum_op("Measure")) | ||
def measure_q(q: Qubit) -> tuple[Qubit, bool]: | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas for a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restless_measure
or nondestructive_measure
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seyon suggested measure_return
?
guppy/prelude/quantum.py
Outdated
@guppy.custom(quantum, MeasureCompiler()) | ||
def measure(q: Qubit) -> bool: | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we would directly write
@guppy(quantum)
def measure(q: Qubit) -> bool:
q, res = measure_q(q)
discrad(q)
return res
However, linking doesn't work yet, so we have to use a CustomCallCompiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say this is a feat!:
rather than a chore:
, but LGTM.
guppy/prelude/quantum.py
Outdated
@guppy.hugr_op(quantum, quantum_op("Measure")) | ||
def measure_q(q: Qubit) -> tuple[Qubit, bool]: | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restless_measure
or nondestructive_measure
?
Also change the signature of
measure
toQubit -> bool
.Fixes #104 and fixes #106