Skip to content

Add QubitSparsePauliList.commutes#16194

Open
joshuasn wants to merge 3 commits into
Qiskit:mainfrom
joshuasn:sparse-pauli-list-commutes
Open

Add QubitSparsePauliList.commutes#16194
joshuasn wants to merge 3 commits into
Qiskit:mainfrom
joshuasn:sparse-pauli-list-commutes

Conversation

@joshuasn
Copy link
Copy Markdown
Contributor

Summary

This PR adds QubitSparsePauliList.commutes that computes the commutation relations of the given sparse Pauli list with another, returning a (num_self_paulis, num_other_paulis) array of bools.

Details and comments

Useful for certain Pauli channel computations rather with a modest speedup over iterating through the lists with QubitSparsePauli.commutes (from 578ms to 239ms on 729 terms).

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code:

@joshuasn joshuasn requested a review from a team as a code owner May 16, 2026 00:47
@joshuasn joshuasn added the Changelog: Added Add an "Added" entry in the GitHub Release changelog. label May 16, 2026
@joshuasn joshuasn requested a review from alexanderivrii May 16, 2026 00:47
@joshuasn joshuasn added the mod: quantum info Related to the Quantum Info module (States & Operators) label May 16, 2026
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25948312118

Coverage decreased (-0.008%) to 87.702%

Details

  • Coverage decreased (-0.008%) from the base build.
  • Patch coverage: 21 of 21 lines across 1 file are fully covered (100%).
  • 15 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

15 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
crates/circuit/src/parameter/symbol_expr.rs 9 73.88%
crates/qasm2/src/lex.rs 5 92.29%
crates/transpiler/src/passes/unitary_synthesis/decomposers.rs 1 94.71%

Coverage Stats

Coverage Status
Relevant Lines: 123051
Covered Lines: 107918
Line Coverage: 87.7%
Coverage Strength: 954192.31 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Added Add an "Added" entry in the GitHub Release changelog. mod: quantum info Related to the Quantum Info module (States & Operators)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants