qiskit-documentation/docs/api/qiskit/0.26/qiskit.pulse.builder.pad.mdx

43 lines
1.3 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: pad
description: API reference for qiskit.pulse.builder.pad
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.pulse.builder.pad
---
# qiskit.pulse.builder.pad
<Function id="qiskit.pulse.builder.pad" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/pulse/builder.py" signature="pad(*chs)">
Pad all available timeslots with delays upon exiting context.
**Parameters**
**chs** ([`Channel`](qiskit.pulse.channels#channel "qiskit.pulse.channels.Channel")) Channels to pad with delays. Defaults to all channels in context if none are supplied.
Examples:
```python
from qiskit import pulse
d0 = pulse.DriveChannel(0)
d1 = pulse.DriveChannel(1)
with pulse.build() as pulse_prog:
with pulse.pad():
with pulse.align_right():
# this pulse will start at t=0
pulse.play(pulse.Constant(100, 1.0), d0)
# this pulse will start at t=80
# a delay will be inserted from t=0 to t=80
pulse.play(pulse.Constant(20, 1.0), d1)
assert pulse_prog.ch_start_time(d0) == pulse_prog.ch_start_time(d1)
assert pulse_prog.ch_stop_time(d0) == pulse_prog.ch_stop_time(d1)
```
**Return type**
`AbstractContextManager`\[`None`]
</Function>