docs: add qsystem gate definitions
Testing out adding some gate definitions and doctests to the qsystem docs
Couple things
- potentially quite a pain to add defintions for all gates across
std.qsystemandstd.quantum. - We would also have to duplciate content across
qsystemandqsystem_functional(alsoquantumandqauntum_functional) - Need to ensure the doctests are working properly
Codecov Report
Attention: Patch coverage is 83.82353% with 11 lines in your changes missing coverage. Please review.
Project coverage is 92.29%. Comparing base (
2217bbc) to head (1188e13). Report is 27 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| guppylang/std/quantum/functional.py | 18.18% | 9 Missing :warning: |
| guppylang/std/quantum/__init__.py | 95.55% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #912 +/- ##
==========================================
+ Coverage 92.26% 92.29% +0.03%
==========================================
Files 106 112 +6
Lines 10406 10909 +503
==========================================
+ Hits 9601 10069 +468
- Misses 805 840 +35
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- Increasingly it looks like it would be handy to have a utility that defines and compiles a single function. To be used in exmamples, doc tests, prototyping, etc. @mark-koch are you opposed to adding a dedicated decorator for this? (prompted by having to call
compile()at the end of the doctest) - Don't duplicate docs, cross-link to the non-functional one in each case. e.g. "Functional variant of zz_phase, see
guppylang.std.qsystem.zz_phase"
are you opposed to adding a dedicated decorator for this?
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
we have to be careful that this doesn't become an anti-pattern
yes good point, what about a kwarg to @guppy that makes it clear that this is a thing you shouldn't do normally? Or a check kwarg that only does the checking stage and not compilation to hugr?
I started going through the changes but found that my comments had been marked as resolved but not addressed. Is this due to git issues?
Hmm strange. I don't know why the changes were not applied. Will fix, sorry.