Get started with the Executor primitive
The Executor primitive is part of the directed execution model, which provides more flexibility when customizing your error mitigation workflow. See the Directed execution model guide for more information.
Steps to get started with Executor
There are three basic steps involved in using the Executor primitive:
- Initialize a
QuantumProgramwith your workload. - Run the
QuantumProgramon IBM® backends by using theExecutorprimitive. - Interpret the outputs.
See Executor examples for a full walkthrough.
Run an Executor job
The following code shows how to initialize an Executor with the default options. See Executor options to learn about the available options.
from qiskit_ibm_runtime import Executor
executor = Executor(backend)Next, use the run() method to submit the job.
job = executor.run(program)
# Retrieve the result
result = job.result()The result is of type QuantumProgramResult. See Executor input and output to learn about the result object.
Next steps
Recommendations
- Try some Executor examples.
- Understand Executor input and output.
- Learn about Executor broadcasting semantics.