-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Speeds up RouteCQC by encoding qubits as integers #5872
Conversation
…exing in hot path
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 so much for making this great optimization.
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.
Couple of concerns on a quick read-through. Performance improvements look great!
* added circuit visualization code * made print gate private and added more tests * removed unused import and added gate to private list * addressed comments * added safeguard for wrong use of RoutingSwapTag * addressed nits * added return type for * added _SwapPrintGate again to and fixed type issue
It is sufficient to have the pattern once in the top .gitignore.
No change in code function.
Automerge cancelled: A status check is failing. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Fixes #5860
The speedup is ~2x - 3x compared to the original implementation. Output from benchmarks using
asv run --quick
is as follows:cc @ammareltigani
This PR also removed
_value_equality_values_
implementation from the routing class since a transformer doesn't need to support value equality / be hashable and supporting value equality increases the memory footprint of the transformer by storing unnecessary additional objects like the entire device graph instead of only the induced subgraph on integers etc.