class BlockBasePadder[source]#

The base class of padding pass.

This pass requires one of scheduling passes to be executed before itself. Since there are multiple scheduling strategies, the selection of scheduling pass is left in the hands of the pass manager designer. Once a scheduling analysis pass is run, node_start_time is generated in the property_set. This information is represented by a python dictionary of the expected instruction execution times keyed on the node instances. The padding pass expects all DAGOpNode in the circuit to be scheduled.

This base class doesn’t define any sequence to interleave, but it manages the location where the sequence is inserted, and provides a set of information necessary to construct the proper sequence. Thus, a subclass of this pass just needs to implement _pad() method, in which the subclass constructs a circuit block to insert. This mechanism removes lots of boilerplate logic to manage whole DAG circuits.

Note that padding pass subclasses should define interleaving sequences satisfying:

  • Interleaved sequence does not change start time of other nodes

  • Interleaved sequence should have total duration of the provided time_interval.

Any manipulation violating these constraints may prevent this base pass from correctly tracking the start time of each instruction, which may result in violation of hardware alignment constraints.



Check if the pass is an analysis pass.


Check if the pass is a transformation pass.


BlockBasePadder.__call__(circuit[, property_set])

Runs the pass on circuit.

Return the name of the pass.

Run the padding pass on dag.

BlockBasePadder.__call__(circuit[, property_set])

Runs the pass on circuit.