qiskit-documentation/docs/api/qiskit-ibm-runtime/0.34/transpiler-passes-schedulin...

152 lines
5.7 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 (v0.34)
description: API reference for qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay in qiskit-ibm-runtime v0.34
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay
---
# PadDelay
<Class id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.34/qiskit_ibm_runtime/transpiler/passes/scheduling/pad_delay.py#L26-L97" signature="PadDelay(*args, **kwargs)" modifiers="class">
Bases: [`BlockBasePadder`](transpiler-passes-scheduling-block-base-padder "qiskit_ibm_runtime.transpiler.passes.scheduling.block_base_padder.BlockBasePadder")
Padding idle time with Delay instructions.
Consecutive delays will be merged in the output of this pass.
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 [`BlockBasePadder`](transpiler-passes-scheduling-block-base-padder "qiskit_ibm_runtime.transpiler.passes.scheduling.BlockBasePadder") pass for details.
Create new padding delay pass.
**Parameters**
* **durations** Durations of instructions to be used in scheduling.
* **fill\_very\_end** Set `True` to fill the end of circuit with delay.
* **schedule\_idle\_qubits** Set to true if youd 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
<Attribute id="qiskit_ibm_runtime.transpiler.passes.scheduling.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_ibm_runtime.transpiler.passes.scheduling.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>
## Methods
### \_\_call\_\_
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay.__call__" signature="__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.
**Returns**
If on transformation pass, the resulting QuantumCircuit. If analysis pass, the input circuit.
**Return type**
QuantumCircuit
</Function>
### execute
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay.execute" signature="execute(passmanager_ir, state, callback=None)">
Execute optimization task for input Qiskit IR.
**Parameters**
* **passmanager\_ir** (*Any*) Qiskit IR to optimize.
* **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.3)")) 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*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.3)")]
</Function>
### name
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay.name" signature="name()">
Name of the pass.
**Return type**
str
</Function>
### run
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay.run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.34/qiskit_ibm_runtime/transpiler/passes/scheduling/block_base_padder.py#L102-L126" signature="run(dag)">
Run the padding pass on `dag`.
**Parameters**
**dag** ([*DAGCircuit*](/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v1.3)")) 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.
</Function>
### update\_status
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDelay.update_status" signature="update_status(state, run_state)">
Update workflow status.
**Parameters**
* **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.3)")) Pass manager state to update.
* **run\_state** (*RunState*) Completion status of current task.
**Returns**
Updated pass manager state.
**Return type**
[*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.3)")
</Function>
</Class>