Skip to content

Conversation

@mtreinish
Copy link
Member

@mtreinish mtreinish commented Nov 11, 2025

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.

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.
@mtreinish mtreinish added this to the 2.3.0 milestone Nov 11, 2025
@mtreinish mtreinish added on hold Can not fix yet performance Rust This PR or issue is related to Rust code in the repository fault tolerance related to fault tolerance compilation labels Nov 11, 2025
@mtreinish mtreinish moved this from Ready to Blocked in Qiskit 2.3 Nov 11, 2025
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.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19277206289

Details

  • 306 of 353 (86.69%) changed or added relevant lines in 2 files are covered.
  • 120 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.1%) to 88.088%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/quantum_info/src/clifford.rs 0 21 0.0%
crates/transpiler/src/passes/litinski_transformation.rs 306 332 92.17%
Files with Coverage Reduction New Missed Lines %
crates/transpiler/src/passes/litinski_transformation.rs 1 92.06%
crates/circuit/src/parameter/symbol_expr.rs 5 72.98%
crates/qasm2/src/lex.rs 6 91.77%
crates/quantum_info/src/clifford.rs 108 30.5%
Totals Coverage Status
Change from base Build 19258642560: -0.1%
Covered Lines: 94351
Relevant Lines: 107110

💛 - Coveralls

@mtreinish mtreinish modified the milestones: 2.3.0, 2.4.0 Dec 4, 2025
@github-project-automation github-project-automation bot moved this to Ready in Qiskit 2.4 Dec 4, 2025
@mtreinish mtreinish removed this from Qiskit 2.3 Dec 4, 2025
@mtreinish mtreinish moved this from Ready to In development in Qiskit 2.4 Dec 4, 2025
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

Projects

Status: In development

Development

Successfully merging this pull request may close these issues.

2 participants