Use rust-native error for CommutativeOptimization - #16197
Open
raynelfss wants to merge 3 commits into
Open
Conversation
Collaborator
|
One or more of the following people are relevant to this code:
|
Coverage Report for CI Build 26459707076Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.002%) to 87.518%Details
Uncovered Changes
Coverage Regressions4 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
The following commits modify `RemoveIdentityEquiv` to use rust-native errors throughout its pipeline. In this PR we introduce the error enumeration `RemoveIdentityEquivEerror` which only has two variants, one for `DAGCircuitError` and the other is for a specific case involving `PauliEvolution` gates that only exist in Python currently. These changes mostly depend on Qiskit#16134.
The following commits modify `CommutationAnalysis` to use rust-native errors throughout its pipeline. This is done mostly by implementing `DAGCircuitInnerError` based on Qiskit#16134 as a possible error in `CommutationError`.
The following commits modify `CommutativeOptimization` to use rust-native errors throughout its pipeline. We implement the `CommutativeOptimizationError` enumeration which derives from `DAGCircuitError`, `RemoveIdentityEquivError`, and `CommutationError` as well as adding two new variants for python specific errors dealing with parameters and pauli evolution gates.
raynelfss
force-pushed
the
use-commutation-opt-error
branch
from
May 26, 2026 16:00
a729c5e to
2f72743
Compare
Cryoris
reviewed
May 27, 2026
Comment on lines
+58
to
+59
| #[error(transparent)] | ||
| DAGCircuit(#[from] DAGError), |
Contributor
There was a problem hiding this comment.
Why do we need this new variant?
| #[error(transparent)] | ||
| RemoveIdentityEq(#[from] RemoveIdentityEquivError), | ||
| #[error(transparent)] | ||
| CommutationAnalysis(#[from] CommutationError), |
Contributor
There was a problem hiding this comment.
I think the naming here can be confusing: CommutativeOptimization does not use the CommutationAnalysis pass or functionality there, but just calls the commutation checker. Could we change the variant name here to clarify this separation? E.g. just call this CommutationError or CommutationCheck or something?
12 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The following commits modify
CommutativeOptimizationto use rust-native errors throughout its pipeline.We implement the
CommutativeOptimizationErrorenumeration which derives fromDAGCircuitError,RemoveIdentityEquivError, andCommutationErroras well as adding two new variants for python specific errors dealing with parameters and pauli evolution gates.Pre-requisites
DAGCircuit#16134RemoveIdentityEquiv#16195CommutationAnalysis#16193AI/LLM disclosure