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
transpose wire ordering for state results after transpile #4793
Conversation
Hello. You may have forgotten to update the changelog!
|
[sc-49570] |
Thanks @albi3ro! Is a device-independent bugfix infeasible? |
Probably not impossible, but I don't know how to do it. I'm willing to take suggestions. In my mind, a device independent fix would require deeper architectural changes to how we handle wire orders. |
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 address the overlapping code in StateMP and simulate.py in a follow-up PR. this looks good!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4793 +/- ##
==========================================
- Coverage 99.64% 99.63% -0.02%
==========================================
Files 381 381
Lines 34336 34115 -221
==========================================
- Hits 34214 33990 -224
- Misses 122 125 +3
☔ View full report in Codecov by Sentry. |
Context:
The
transpile
transform changes the wires of everything after the necessarySWAP
gates. Unfortunately, we have classes of measurements in PennyLane that are sensitive to the wire order but do not store the wire order on the measurement process.Description of the Change:
transpile
transform now takes the device as a keyword argumentStateMP
, we convert it toDensityMatrixMP
StateMP
, we update the measurement to give it the device wiresStateMP
, the post-processing function transposes the state resultBenefits:
The output of the qnode will look the same with and without the transpile transform
Possible Drawbacks:
Related GitHub Issues: