Module Qiskit.IBMRuntime

IBM quantum cloud access through qiskit-ibm-runtime, the supported package for qiskit >= 1.0.

Real hardware only accepts primitives, so circuits must be transpiled for the backend and run through a IBMRuntime.sampler:

  let serv = IBMRuntime.service ~token:"TOKEN" () in
  let backend = IBMRuntime.least_busy serv in
  let j = IBMRuntime.sampler backend |> IBMRuntime.run (transpile qc backend) in
  j |> result |> IBMRuntime.get_counts |> Visualization.plot_histogram

Passing an Aer backend (e.g. aer_simulator) to IBMRuntime.sampler runs the circuit locally instead.

type qsampler = Py.Object.t

A SamplerV2 primitive bound to a backend.

val qruntime : Py.Object.t lazy_t
val service : ?token:string -> unit -> Provider.qprovider

service () connects to the IBM quantum platform using the saved account, or with ~token if given.

val save_account : ?instance:string -> ?overwrite:bool -> string -> unit

save_account token saves the IBM quantum platform account credentials on disk; ~instance selects a specific cloud instance (CRN) and ~overwrite replaces previously saved credentials.

val get_backend : string -> Provider.qprovider -> Provider.backend

get_backend n serv returns the backend named n.

val backends : Provider.qprovider -> Provider.backend list

backends serv returns the available backends.

least_busy serv returns the least busy operational backend.

val sampler : Provider.backend -> qsampler

sampler b creates a SamplerV2 primitive running on backend b.

val run : qcircuit -> qsampler -> qjob

run qc s submits the circuit to the sampler; qc must be transpiled for the sampler backend (see transpile).

val job_status : qjob -> string

job_status j returns the job status as a string.

val get_counts : qres -> qcounts

get_counts r returns the counts of the first pub result, with all classical registers joined.