-
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
fix: hseries ops use floats instead of angles #483
Conversation
3ba7e48
to
0eaf4fa
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #483 +/- ##
==========================================
- Coverage 91.99% 91.94% -0.06%
==========================================
Files 58 58
Lines 5898 5910 +12
==========================================
+ Hits 5426 5434 +8
- Misses 472 476 +4 ☔ View full report in Codecov by Sentry. |
rx, | ||
rz, |
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.
see Tk2ops, we should add missing (I can see at least Ry, CRz, Toffoli missing)
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 will create an issue and do as follow up
# TODO: The tket1 conversion needs to be updated with all the hugr ops changes | ||
# before we can test the translated ops | ||
# ops = {g.op.type for g in tk1} |
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.
everything in tk2 ops should work as before, hseries ops won't work but that's ok imho
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 think the conversion does not expect angles yet, and that ops
set ends up being empty -.-
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.
ah...angles not working is a bug, please raise issue
@guppy(quantum) | ||
@typing.no_type_check | ||
def phased_x(q: qubit, angle1: angle, angle2: angle) -> qubit: | ||
f1 = float(angle1) |
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.
complete side thought but do we maybe have any way of telling code coverage to ignore guppy function definitions
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.
Was looking into it, doesn't seem likely
🤖 I have created a release *beep* *boop* --- ## [0.11.0](v0.10.0...v0.11.0) (2024-09-11) ### ⚠ BREAKING CHANGES * `guppy.take_module` renamed to `guppy.get_module` and no longer removes the module from the state. * Quantum operations `rx`, `rz`, `phased_x`, and `zz_max` use the `angle` type instead of floats. ### Features * Add implicit importing of modules ([#461](#461)) ([1b73032](1b73032)) * Use angle type in quantum operations ([#467](#467)) ([ce0f746](ce0f746)) ### Bug Fixes * hseries ops use floats instead of angles ([#483](#483)) ([7ed3853](7ed3853)), closes [#477](#477) * Keep track of definitions that are implicitly imported ([#481](#481)) ([a89f225](a89f225)), closes [#480](#480) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Adds unit tests to generate and validate each operation in
prelude.quantum
.Closes #477