-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add fixedbitset clifford for simd bitwise composition #15325
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
Draft
mtreinish
wants to merge
4
commits into
Qiskit:main
Choose a base branch
from
mtreinish:simd-fixedbitset
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit optimizes the implementation of the LitinskiTransformation pass. The improvements fall into a couple of categories, but most of the runtime performance improvements will come from removing unecessary allocations. From a quick glance the Clifford struct looks like it could also use a similar once over, mostly to get it to leverage Qiskit's types more effectively if nothing else. But I kept the changes there minimal for this commit and only modified the method used by The LitinskiTransformation directly.
Besides adapting to the rebase this also improves the SparseObservable construction.
This commit adds a custom clifford implementation for the litinski transform that is simd optimized by using fixedbitset. This makes most of the operations operating on the clifford use SIMD bitwise instructions rather than iterating over arrays manually. This improves the runtime performance of doing gate composition on the clifford. There is likely a bit more overhead for iterating over the tableau but this shouldn't be significant compared the the runtime gains constructing the tableau. For this commit the clifford class is duplicated because the other place the existing struct in the quantum_info is used, clifford synthesis, is based on the current tableau structure. This opted to copy the code because I didn't want to change the synthesis code too. We should be able to unify the implementations eventually, but it would require adjusting anything directly accessing the clifford tableau which I viewed as outside the scope of this PR.
1aa68b9 to
b4a80fd
Compare
Pull Request Test Coverage Report for Build 19277206289Details
💛 - Coveralls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fault tolerance
related to fault tolerance compilation
on hold
Can not fix yet
performance
Rust
This PR or issue is related to Rust code in the repository
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
This commit adds a custom clifford implementation for the litinski
transform that is simd optimized by using fixedbitset. This makes most
of the operations operating on the clifford use SIMD bitwise
instructions rather than iterating over arrays manually. This improves
the runtime performance of doing gate composition on the clifford. There
is likely a bit more overhead for iterating over the tableau but this
shouldn't be significant compared the the runtime gains constructing the
tableau.
For this commit the clifford class is duplicated because the other place
the existing struct in the quantum_info is used, clifford synthesis, is
based on the current tableau structure. This opted to copy the code
because I didn't want to change the synthesis code too. We should be
able to unify the implementations eventually, but it would require
adjusting anything directly accessing the clifford tableau which I
viewed as outside the scope of this PR.
Details and comments
This is based on top of #15315 and will need to be rebased after it merges. To view the contents of just this PR you can look at the HEAD commit: b4a80fd. This also will want to incorporate the changes to #15318 into this after it merges.