-
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
More performance improvements for Collect2qBlocks #6680
Conversation
Results show roughly a 1.25x speed up compared to the main branch. Using the same benchmark from #6534: import timeit
from qiskit import QuantumRegister, QuantumCircuit
from qiskit.circuit.library import QuantumVolume
from qiskit.converters import circuit_to_dag
from qiskit.transpiler.passes.optimization import Collect2qBlocks
from qiskit.compiler import transpile
N = 100
q = QuantumRegister(N, 'q')
qc = QuantumCircuit(q)
qc.append(
QuantumVolume(N, N//2, seed=2, classical_permutation=False), q
)
qc = transpile(qc, optimization_level=0, basis_gates=['u1', 'u2', 'u3', 'cx'])
dag = circuit_to_dag(qc)
c2q = Collect2qBlocks()
print(
timeit.timeit("c2q.run(dag)", globals=globals(), number=10)
) Main: 0.89404s |
Are the logic improvements here reflected in the retworkx version? |
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.
LGTM, thanks for doing this.
I removed the automerge tag, since as @jakelishman reminded me this needs an upgrade release note documenting the increase in the minimum retworkx version used. I'll add this shortly and just merge it after |
Summary
Related to Qiskit/rustworkx#265
Uses the ported version of the single-sweep algorithm from #6534 in retworkx.
This PR brings a performance boost and removes the bottleneck from the graph traversal
Details and comments
Depends on retworkx 0.10 being releasedRetworkx 0.10 has been released, this PR is ready for review