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 qml.matrix
docs for wire ordering with qnodes
#4874
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4874 +/- ##
==========================================
- Coverage 99.65% 99.64% -0.02%
==========================================
Files 385 385
Lines 34719 34569 -150
==========================================
- Hits 34599 34446 -153
- Misses 120 123 +3 ☔ View full report in Codecov by Sentry. |
[sc-50654] |
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 @mudit2812! I like the addition of the note box to make things very clear. Can we also have it in the wire_order
arg docstring?
wire_order (Sequence[Any], optional): Order of the wires in the quantum circuit.
The default wire order depends on the type of ``op``:
- If ``op`` is a :class:`~.QNode`, then the wire order is determined by the
associated device's wires, if provided.
- Otherwise, the wire order is determined by the order in which wires
appear in the circuit.
- See the usage details for more information.
Feel free to reword some of the above!
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
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.
One formatting thing not rendering correctly, otherwise looks good to me! 🚀
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
Context:
qml.matrix
wire ordering with the newdefault.qubit
was causing problems whendevice.wires=None
. This is because whendevice.wires=None
, the tape wires are used, the order of which is determined by which wires are used first, even with sequential integer wire labels.Description of the Change:
qml.matrix
to provide more details on how the wire order is determined when usingqml.matrix
with aQNode
.Benefits:
Users may be less confused if
qml.matrix
gives a matrix with an unexpected wire order.Possible Drawbacks:
Related GitHub Issues: