Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
General routing #3762
General routing #3762
Changes from 9 commits
f9f5301
69897a6
f71459a
155be99
ffc2d10
5dc2cbc
e26f765
3fff7e6
d5f67b0
c62fc0d
e53eb15
5035d07
0f1aeb0
e6ff517
a2496ec
31cac28
9e8fd5e
cef8133
15fea51
92522b8
7daf732
9aaf192
cc8920d
1298182
e3ffd91
6253572
00ad95e
446af3d
117aa2f
33116e4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
would work to return a physical-to-physical qubit map. (Note: Both of left_q and right_q are physical qubits.)
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'm not sure why you can assume the same ordering of the qubits by using
dag.qubits()[left_q]
. Why would the physical qubit have the same index as the qubit register in the dag? Is that guaranteed somehow?E.g., if I get a Layout with a DagCircuit which say that qubit
v[15] → 35
, then that is guaranteed to mean that virtual qubit v15 is mapped onto dag.qubits()[35]?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.
ApplyLayout guarantees that the physical qubit have the same index as the qubit register in the dag. It assures that the dag has only one register 'q' and its index is the same as that of physical qubits, i.e. the dag never has virtual qubits. So as long as LayoutTransformation runs after ApplyLayout,
dag.qubits()[left_q]
is valid. If we want to handle circuits with virtual qubits (in future), we need more lines here to care the case you suggested.