-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
optimization_level=1 always uses Trivial layout #2845
Labels
bug
Something isn't working
on hold
Can not fix yet
priority: high
status: pending PR
It has one or more PRs pending to solve this issue
Milestone
Comments
Confirmed. qr = QuantumRegister(5)
cr = ClassicalRegister(5)
qc = QuantumCircuit(qr, cr)
qc.h(qr[1])
qc.h(qr[2])
qc.h(qr[3])
qc.h(qr[4])
qc.cx(qr[0], qr[1])
qc.cx(qr[1], qr[2])
qc.cx(qr[2], qr[3])
qc.cx(qr[3], qr[4])
qc.barrier(qr)
qc.measure(qr, cr)
backend = IBMQ.get_backend('ibmq_20_tokyo')
new_qc = transpile(qc, backend, optimization_level=1)
print('\n'.join([str((i, j)) for i, j in new_qc.layout._p2v.values() if i.name != 'ancilla']))
Is also new_qc = transpile(qc, backend, optimization_level=2)
print('\n'.join([str((i, j)) for i, j in new_qc.layout._p2v.values() if i.name != 'ancilla']))
|
Re-opened by #2975, will revisit post-0.9. |
This can be fixed once "best of" approach is implemented (see #2969). On hold until then. |
Under the assumption that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
on hold
Can not fix yet
priority: high
status: pending PR
It has one or more PRs pending to solve this issue
Information
What is the current behavior?
shows initial layout as the trivial layout, which is disconnected:
However part #2 in the source says
_layout_check
does better layoutif the circuit needs swaps,
# 2. Use a better layout on densely connected qubits, if circuit needs swaps
which is obviously the case here, but no other layouts
are actually selected (or imported).
Steps to reproduce the problem
What is the expected behavior?
Expected that the
DenseLayout
is used if there are swaps needed.Suggested solutions
The text was updated successfully, but these errors were encountered: