- class qiskit.transpiler.passes.ConstrainedReschedule(*args, **kwargs)#
Rescheduler pass that updates node start times to conform to the hardware alignments.
This pass shifts DAG node start times previously scheduled with one of the scheduling passes, e.g.
ALAPScheduleAnalysis, so that every instruction start time satisfies alignment constraints.
We assume executing the following circuit on a backend with 16 dt of acquire alignment.
┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(100[dt]) ├┤M├ └───┘└────────────────┘└╥┘ c: 1/════════════════════════╩═ 0
Note that delay of 100 dt induces a misalignment of 4 dt at the measurement. This pass appends an extra 12 dt time shift to the input circuit.
┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(112[dt]) ├┤M├ └───┘└────────────────┘└╥┘ c: 1/════════════════════════╩═ 0
Your backend may execute circuits violating these alignment constraints. However, you may obtain erroneous measurement result because of the untracked phase originating in the instruction misalignment.
Create new rescheduler pass.
The alignment values depend on the control electronics of your quantum processor.
acquire_alignment – Integer number representing the minimum time resolution to trigger acquisition instruction in units of
pulse_alignment – Integer number representing the minimum time resolution to trigger gate instruction in units of
Check if the pass is an analysis pass.
If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.
Check if the pass is a transformation pass.
If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).
Return the name of the pass.
This pass should perform rescheduling to satisfy:
All DAGOpNode nodes (except for compiler directives) are placed at start time satisfying hardware alignment constraints.
The end time of a node does not overlap with the start time of successor nodes.
Topological order and absolute time order of DAGOpNode are consistent.
All bits in either qargs or cargs associated with node synchronously start.
Start time of qargs and cargs may different due to I/O latency.
Based on the configurations above, the rescheduler pass takes the following strategy:
- The nodes are processed in the topological order, from the beginning of
the circuit (i.e. from left to right). For every node (including compiler directives), the function
_push_node_backperforms steps 2 and 3.
- If the start time of the node violates the alignment constraint,
the start time is increased to satisfy the constraint.
- Each immediate successor whose start_time overlaps the node’s end_time is
pushed backwards (towards the end of the wire). Note that at this point the shifted successor does not need to satisfy the constraints, but this will be taken care of when that successor node itself is processed.
- After every node is processed, all misalignment constraints will be resolved,
and there will be no overlap between the nodes.