-
Notifications
You must be signed in to change notification settings - Fork 575
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
Update Permute
operation tests
#1318
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #1318 +/- ##
=======================================
Coverage 98.16% 98.16%
=======================================
Files 148 148
Lines 11446 11446
=======================================
Hits 11236 11236
Misses 210 210 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.
Thanks @antalszava for both finding this and fixing this!
Does it make sense for Permute
to be a native default.qubit
operation in the future? If it is more efficient permuting wires all at once rather than using many swaps, that might potentially this might speed up simulations which use it.
.github/CHANGELOG.md
Outdated
* Tests for the `Permute` operation are adjusted so that tape expansion happens | ||
once. |
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'm not so sure this belongs in 'improvements', as it is a bugfix to the tests suite (and not an improvement in PL directly). Perhaps worth moving to Bug fix, and adding a bit more detail here?
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.
Oh, good point! Updated
Thank you for the comments @josh146! Created an issue for native support of |
Context
There are test cases for the
Permute
operation that involves creating a QNode and checking that the underlying tape is expanded. Due to the tape expansion, thePermute
operation is decomposed intoSWAP
operations.These test cases call the
QuantumTape.expand
method explicitly. However, as the test cases use a QNode, anddefault.qubit
, the device at hand doesn't support thePermute
operation, tape expansion happens internal. Therefore, by the time the second call to theQuantumTape.expand
method is placed, the tape has already been expanded.This second call at the moment leaves the tape as is. However, defining a decomposition for
qml.SWAP
(as is done in #1317) would result in another depth of tape expansion and in causing errors to the current test cases which assume the tape containsqml.SWAP
operations.Changes
Updates the tests creating a QNode to not call
QuantumTape.expand
.