forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix basis_gates and coupling_map backend override in transpile() (Qis…
…kit#9789) This commit fixes an issue in the transpile() function when a user specified the `backend` argument with a BackendV2 based backend along with `basis_gates` or `coupling_map`. In this case the `transpile()` was generating the preset pass manager with a target, coupling map, and basis gates list. However, most individual passes that take basis gates and a Target will prefer to use the target if both are specified. This is generally sane behavior at the pass level because the target contains more rich data and tighter constraints that a transpiler pass will need to worry about. To fix this limitation this commit updates transpile() to not use the backend's target if either basis_gates or coupling_map are specified. Longer term this should no longer be an issue when Qiskit#9256 is implemented and we'll be relying solely on a target internally. But this fix is needed until Qiskit#9256 is started. Fixes Qiskit#9781 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
648da26
commit bf3bb96
Showing
2 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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