Skip to main content
IBM Quantum Platform
This page is from a dev version of Qiskit Runtime client. This is a new interface that does not exist in the stable version.

Executor

class Executor(mode, *, options=None)

GitHub

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 IBMBackend if you are using job mode.
    • A Session if you are using session execution mode.
    • A Batch if you are using batch execution mode.

    Refer to the Qiskit Runtime documentation for more information about the Execution modes.

  • options (ExecutorOptions | dict | None) – Executor options, see ExecutorOptions for detailed description. This can be an ExecutorOptions instance or a dictionary that will be used to construct one.

Raises

  • TypeError – If options is not a valid type.
  • ValueError – If local mode is used.

Attributes

options

The options of this executor.


Methods

run

run(program)

GitHub

Run a quantum program.

Parameters

program (QuantumProgram) – The program to run.

Returns

A job.

Return type

RuntimeJobV2

Was this page helpful?
Report a bug, typo, or request content on GitHub.