-
Notifications
You must be signed in to change notification settings - Fork 615
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
Introduce device capability flag and default handler for parameter broadcasting #2590
Conversation
Co-authored-by: Josh Izaac <josh146@gmail.com>
…nsform in device.batch_transform
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #2590 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 245 246 +1
Lines 19724 19874 +150
========================================
+ Hits 19642 19792 +150
Misses 82 82
Continue to review full report at Codecov.
|
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.
Very nice and clean PR @dwierichs! Mostly left questions, but don't forget to also (a) add this PR to the changelog, and (b) ensure the new docstring appears in the docs
[sc-19789] |
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.
Thanks @dwierichs!
…tions (#2609) * commit old changes * intermed * clean up, move broadcast dimension first * update tests that manually set ndim_params for default ops * pin protobuf<4.21.0 * improve shape coersion order * changelog formatting * broadcasted pow tests * attribute test, ControlledQubitUnitary update * test kwargs attributes * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * changelog * review * remove prints * explicit attribute supports_broadcasting tests * tests disentangle * fix * PauliRot broadcasted identity compatible with TF * rename "batched" into "broadcasted" for uniform namespace * old TF version support in qubitunitary unitarity check * python3.7 support * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * linebreak Co-authored-by: Josh Izaac <josh146@gmail.com>
Context:
This PR is the second one to introduce parameter broadcasting, following up on #2575.
Description of the Change:
Here we introduce the device capability flag
"supports_broadcasting"
and a tape expansion functionunbroadcast_expand
(abatch_transform
) that expands broadcasted tapes into unbroadcasted ones. This function is then used indevice.batch_transform
to expand broadcasted tapes whenever the device does not support broadcasting.Benefits:
Possible Drawbacks: