-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove deepcopy usage in dag_to_circuit #1431
Remove deepcopy usage in dag_to_circuit #1431
Conversation
This commit attempts to improve the performance of dag_to_circuit by removing the deepcopy usage. Instead this switches to creating a circuit object using the normal constructors while iterating over the dag.
When done, can you do a timeit to see the improvement? |
Yeah, once I get this passing all the tests I'm planning to add a comment here with some benchmarks. But, at least on this version of the PR I've done some preliminary timing with compiling a large qasm file (with like ~3.5k lines) from aqua that @ajavadia provided and got a significant speedup in that case. Calling compile() took ~3.1secs with this patch and ~3310.3 secs without this patch. |
Can you do the timing on transpile not complie |
…nish/qiskit-core into improve-dag-to-circuit-performance
Ok, I've fixed the issue caused by |
I'm still running numbers (without this patch transpile can take a long time) but so far I've finished the tests with and without this patch just parsing the same large qasm file from aqua I mentioned before and getting an unrolled dag from that and then timing how long
I'm running the transpile benchmarks using that same large qasm file now. I've finished the runs with this patch and it takes ~1.4 secs to run |
* Remove deepcopy usage in dag_to_circuit This commit attempts to improve the performance of dag_to_circuit by removing the deepcopy usage. Instead this switches to creating a circuit object using the normal constructors while iterating over the dag. * Fix u_base name * Fix CX is not cx * Remove random_name * CX is cx_base not cx * Fix bit args mismatch when using coupling map * Remove unused imports * Fix handling of simulator instructions
Summary
This commit attempts to improve the performance of dag_to_circuit by
removing the deepcopy usage. Instead this switches to creating a
circuit object using the normal constructors while iterating over the
dag.
Details and comments