|
1 | 1 | ---
|
2 |
| -title: Fixed and dynamic repetition rate execution |
3 |
| -description: Explanatory content on fixed and dynamic repetition rate execution |
| 2 | +title: Dynamic repetition rate execution |
| 3 | +description: Explanatory content about dynamic repetition rate execution |
4 | 4 |
|
5 | 5 | ---
|
6 | 6 |
|
7 |
| -# Fixed and dynamic repetition rate execution |
| 7 | +# Dynamic repetition rate execution |
8 | 8 |
|
9 |
| -## Fixed repetition rate execution |
| 9 | +When a circuit is executed on an IBM® quantum processing unit (QPU), an implicit reset is typically inserted at the beginning of the circuit to ensure the qubits are initialized to zero. However, the reset process is not perfect, leading to state preparation errors. To alleviate the error, the system also inserts repetition delay time (or `rep_delay`) between circuits. Each backend has a different default `rep_delay`, but it's usually longer than T1 to allow the environment to reset the qubits. The default `rep_delay` can be queried by running `backend.default_rep_delay`. |
10 | 10 |
|
11 |
| -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. |
12 |
| - |
13 |
| - |
14 |
| - |
15 |
| -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). |
| 11 | +All IBM QPUs use dynamic repetition rate execution, which allows you to change the `rep_delay` for each job. Circuits you submit in a primitive job are batched together for execution on the QPU. These circuits are executed by iterating over the circuits for each shot requested; the execution is column-wise over a matrix of circuits and shots, as illustrated in the following figure. |
16 | 12 |
|
17 | 13 | 
|
18 | 14 |
|
19 |
| -Matrix of four circuits in a job showing the execution pattern over the circuits. |
20 |
| - |
21 |
| -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. |
22 | 15 |
|
23 |
| - |
| 16 | +Because `rep_delay` is inserted between circuits, each shot of the execution encounters this delay. Therefore, lowering the `rep_delay` decreases the total QPU execution time, but at the expense of increased state preparation error rate, as can be seen in the following image: |
24 | 17 |
|
25 |
| -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. |
| 18 | + |
26 | 19 |
|
27 |
| -## Dynamic repetition rate execution |
28 | 20 |
|
29 |
| -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. |
| 21 | +Note that while circuits in a primitive job are batched together for QPU execution, there is no guarantee on the order the circuits from PUBs are executed. Thus, even though you submit `pubs=[pub1, pub2]`, there is no guarantee the circuits from `pub1` will run before those from `pub2`. There is also no guarantee that circuits from the same job would run as a single batch on the QPU. |
30 | 22 |
|
31 | 23 | ## Specify rep_delay for a primitive job
|
32 | 24 |
|
|
0 commit comments