Skip to content

Allow transpile() to accept a Target as the backend positional argument#15954

Open
dmeliksetian wants to merge 1 commit intoQiskit:mainfrom
dmeliksetian:issue15066
Open

Allow transpile() to accept a Target as the backend positional argument#15954
dmeliksetian wants to merge 1 commit intoQiskit:mainfrom
dmeliksetian:issue15066

Conversation

@dmeliksetian
Copy link
Copy Markdown
Contributor

Closes #15066

Summary

Allow transpile() to accept a Target instance as the second positional argument (the backend parameter), consistent with the existing behaviour of generate_preset_pass_manager().

Details and comments

When a Target is passed in the backend position, it is silently rerouted to the target keyword argument. A TypeError is raised if a Target is passed positionally and target= is also specified as a keyword argument.

A release note has been added under releasenotes/notes/.

Mirrors the existing behaviour of generate_preset_pass_manager(), which
already supports passing a Target as the first positional argument.
When a Target is detected in the backend position, it is silently
rerouted to the target keyword argument. A TypeError is raised if both
are specified simultaneously.

Closes Qiskit#15066

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dmeliksetian dmeliksetian requested a review from a team as a code owner April 6, 2026 14:13
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Apr 6, 2026
@qiskit-bot
Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Make transpile accept a Target as the backend argument

2 participants