Fix: Skip UnitaryGate instances during BasisTranslator#15916
Open
raynelfss wants to merge 3 commits intoQiskit:mainfrom
Open
Fix: Skip UnitaryGate instances during BasisTranslator#15916raynelfss wants to merge 3 commits intoQiskit:mainfrom
BasisTranslator#15916raynelfss wants to merge 3 commits intoQiskit:mainfrom
Conversation
…slator`. - A well known bug introduced by Qiskit#14659 in which the `AerSimulator` is known to define `UnitaryGate` as part of its target basis. However, `BasisTranslator` should not include `UnitaryGate` as part of its calculations, it should instead be handled by `UnitarySynthesis`. - To fix this, `BasisTranslator` skips any `UnitaryGate` in the circuit by filtering its `op_nodes` to check for any `UnitaryGate` instances. - The only question left is whether we should still have the panic condition in `name_to_packed_operation` because this check is done on a name basis rather than instance.
Collaborator
|
One or more of the following people are relevant to this code:
|
Contributor
Author
I'd like to bring this up again, in case it is a genuine concern. Since most of this fix might be superseded by #15684, we won't need to even go through Python in the future. |
BasisTraslatorBasisTranslator
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.
Summary
Fixes #15278
Fixes #15733
BasisTranslatorrust-native. #14659 in which theAerSimulatoris known to defineUnitaryGateas part of its target basis. However,BasisTranslatorshould not includeUnitaryGateas part of its calculations, it should instead be handled byUnitarySynthesis.BasisTranslatorskips anyUnitaryGatein the circuit by filtering itsop_nodesto check for anyUnitaryGateinstances.Details and comments
The only question left is whether we should still have the panic condition in
name_to_packed_operationbecause this check is done on a name basis rather than instance.