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 basis_gates and coupling_map backend override in transpile() (backport #9789) #9792

Merged
merged 1 commit into from
Mar 14, 2023

Commits on Mar 14, 2023

  1. Fix basis_gates and coupling_map backend override in transpile() (#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 #9256 is implemented
    and we'll be relying solely on a target internally. But this fix is
    needed until #9256 is started.
    
    Fixes #9781
    
    Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
    (cherry picked from commit bf3bb96)
    mtreinish authored and mergify[bot] committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    a43c61d View commit details
    Browse the repository at this point in the history