Directed execution model (beta)
All components in the directed execution model are currently in beta and might not be stable. You are invited to test them and provide feedback by opening an issue in the Samplomatic or Qiskit Runtime GitHub repositories.
The Sampler and Estimator primitive interfaces provide a higher-level abstraction for algorithm developers to focus more on innovation and less on data conversion. However, they are less suitable for quantum information scientists, who require more control and flexibility for their utility-scale experiments. The directed execution model, currently in beta release, addresses this need. This execution model provides the ingredients to capture design intents on the client side, and shifts the costly generation of circuit variants to the server side, so that you can fine-tune error mitigation and other techniques without sacrificing performance. This explicit and composable model makes it easier to experiment with new techniques, reproduce results, and share methods.
In its beta release, the directed execution model focuses on giving you control over techniques that are built into the existing Sampler and Estimator, including Pauli twirling, noise model learning and injection, and basis changes. Support for other capabilities will be added gradually over time.
Workflow
One main goal of the directed execution model is to provide a modular way to apply error mitigation methods. For example, you can define which layers in the circuit to mitigate, or adjust the noise rates being injected into the circuit.
To apply error mitigation to a circuit under the framework, your workflow will typically involve the following steps (the tools mentioned here are described more fully in the next section):
-
Group instructions into boxes and apply annotations to them. The annotations capture the intended transformation without actually generating the circuit variants.
-
Learn the noise models of the unique layers, if needed, using the new NoiseLearnerV3.
-
Build the template circuit and samplex from the boxed circuit.
-
Run the template circuit and samplex with the Executor primitive, which will generate and execute the circuit variants as instructed.
-
Post-process execution results. For example, you can apply post-selection, or extrapolate mitigated expectation values from the execution results.
Tools for the directed execution model
The following tools can be used together to implement an error mitigation technique in the directed execution model.
Samplomatic
Samplomatic is a new open-source library that supports customized sampling randomizations. It uses the box construct to reason about collections of circuit operations that should be treated as having a stable noise context, and uses annotations on boxes to allow you to declare and configure intents. For example, you can stratify your circuit into boxes, add a twirling annotation to each box, and specify which twirling group to use, as shown in the following figure:

A circuit with annotated boxes can then be used to generate a template circuit and a samplex. The output template circuit is a parameterized circuit that will be executed without further alteration (other than having different parameter values assigned to it). The samplex, which is the core type of the Samplomatic library, represents a parametric probability distribution over the parameters of the template circuit and other array-valued fields. These fields can be used to post-process data collected from executing the bound template circuit. In other words, the template circuit and samplex pair tells the Executor primitive (described below) exactly what parameters to generate and what bound circuits to run. Because these two constructs are created on the client side, you can do local inspection and sampling to verify the outputs prior to sending it for hardware execution.
To simplify the process of generating annotated boxes, the Samplomatic library also provides transpiler passes that automatically group circuit instructions into annotated boxes, based on the strategies you provide.
To learn more about Samplomatic, visit the guides and API reference documentation. Feel free to submit feedback and report bugs in its GitHub repository.
Executor primitive
Executor is a new Qiskit Runtime primitive that takes the template circuit and samplex pair as the input, generates and binds parameter values according to the samplex, executes the bound circuits on the hardware, and returns the execution results and metadata. It follows the directives of the input pair and does not make any implicit decisions for you, so that the process is transparent yet performant.
To access Executor, install the executor_preview branch from qiskit-ibm-runtime:
pip install -U git+https://github.com/Qiskit/qiskit-ibm-runtime.git@executor_previewThe inputs and output of the Executor primitive are very different from those of Sampler and Estimator. Refer to the Executor API reference for more information. In addition, the Executor quickstart guide provides an overview and code examples.
NoiseLearnerV3
Similar to the current NoiseLearner, this Qiskit Runtime helper program returns the sparse Pauli-Lindblad noise model that is used in many error mitigation methods, including PEC, PEA, and PNA. In the original NoiseLearner, you pass in a list of circuits, and the program stratifies the circuits into layers and returns the noise model for each unique layer. NoiseLearnerV3, on the other hand, gives you control over how to stratify your circuits, and the program simply takes a list of boxed circuit instructions (for example, unique layers) as the inputs.
NoiseLearnerV3 also supports measurement noise learning. For each instruction set in the input list, it runs the Pauli-Lindblad learning protocol if the set contains one- and two-qubit gates, and the TREX protocol if the set contains measurements.
To access NoiseLearnerV3, install the executor_preview branch from qiskit-ibm-runtime:
pip install -U git+https://github.com/Qiskit/qiskit-ibm-runtime.git@executor_previewTo learn more about NoiseLearnerV3, refer to its API reference documentation.
Next steps
- Check out two Qiskit addons, Shaded lightcones and Propagated noise absorption, which are built on top of this execution model.