PadDelay¶
- class PadDelay(*args, **kwargs)[source]¶
Bases:
BlockBasePadderPadding idle time with Delay instructions.
Consecutive delays will be merged in the output of this pass.
The ASAP-scheduled circuit output may become
┌────────────────┐ q_0: ┤ Delay(160[dt]) ├──■── └─────┬───┬──────┘┌─┴─┐ q_1: ──────┤ X ├───────┤ X ├ └───┘ └───┘Note that the additional idle time of 60dt on the
q_0wire coming from the duration difference betweenDelayof 100dt (q_0) andXGateof 160 dt (q_1) is absorbed in the delay instruction on theq_0wire, i.e. in total 160 dt.See
BlockBasePadderpass for details.Create new padding delay pass.
- Parameters:
durations – Durations of instructions to be used in scheduling.
fill_very_end – Set
Trueto fill the end of circuit with delay.schedule_idle_qubits – Set to true if you’d like a delay inserted on idle qubits. This is useful for timeline visualizations, but may cause issues for execution on large backends.
block_ordering_callable – A callable used to produce an ordering of the nodes to minimize the number of blocks needed. If not provided,
block_order_op_nodes()will be used.
Attributes
- is_analysis_pass¶
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.
- is_transformation_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).
Methods
- __call__(circuit, property_set=None)¶
Runs the pass on circuit.
- Parameters:
circuit (QuantumCircuit) – The dag on which the pass is run.
property_set (PropertySet | dict | None) – Input/output property set. An analysis pass might change the property set in-place. If not given, the existing
property_setattribute of the pass will be used (if set).
- Returns:
If on transformation pass, the resulting QuantumCircuit. If analysis pass, the input circuit.
- Return type:
QuantumCircuit
- execute(passmanager_ir, state, callback=None)¶
Execute optimization task for input Qiskit IR.
- Parameters:
passmanager_ir (Any) – Qiskit IR to optimize.
state (PassManagerState) – State associated with workflow execution by the pass manager itself.
callback (Callable | None) – A callback function which is caller per execution of optimization task.
- Returns:
Optimized Qiskit IR and state of the workflow.
- Return type:
tuple[Any, PassManagerState]
- name()¶
Name of the pass.
- Return type:
str
- run(dag)[source]¶
Run the padding pass on
dag.- Parameters:
dag (DAGCircuit) – DAG to be checked.
- Returns:
DAG with idle time filled with instructions.
- Return type:
DAGCircuit
- Raises:
TranspilerError – When a particular node is not scheduled, likely some transform pass is inserted before this node is called.
- update_status(state, run_state)¶
Update workflow status.
- Parameters:
state (PassManagerState) – Pass manager state to update.
run_state (RunState) – Completion status of current task.
- Returns:
Updated pass manager state.
- Return type: