ibm.qdmi.executor

Optional IBM Executor programs over the native QDMI transport.

Classes

ExecutorJob

An Executor job with native QDMI lifecycle and IBM result decoding.

Executor

Run QuantumProgram objects through an IBM QDMI backend.

ExecutorPrimitiveJob

A Qiskit primitive job backed by a native Executor job.

ExecutorSampler

IBM Runtime Sampler with client-side processing and native QDMI execution.

ExecutorEstimator

IBM Runtime Estimator with client-side processing and native QDMI execution.

Module Contents

class ExecutorJob(job: Job)

An Executor job with native QDMI lifecycle and IBM result decoding.

Parameters:

job – A native job submitted or retrieved through Executor.

job_id() → str

Return the remote job identifier.

status() → Status

Query the current QDMI job status.

Returns:

The native QDMI status.

cancel() → None

Cancel the remote job through QDMI.

result(timeout: int = 0) → QuantumProgramResult | PrimitiveResult

Wait and decode results without flattening experiment dimensions.

Parameters:

timeout – Wait limit in seconds; zero waits indefinitely.

Returns:

IBM’s decoded result, including samplex correction metadata.

Raises:
  • TimeoutError – The wait limit expired. The remote job remains active.

  • RuntimeError – The device did not supply Executor results.

class Executor(backend: IBMBackend, *, options: qiskit_ibm_runtime.options_models.executor.ExecutorOptions | None = None)

Run QuantumProgram objects through an IBM QDMI backend.

Circuits must already target the selected device. Execution uses independent jobs, without IBM Runtime session or batch contexts. The optional Runtime dependency supplies the v2.0 encoder and result decoder.

Parameters:
  • backend – An open IBM QDMI backend.

  • options – IBM Executor options. Nondefault environment settings are unsupported. The native execution cap is 60 seconds.

options
run(program: QuantumProgram) → ExecutorJob

Encode and submit one nonempty program through the native device.

Returns:

A job that preserves the complete Executor result.

retrieve_job(job_id: str) → ExecutorJob

Open an existing Executor job on this backend.

Returns:

A job with the same lifecycle and decoding as a new submission.

class ExecutorPrimitiveJob(job: ExecutorJob)

Bases: qiskit.primitives.BasePrimitiveJob[qiskit.primitives.PrimitiveResult, mqt.core.qdmi.Job.Status]

A Qiskit primitive job backed by a native Executor job.

result(timeout: int | None = None) → PrimitiveResult

Wait up to timeout seconds and return the decoded primitive result.

Parameters:

timeout – Wait limit in seconds. None or zero waits indefinitely.

Returns:

The decoded Qiskit primitive result.

Raises:

TypeError – Runtime did not decode the result as a primitive result.

status() → Status

Return the native QDMI job status.

done() → bool

Return whether the job completed successfully.

running() → bool

Return whether the job is running.

cancelled() → bool

Return whether the job was canceled.

in_final_state() → bool

Return whether the job has finished.

cancel() → None

Cancel the remote job through QDMI.

class ExecutorSampler(backend: IBMBackend, *, options: qiskit_ibm_runtime.options_models.sampler.SamplerOptions | dict[str, object] | None = None)

Bases: qiskit.primitives.base.BaseSamplerV2

IBM Runtime Sampler with client-side processing and native QDMI execution.

options
run(pubs: Iterable[qiskit.primitives.containers.sampler_pub.SamplerPubLike], *, shots: int | None = None) → ExecutorPrimitiveJob

Submit compiled Sampler inputs, with a default shot count for each input.

Returns:

The submitted primitive job.

class ExecutorEstimator(backend: IBMBackend, *, options: qiskit_ibm_runtime.options_models.estimator.EstimatorOptions | dict[str, object] | None = None)

Bases: qiskit.primitives.base.BaseEstimatorV2

IBM Runtime Estimator with client-side processing and native QDMI execution.

options
run(pubs: Iterable[qiskit.primitives.containers.estimator_pub.EstimatorPubLike], *, precision: float | None = None) → ExecutorPrimitiveJob

Submit compiled Estimator inputs, with a default precision for each input.

Returns:

The submitted primitive job.