-
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
[WIRES] Make plugin compatible with wires refactor #37
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 222 224 +2
=========================================
+ Hits 222 224 +2
Continue to review full report at Codecov.
|
In future it would be also nice to be a bit cleverer about how to support cirq's GridQubits and LineQubits...But this is a minimal version against the breaking changes! |
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.
Nice, looks like the changes were very minor!
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 @mariaschuld! 🎉
@@ -71,6 +71,8 @@ def __init__(self, wires, shots, analytic, qubits=None): | |||
|
|||
self.circuit = None | |||
|
|||
device_wires = self.map_wires(self.wires) |
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, so if I understand this correctly, self.map_wires
will in this case go from e.g. self.wires -> ['q1', 'ancilla', 0, 1]
to device_wires -> [0, 1, 2, 3]
. And then the list of wires can be extracted from the Wires
object with device_wires.labels
. Is this correct?
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.
Yes, perfect! Well, strictly speaking the map goes from self.wires -> Wires(['q1', 'ancilla', 0, 1]) to device_wires -> Wires([0, 1, 2, 3])
, and device_wires.labels
is the tuple (0, 1, 2, 3)
...
This PR updates the plugin to support the new wire management in PennyLane master.