{"id":6217,"library":"qiskit-ibm-runtime","title":"IBM Qiskit Runtime Client","description":"Qiskit IBM Runtime is the official client library for interacting with the IBM Quantum Platform's Qiskit Runtime service. It streamlines quantum computations by providing optimized implementations of Qiskit primitives (Sampler and Estimator) for IBM Quantum hardware, leveraging classical computing resources for tasks like error suppression and mitigation. The library is currently at version 0.46.1 and requires Python >=3.10.","status":"active","version":"0.46.1","language":"en","source_language":"en","source_url":"https://github.com/Qiskit/qiskit-ibm-runtime","tags":["quantum","qiskit","ibm","runtime","cloud"],"install":[{"cmd":"pip install qiskit-ibm-runtime","lang":"bash","label":"Install qiskit-ibm-runtime"}],"dependencies":[{"reason":"Core Qiskit SDK, required for building quantum circuits and operators. qiskit-ibm-runtime v0.41.0 and later are compatible with Qiskit 2.0.","package":"qiskit"},{"reason":"Recommended for interactive development in notebooks.","package":"jupyter","optional":true},{"reason":"Commonly used for visualizing results, especially histograms.","package":"matplotlib","optional":true}],"imports":[{"symbol":"QiskitRuntimeService","correct":"from qiskit_ibm_runtime import QiskitRuntimeService"},{"symbol":"SamplerV2","correct":"from qiskit_ibm_runtime import SamplerV2"},{"symbol":"EstimatorV2","correct":"from qiskit_ibm_runtime import EstimatorV2"},{"symbol":"Session","correct":"from qiskit_ibm_runtime import Session"},{"note":"The original V1 `Sampler` is deprecated/removed. Use `SamplerV2` and alias it if desired for easier migration.","wrong":"from qiskit_ibm_runtime import Sampler","symbol":"Sampler","correct":"from qiskit_ibm_runtime import SamplerV2 as Sampler"},{"note":"The original V1 `Estimator` is deprecated/removed. Use `EstimatorV2` and alias it if desired for easier migration.","wrong":"from qiskit_ibm_runtime import Estimator","symbol":"Estimator","correct":"from qiskit_ibm_runtime import EstimatorV2 as Estimator"},{"note":"The `Options` class is not used by V2 primitives and should generally be removed for V2 workflows.","wrong":"from qiskit_ibm_runtime import Options","symbol":"Options","correct":"from qiskit_ibm_runtime.options import Options"},{"note":"Fake backends were migrated from `qiskit.providers.fake_provider` to `qiskit_ibm_runtime.fake_provider` in Qiskit 1.0.","wrong":"from qiskit.providers.fake_provider import FakeSherbrooke","symbol":"fake_provider","correct":"from qiskit_ibm_runtime.fake_provider import FakeSherbrooke"}],"quickstart":{"code":"import os\nfrom qiskit import QuantumCircuit\nfrom qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler, Session\n\n# Set your IBM Quantum Platform API token and instance CRN as environment variables\n# Or save them locally with QiskitRuntimeService.save_account(token=\"YOUR_API_TOKEN\", instance=\"YOUR_CRN\")\n# API token: From your IBM Quantum Platform account page (https://quantum.ibm.com/account)\n# CRN: From the Instances page on the IBM Quantum Platform (e.g., ibm-q/open/main)\n\n# Initialize the service (ensure API token and instance are set via env vars or saved)\nservice = QiskitRuntimeService(channel=\"ibm_quantum_platform\")\n\n# Get a least busy backend that supports Sampler\nbackend = service.least_busy(simulator=False, min_num_qubits=2, max_credits=10)\nprint(f\"Using backend: {backend.name}\")\n\n# Create a simple Bell state circuit\nqc = QuantumCircuit(2)\nqc.h(0)\nqc.cx(0, 1)\nqc.measure_all()\n\n# Define the input for Sampler (a PUB: Primitive Unified Bloc)\npubs = [(qc,)] # A single circuit to run\n\n# Run the circuit using SamplerV2 within a session\nwith Session(service=service, backend=backend) as session:\n    sampler = Sampler()\n    job = sampler.run(pubs=pubs)\n    print(f\"Job ID: {job.job_id}\")\n    result = job.result()\n\n    # Get the quasi-probability distribution result for the first PUB\n    quasi_dists = result[0].data.meas.get_counts()\n    print(f\"Quasi-probability distribution: {quasi_dists}\")","lang":"python","description":"This quickstart guides you through authenticating with the IBM Quantum Platform, creating a simple Bell state quantum circuit, and executing it on a real quantum backend using the `SamplerV2` primitive within a session. It emphasizes setting up credentials via environment variables for security and finding a suitable backend."},"warnings":[{"fix":"Replace `from qiskit_ibm_runtime import Sampler` with `from qiskit_ibm_runtime import SamplerV2 as Sampler`. Similarly for `Estimator`. Remove usage of the `Options` class, as V2 primitives manage options differently. Refer to the official migration guide.","message":"Qiskit Runtime V1 primitives (`Sampler`, `Estimator`, and the `Options` class) are deprecated and have been removed. All code should migrate to use the V2 interfaces (`SamplerV2`, `EstimatorV2`).","severity":"breaking","affected_versions":">=0.21.0 (deprecated), >=0.23.0 (removed support on Aug 15, 2024)"},{"fix":"When initializing `QiskitRuntimeService`, explicitly set `channel=\"ibm_cloud\"` or `channel=\"ibm_quantum_platform\"` if you were previously using `ibm_quantum`. If no channel is specified, `ibm_quantum_platform` is used by default.","message":"The `ibm_quantum` channel option for `QiskitRuntimeService` is no longer supported due to the sunset of IBM Quantum Platform Classic. The only valid channels are `ibm_cloud` and `ibm_quantum_platform` (which is the new default).","severity":"breaking","affected_versions":">=0.41.0"},{"fix":"Update import statements from `from qiskit.providers.fake_provider import ...` to `from qiskit_ibm_runtime.fake_provider import ...`.","message":"The `fake_provider` module, which provides fake backends for testing, has been migrated from `qiskit.providers.fake_provider` to `qiskit_ibm_runtime.fake_provider`.","severity":"breaking","affected_versions":"Qiskit 1.0.0 and qiskit-ibm-runtime >=0.17.1"},{"fix":"Avoid using `QiskitRuntimeService.delete_job()`. Manage jobs via the IBM Quantum Platform dashboard directly.","message":"The `QiskitRuntimeService.delete_job()` method is deprecated and not supported on the new IBM Quantum Platform.","severity":"deprecated","affected_versions":">=0.24.0"},{"fix":"Always execute primitives within a `with Session(...) as session:` block to leverage session benefits like prioritized execution and reduced latency for iterative tasks.","message":"Initializing a primitive (Sampler/Estimator) outside of a `Session` or `Batch` context manager will result in jobs running in 'job mode'. This means subsequent jobs will not be prioritized, and iterative calls will incur queuing delays.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure circuits are transpiled to the target backend's ISA using `qiskit.transpile()` before submitting them to the runtime primitives. The Composer on the IBM Quantum Platform can handle this automatically.","message":"As of March 2024, Qiskit Runtime primitives only accept Instruction Set Architecture (ISA) circuits and observables. Non-ISA inputs must be transpiled before submission.","severity":"gotcha","affected_versions":">=0.30.0 (and associated service changes)"},{"fix":"The client library has implemented measures to suppress frequent websocket errors. For critical or long-running jobs, consider implementing robust error handling and retry mechanisms in your application code, especially when reading result objects. Update to `qiskit-ibm-runtime >=0.24.0` for improved resilience.","message":"Connections to the Qiskit Runtime service can be disrupted, leading to `WebsocketError` when retrieving results, potentially causing loss of computation for long-running jobs.","severity":"gotcha","affected_versions":"Affected in <0.24.0, improved in later versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}