Skip to content
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

Merged
merged 5 commits into from
Aug 6, 2020

Conversation

mariaschuld
Copy link
Contributor

This PR updates the plugin to support the new wire management in PennyLane master.

.github/CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #37 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #37   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          222       224    +2     
=========================================
+ Hits           222       224    +2     
Impacted Files Coverage Δ
pennylane_cirq/cirq_device.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce69fc0...c101b5a. Read the comment docs.

@mariaschuld
Copy link
Contributor Author

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!

Copy link
Member

@josh146 josh146 left a 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!

Copy link
Contributor

@thisac thisac left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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)...

@mariaschuld mariaschuld merged commit 922c38b into master Aug 6, 2020
@mariaschuld mariaschuld deleted the wires_refactor branch August 6, 2020 05:28
@josh146 josh146 mentioned this pull request Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants