Executor
class Executor(mode, *, options=None)
Bases: object
Class for running QuantumPrograms.
The run() method can be used to submit a quantum program to be executed on a backend.
from qiskit_ibm_runtime import QiskitRuntimeService, Executor, QuantumProgram
service = QiskitRuntimeService()
backend = service.backend("ibm_boston")
program = QuantumProgram(shots=100)
... # add program contents
executor = Executor(backend)
executor.options.environment.job_tags = ["my_tag"]
job = executor.run(program)Parameters
-
mode (IBMBackend |Session |Batch | None) –
The execution mode used to make the query. It can be:
- A
IBMBackendif you are using job mode. - A
Sessionif you are using session execution mode. - A
Batchif you are using batch execution mode.
Refer to the Qiskit Runtime documentation for more information about the
Execution modes. - A
-
options (ExecutorOptions | dict | None) – Executor options, see
ExecutorOptionsfor detailed description. This can be anExecutorOptionsinstance or a dictionary that will be used to construct one.
Raises
- TypeError – If
optionsis not a valid type. - ValueError – If local mode is used.
Attributes
options
The options of this executor.
Methods
run
run(program)
Run a quantum program.
Parameters
program (QuantumProgram) – The program to run.
Returns
A job.
Return type
Was this page helpful?
Report a bug, typo, or request content on GitHub.