Skip to content
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

Fix CommutationChecker for 2q Pauli rotations #13762

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Jan 30, 2025

Summary

Fixes #13742.

Details and comments

Fix a bug CommutationChecker for [2q Pauli rotations, a gate that is not in the cache], such as [RXX, U]. The issue was that the parameters of the Pauli rotations were set to [] because we assumed we can find the relation in the cache. However that's obviously not true, as there are gates that are neither rotations, nor in the cache.

@Cryoris Cryoris added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Jan 30, 2025
@Cryoris Cryoris added this to the 1.4.0 milestone Jan 30, 2025
@Cryoris Cryoris requested a review from a team as a code owner January 30, 2025 14:58
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Jan 30, 2025

Pull Request Test Coverage Report for Build 13115566069

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • 293 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.1%) to 88.814%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/sparse_observable.rs 3 94.33%
crates/qasm2/src/lex.rs 3 92.48%
crates/circuit/src/circuit_data.rs 3 94.94%
crates/qasm2/src/parse.rs 12 97.15%
crates/circuit/src/interner.rs 131 42.74%
crates/circuit/src/dag_circuit.rs 141 89.38%
Totals Coverage Status
Change from base Build 13053673557: -0.1%
Covered Lines: 79759
Relevant Lines: 89805

💛 - Coveralls

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I just left a small comment in the test.

test/python/circuit/test_commutation_checker.py Outdated Show resolved Hide resolved
@1ucian0 1ucian0 assigned 1ucian0 and ElePT and unassigned 1ucian0 Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when Executing CommutativeInverseCancellation Pass in Qiskit v1.3.2
5 participants