-
Notifications
You must be signed in to change notification settings - Fork 18
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
remove inverse support; add adjoint support; state-prep op cleanup #130
Conversation
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
- Coverage 99.23% 99.14% -0.09%
==========================================
Files 8 8
Lines 392 352 -40
==========================================
- Hits 389 349 -40
Misses 3 3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
[sc-33452] |
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.
Amazing job! Left some comments, but it is good to go 💯 🔥
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.
Looks good to me!
As the title says.
op.inv()
andop.inverse
are removed from Operators in PennyLane 0.29, so this plugin needs updating accordingly. To summarize how I do it:_base_op/obs_map
Adjoint(...)
(if the op exists and isn't already a natively supported adjoint op) and call the_op/obs_map
. They're separate because the QSim devices did not support inverse ops so this will make it easy to preserve that assumption.supports_op/obs
method now includes thoseAdjoint(...)
ops/obs. No customdevice.capabilities["supports_inverse_operation"]
changes are needed because adjoint op names will be in the dict (rather than a hidden.inv
property)supports_obs/ops
thanks to the dict separation described aboveThe plugin also did lots of custom handling of StatePrep operators that will now be handled by the operators themselves, so I have removed that code. The custom handling had its own errors so tests were failing as they were, which is why I changed them in this PR. Both this and the inverse changes should happen in the same PR to update to the latest pennylane without breaking anything.
Note that because
StatePrep.state_vector
did not exist before PL 0.29, the version in setup.py will need to be bumped before this plugin is released.