- Fundamentals
- Also: IBM Qiskit Runtime
Qiskit Runtime
IBM's cloud execution environment that runs quantum-classical workloads near the quantum hardware, providing optimized primitives for sampling and expectation value estimation.
Qiskit Runtime is IBM’s execution model for running quantum programs on IBM Quantum hardware. Rather than sending individual circuits from a user’s laptop to the quantum processor and waiting for results, Qiskit Runtime moves the quantum-classical computation loop closer to the hardware, reducing latency and enabling more efficient execution of iterative algorithms. It exposes two core abstractions called “primitives” (Sampler and Estimator) that handle common quantum computation patterns, and it supports sessions that maintain dedicated access to a quantum processor across multiple circuit submissions.
The latency problem
Variational quantum algorithms like VQE and QAOA follow an iterative pattern:
- Run a parameterized quantum circuit
- Measure the results
- Use a classical optimizer to update the circuit parameters
- Repeat
Without Runtime, each iteration requires a round trip between the user’s machine and the quantum hardware. If the quantum processor is in a cloud data center, each round trip adds network latency (typically 100ms to several seconds). For an algorithm requiring thousands of iterations, this overhead dominates the total execution time.
Qiskit Runtime solves this by executing the entire iterative loop on a classical computer co-located with the quantum processor. The user submits the full program (circuit template, optimizer, convergence criteria) once, and the iterative loop runs locally with microsecond-scale latency between the classical and quantum components.
Primitives
Qiskit Runtime provides two primitive interfaces that abstract common quantum computation tasks:
Sampler
The Sampler primitive executes quantum circuits and returns quasi-probability distributions over the measurement outcomes. It handles:
- Circuit transpilation and optimization for the target hardware
- Error mitigation (readout error correction, twirling)
- Batching of multiple circuits for efficient execution
- Returning calibrated probability distributions rather than raw shot counts
Example use case: running a quantum circuit and obtaining the probability of each bitstring outcome.
Estimator
The Estimator primitive computes expectation values of observables with respect to quantum states prepared by circuits. Given a circuit and an observable , it returns . The Estimator handles:
- Decomposing the observable into Pauli strings
- Running the necessary measurement circuits (one for each non-commuting group of Pauli terms)
- Aggregating results and applying error mitigation
- Returning the expectation value with an error estimate
Example use case: computing the energy expectation value of a molecular Hamiltonian in a VQE calculation.
Sessions and execution modes
Qiskit Runtime supports several execution modes:
- Job mode: Submit a single primitive call. Suitable for one-off circuit execution.
- Session mode (deprecated in favor of batch): Reserve a quantum processor for a series of related jobs. The processor remains allocated between jobs, minimizing queuing delays for iterative algorithms.
- Batch mode: Submit a collection of independent jobs that are executed together. The system optimizes scheduling across the batch.
Sessions were particularly important for variational algorithms because they ensured that the calibration state of the processor remained consistent across all iterations of the algorithm.
Error mitigation in Runtime
Qiskit Runtime integrates several error mitigation techniques:
- Twirled readout error extinction (TREX): Mitigates measurement errors by randomizing the measurement basis and correcting systematically.
- Zero-noise extrapolation (ZNE): Runs circuits at multiple noise levels and extrapolates to the zero-noise limit.
- Probabilistic error cancellation (PEC): Uses a noise model to construct an unbiased estimator of the noiseless expectation value, at the cost of increased sampling overhead.
Users select a “resilience level” (0 through 2) that controls which mitigation techniques are applied, trading accuracy for computational cost.
Code example
A minimal example using the Estimator primitive to compute an expectation value:
from qiskit.circuit import QuantumCircuit, Parameter
from qiskit.quantum_info import SparsePauliOp
from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2
# Connect to IBM Quantum
service = QiskitRuntimeService()
backend = service.least_busy(operational=True)
# Build a parameterized circuit
theta = Parameter('θ')
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.ry(theta, 0)
# Define an observable
observable = SparsePauliOp.from_list([("ZZ", 1.0), ("XI", 0.5)])
# Run the Estimator
estimator = EstimatorV2(backend)
bound_circuit = qc.assign_parameters({theta: 0.4})
job = estimator.run([(bound_circuit, observable)])
result = job.result()
print(f"Expectation value: {result[0].data.evs}")
Why it matters for learners
Qiskit Runtime represents the practical software infrastructure needed to run useful quantum algorithms on real hardware. Understanding Runtime is essential for anyone moving beyond textbook quantum circuits to actual quantum computation. The primitive abstraction (Sampler and Estimator) also reflects a conceptual shift: instead of thinking about quantum computing as “run a circuit, get bitstrings,” Runtime encourages thinking about the computational task (sampling a distribution, estimating an expectation value) and letting the system handle the implementation details including error mitigation.