qiskit/releasenotes/notes/1.0/remove-execute-699e9aca1662...

30 lines
1.0 KiB
YAML

---
upgrade_misc:
- |
Qiskit's :func:`~.execute_function.execute` function is removed.
This function served as a high-level wrapper around transpiling
a circuit with some transpile options and running it on a backend
with some run options. To do the same thing, you can explicitly
use the :func:`~.transpile` function (with appropriate transpile
options) followed by ``backend.run()`` (with appropriate run options).
For example, instead of running::
from qiskit import execute
job = execute(circuit, backend)
you can run::
from qiskit import transpile
new_circuit = transpile(circuit, backend)
job = backend.run(new_circuit)
Alternatively, the ``Sampler`` primitive is semantically equivalent to the
deprecated :func:`~.execute_function.execute` function. The class
:class:`.BackendSampler` is a generic wrapper for backends that do not support
primitives::
from qiskit.primitives import BackendSampler
sampler = BackendSampler(backend)
job = sampler.run(circuit)