[WIP] Oxidize qubit tracker for HighLevelSynthesis #13180
+320
−135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In #12911, we have added the
QubitTracker
class, which tracks the state of qubits for high-level synthesis. WhenHighLevelSynthesis
runs non-trivially (i.e. does not take the "fast path", see #13070), this state tracking requires a large number of ssllllooooww Python set-based manipulations.As an example, the following code
runs in about
3.2
seconds (on my laptop). The current PR almost verbatim reimplementsQubitTracker
in Rust, with the example above now running in0.11
seconds (i.e. about 30x faster).It also adds a few Python tests for
QubitTracker
.This does not require release notes since
QubitTracker
is an internal class and should not be exposed to the users.This is still work-in-progress because I would like to further revise
QubitTracker
's API and improve the internal data structures.