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

Long transpile time for simple circuits #9367

Closed
HwajungKang opened this issue Jan 12, 2023 · 2 comments · Fixed by #9148
Closed

Long transpile time for simple circuits #9367

HwajungKang opened this issue Jan 12, 2023 · 2 comments · Fixed by #9148
Labels
bug Something isn't working

Comments

@HwajungKang
Copy link

Environment

  • Qiskit Terra version: 0.39.4
  • Python version: 3.7.9
  • Operating system: Darwin

What is happening?

Transpiling a simple circuit for a 100+ qubit IBM System such as 'ibm_sherbrooke' takes way longer than expected.
I am attaching here the diagram of the circuit that was used and the result of profiling the transpiling time of the circuit against 'ibm_sherbrooke'.

circuit

profile

How can we reproduce the issue?

from qiskit import *
from qiskit_ibm_provider import IBMProvider
import numpy as np

qc = QuantumCircuit(4)
qc.rx(np.pi*0.95, range(4))
qc.measure_all()

prov = IBMProvider()
backend = prov.get_backend('ibm_sherbrooke')

%%prun
qc_trans = transpile(qc, backend, optimization_level=3)

What should happen?

I don't think that it should take that long.

Any suggestions?

No response

@HwajungKang HwajungKang added the bug Something isn't working label Jan 12, 2023
@mtreinish
Copy link
Member

I think this will be fixed by: #9148 based on the profile timings there it looks like it's being caused by vf2layout trying really hard to try to find which permutation of qubits have the lowest noise in a very naive way. For your circuit it's basically evaluating 10334625 different possible layout permutations which takes a long time. #9148 should fix this by figuring out the lowest noise qubits and selecting those directly.

@HwajungKang
Copy link
Author

Hi Matthew, thanks for the reply. 10334625 is definitely a huge number of options! ;) Glad to hear that there is already a fix for it!

@mtreinish mtreinish linked a pull request Jan 12, 2023 that will close this issue
@mergify mergify bot closed this as completed in #9148 Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants