Skip to content

faster transpile (qubit lookup) in rb code#1022

Merged
itoko merged 3 commits into
qiskit-community:mainfrom
ajavadia:faster-rb-qubit-lookup
Feb 6, 2023
Merged

faster transpile (qubit lookup) in rb code#1022
itoko merged 3 commits into
qiskit-community:mainfrom
ajavadia:faster-rb-qubit-lookup

Conversation

@ajavadia
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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