Repository navigation
Conversation
Following the [Qiskit 2.0 Migration Guide](https://quantum.cloud.ibm.com/docs/en/guides/qiskit-2.0) this package should now be compatible with all Qiskit 2.0 releases and run without issue. The changes include: - Removing basis gates from the pass manager config pipeline. - Filter `Barrier` by instance and `ControlFlow` instructions only if they're `IfElseOp` or `WhileLoop` as `condition` was removed. Improvements: - Remove unnecessary bit allocation by using `DAGCircuit.copy_empty_like()`.
mtreinish
reviewed
Sep 30, 2026
| # Apply the operation, check for condition | ||
| if getattr(current_node.op, "condition") is not None: | ||
| # Apply the operation, check for condition if control flow | ||
| if isinstance(current_node.op, (IfElseOp, WhileLoopOp)): |
Collaborator
There was a problem hiding this comment.
Is this pass valid with control flow in the circuit?
Collaborator
Author
There was a problem hiding this comment.
It is, although it won't re-organize the inner block of the operation. I think the only reason this is here is so that the condition is copied properly whenever it gets re-indexed. Because of how rough the pass is, it will re-index every operation.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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.
Following the Qiskit 2.0 Migration Guide this package should now be compatible with all Qiskit 2.0 releases and run without issue.
The changes include:
Barrierby instance andControlFlowinstructions only if they'reIfElseOporWhileLoopasconditionwas removed.Improvements:
DAGCircuit.copy_empty_like().