-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Deprecate execute() #7892
Deprecate execute() #7892
Conversation
Pull Request Test Coverage Report for Build 2096868340
💛 - Coveralls |
I don't understand the future direction of Primitives enough to know whether the analogy with Django holds, but if the pattern of "transpile & run" without additional options will continue to be common, then I think there is value in having a convenience function for it. |
I very much agree with convenient ways of doing things. The problem with this particular function is that it goes against the direction of Qiskit runtimes and primitives. The recently added Sampler should basically provide the same thing for users who want to execute circuits (plus more since you can also do some error mitigation on probability distributions). |
from qiskit import transpile | ||
new_circuit = transpile(circuit) | ||
job = backend.run(new_circuit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from qiskit import transpile | |
new_circuit = transpile(circuit) | |
job = backend.run(new_circuit) | |
from qiskit import transpile | |
new_circuit = transpile(circuit, backend) | |
job = backend.run(new_circuit) |
As this PR stands currently, the deprecation warning suggests migrating to |
I rewrote this PR in #11044 |
Closing in favor of #11044 |
Summary
The execute() function has been around for a while but it is more of a script rather than part of the SDK.
Originally it was a replacement for 3 steps: transpile, assemble, run. Now it is a substitute for just two steps (transpile and run), so the convenience is diluted. It has also not kept up with recent transpile or run options (e.g. #7640).
A proper high-level interface is being developed as part of Qiskit Primitives, which allows for much richer tasks such as calculation of expectation values and error mitigation.
In this commit I'm just adding a
PendingDeprecationWarning
to start to migrate user behavior.