qiskit-documentation/docs/api/qiskit/0.43/qiskit.transpiler.passes.Pa...

101 lines
3.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: PadDelay
description: API reference for qiskit.transpiler.passes.PadDelay
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.passes.PadDelay
---
# PadDelay
<Class id="qiskit.transpiler.passes.PadDelay" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/transpiler/passes/scheduling/padding/pad_delay.py" signature="PadDelay(*args, **kwargs)" modifiers="class">
Bases: `BasePadding`
Padding idle time with Delay instructions.
Consecutive delays will be merged in the output of this pass.
```python
durations = InstructionDurations([("x", None, 160), ("cx", None, 800)])
qc = QuantumCircuit(2)
qc.delay(100, 0)
qc.x(1)
qc.cx(0, 1)
```
The ASAP-scheduled circuit output may become
```python
┌────────────────┐
q_0: ┤ Delay(160[dt]) ├──■──
└─────┬───┬──────┘┌─┴─┐
q_1: ──────┤ X ├───────┤ X ├
└───┘ └───┘
```
Note that the additional idle time of 60dt on the `q_0` wire coming from the duration difference between `Delay` of 100dt (`q_0`) and `XGate` of 160 dt (`q_1`) is absorbed in the delay instruction on the `q_0` wire, i.e. in total 160 dt.
See `BasePadding` pass for details.
Create new padding delay pass.
**Parameters**
* **fill\_very\_end** Set `True` to fill the end of circuit with delay.
* **target** The [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") representing the target backend. If it supplied and it does not support delay instruction on a qubit, padding passes do not pad any idle time of the qubit.
## Methods
<span id="qiskit-transpiler-passes-paddelay-name" />
### name
<Function id="qiskit.transpiler.passes.PadDelay.name" signature="PadDelay.name()">
Return the name of the pass.
</Function>
<span id="qiskit-transpiler-passes-paddelay-run" />
### run
<Function id="qiskit.transpiler.passes.PadDelay.run" signature="PadDelay.run(dag)">
Run the padding pass on `dag`.
**Parameters**
**dag** ([*DAGCircuit*](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.dagcircuit.DAGCircuit")) DAG to be checked.
**Returns**
DAG with idle time filled with instructions.
**Return type**
[DAGCircuit](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit")
**Raises**
[**TranspilerError**](qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") When a particular node is not scheduled, likely some transform pass is inserted before this node is called.
</Function>
## Attributes
### is\_analysis\_pass
<Attribute id="qiskit.transpiler.passes.PadDelay.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.
</Attribute>
### is\_transformation\_pass
<Attribute id="qiskit.transpiler.passes.PadDelay.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).
</Attribute>
</Class>