-
Notifications
You must be signed in to change notification settings - Fork 5
docs: add qsystem gate definitions #912
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #912 +/- ##
=======================================
Coverage 93.18% 93.18%
=======================================
Files 84 84
Lines 9628 9628
=======================================
Hits 8972 8972
Misses 656 656 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f1 = float(angle) | ||
_rz(q, f1) | ||
|
||
|
||
@guppy.hugr_op(quantum_op("Measure", ext=QSYSTEM_EXTENSION), module=qsystem) | ||
@no_type_check | ||
def measure(q: qubit @ owned) -> bool: ... | ||
def measure(q: qubit @ owned) -> bool: | ||
"""Measure a qubit destructively.""" |
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.
It's worth noting that this version of measure
is blocking unlike quantum.measure
that is lazy. I am unsure if that should be documented here or now.
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.
Never mind, I am wrong. Both of the variants of measure are lazy.
|
If we use this in all examples then that's what people will copy and use themselves. So I think we have to be careful that this doesn't become an anti-pattern. In particular, it would be bad if people slapped that decorator on every function. Also, where would you get the compiled Hugr from? Returning it from the decorator would make it hard to use those functions for comptime |
yes good point, what about a kwarg to |
Testing out adding some gate definitions and doctests to the qsystem docs
Couple things
std.qsystem
andstd.quantum
.qsystem
andqsystem_functional
(alsoquantum
andqauntum_functional
)