Fixed and dynamic repetition rate execution
Fixed repetition rate execution
Most IBM® quantum processing units (QPUs) execute circuits at a fixed rate. Although this repetition rate varies by QPU, the underlying execution model is the same, and is described here. First, consider three circuits sent to a QPU using separate jobs, one for each circuit. The example below shows what happens for jobs of varying lengths. Because of the fixed repetition rate, there is a variable amount of idle time that occurs before the start of a circuit in order to make the entire duration match that given by the QPU repetition rate.
![Idle time versus job length With fixed-rate execution, shorter jobs result in longer idle time.](/_next/image?url=%2Fimages%2Fguides%2Ffixed_single_circuit1.png&w=3840&q=75)
The situation changes somewhat when the same circuits are batched into a single job. In this case the circuits included in the job are executed by iterating over the circuits for each shot requested; the execution is column-wise over a matrix of circuits and shots (see below).
![Column-wise execution matrix The first column represents shot 0. The circuits are run in order from 0 through 3. The second column represents shot 1. The circuits are run in order from 0 through 3. The remaining columns follow the same pattern.](/_next/image?url=%2Fimages%2Fguides%2Fcircuits_shots_matrix1.png&w=3840&q=75)
Matrix of four circuits in a job showing the execution pattern over the circuits.
When submitting batches of circuits to QPUs, the circuits are executed differently than they would be if executed separately. Namely, the initialization of the circuit, that is, prepare the ground state, and measurements (if any) are aligned over all circuits.
![The image shows three circuits. Although they are different lengths, they take the same amount of time to complete because they were submitted in a batch.](/_next/image?url=%2Fimages%2Fguides%2Ffixed_batch_circuit1.png&w=3840&q=75)
Therefore, each circuit is equal in duration to the longest circuit in the batch, and there is a common idle time that is placed in front of all circuits to match the repetition rate.
Dynamic repetition rate execution
Some IBM QPUs allow for dynamic repetition rate execution. These QPUs are identified in Qiskit using backend.configuration().dynamic_reprate_enabled
, and return a value of True
. On these QPUs, it is possible to manually set the above idle time by setting the rep_delay
of the submitted job. One can see from the above figures that by reducing the idle time one can potentially see a greater throughput of circuits on the QPUs that support dynamic repetition rates.
Specify rep_delay for a primitive job
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler
service = QiskitRuntimeService()
# Make sure your backend supports it
backend = service.least_busy(operational=True, min_num_qubits=100, dynamic_reprate_enabled=True)
# Determine the allowable range
backend.rep_delay_range
sampler = Sampler(mode=backend)
#Specify a value in the supported range
sampler.options.execution.rep_delay = 0.0005
Next steps
- Try an example in the Quantum approximate optimization algorithm (QAOA) tutorial.
- Review how to get started with primitives.