Skip to main content
IBM Quantum Platform
翻訳情報

このページの追加言語翻訳は近日公開予定です。

Executor

class Executor(mode=None, options=None)

GitHub

Bases: object

Class for running QuantumProgram\s.

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 (BackendV2 | Session |Batch | None) –

    The execution mode used to make the query. It can be:

    • A BackendV2 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 IBM Quantum Compute documentation for more information about the Execution modes.

  • options (ExecutorOptions) – 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.


Attributes

mode

Return the execution mode used by this primitive.

Returns

Mode used by this primitive, or None if an execution mode is not used.

options

Type: ExecutorOptions

The options of this executor.


Methods

backend

backend()

GitHub

Return the backend the primitive query will be run on.

Return type

BackendV2

run

run(program, dry_run=False)

GitHub

Run a quantum program.

Parameters

  • program (QuantumProgram) – The program to run.
  • dry_run (bool) – If True, performs a dry run without executing the job on a QPU. This mode can be used to validate the job, estimate usage consumption, and retrieve circuit timing metadata. Returned results preserve the expected schema but contain randomized mock data rather than actual or simulated measurement results. Unlike the fake backends, the processing of this dry run happens on the server-side, so the job may not finish immediately and access to this feature may be restricted.

Returns

A job.

Return type

RuntimeJobV2 | LocalRuntimeJob

このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。