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

faster transpile (qubit lookup) in rb code #1022

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

ajavadia
Copy link
Contributor

Summary

a small improvement to make transpile faster in rb code as a follow up to #982

Details and comments

@ajavadia ajavadia force-pushed the faster-rb-qubit-lookup branch from 8cc6ac6 to 9e74b5f Compare January 24, 2023 03:43
@ajavadia ajavadia force-pushed the faster-rb-qubit-lookup branch from 9e74b5f to d511ed1 Compare January 24, 2023 05:29
Copy link
Contributor

@itoko itoko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Comment on lines +386 to 387
qubit_indices = {bit: index for index, bit in enumerate(transpiled[0].qubits)}
for circ in transpiled:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All transpiled circuits has qubits with unique name "q" so no problem in these lines, but a bit slower

for circ in transpiled:
    qubit_indices = {bit: index for index, bit in enumerate(circ.qubits)}

might be safer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but all RB circuits have the same qubits no? otherwise i think a test should have failed

@itoko itoko added this to the Release 0.5 milestone Jan 31, 2023
@itoko itoko merged commit 7bf1b59 into qiskit-community:main Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants