-
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
Circuit cutting: Remap fragment tape wires to match wires available on device #2257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2257 +/- ##
=======================================
Coverage 99.31% 99.31%
=======================================
Files 237 237
Lines 18906 18932 +26
=======================================
+ Hits 18776 18802 +26
Misses 130 130
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 for the addition @trbromley!
0: ──RX(0.5)──╭C──╭┤ ⟨Z ⊗ Z⟩ | ||
1: ──RY(0.6)──╰X──╰┤ ⟨Z ⊗ Z⟩ | ||
""" | ||
if len(tape.wires) > len(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.
should we raise a similar error for the case when len(tape.wires) < len(wires)
, considering running on hardware but not sure if having an unnecessarily big device is of much consequence?
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.
If we do len(tape.wires) < len(wires)
then we'd likely often hit an error - e.g., you have a 5-qubit circuit and split into 3 and 2 qubit fragments. We won't be able to run on a 3-qubit device because the 2-qubit fragment will lead to an error.
Context:
This PR ensures that N-qubit fragment circuits can be run on N-qubit devices by mapping the wires of the input circuit to match those available in the device.