50 lines
1.5 KiB
Plaintext
50 lines
1.5 KiB
Plaintext
---
|
|
title: inline
|
|
description: API reference for qiskit.pulse.builder.inline
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: function
|
|
python_api_name: qiskit.pulse.builder.inline
|
|
---
|
|
|
|
<span id="qiskit-pulse-builder-inline" />
|
|
|
|
# qiskit.pulse.builder.inline
|
|
|
|
<Function id="qiskit.pulse.builder.inline" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.16/qiskit/pulse/builder.py" signature="inline()">
|
|
Inline all instructions within this context into the parent context, inheriting the scheduling policy of the parent context.
|
|
|
|
Examples:
|
|
|
|
```python
|
|
from qiskit import pulse
|
|
|
|
d0 = pulse.DriveChannel(0)
|
|
d1 = pulse.DriveChannel(1)
|
|
d2 = pulse.DriveChannel(2)
|
|
|
|
with pulse.build() as pulse_prog:
|
|
# will be ignored due to internal grouping
|
|
with pulse.align_left():
|
|
pulse.play(pulse.Constant(10, 1.0), d0)
|
|
with pulse.inline():
|
|
with pulse.align_right():
|
|
# this pulse will start at t=0
|
|
pulse.play(pulse.Constant(100, 1.0), d1)
|
|
# this pulse will also start at t=0
|
|
pulse.play(pulse.Constant(20, 1.0), d2)
|
|
|
|
assert (pulse_prog.ch_start_time(d0) ==
|
|
pulse_prog.ch_start_time(d1) ==
|
|
pulse_prog.ch_start_time(d2))
|
|
```
|
|
|
|
<Admonition title="Warning" type="caution">
|
|
This will cause all scheduling directives within this context to be ignored.
|
|
</Admonition>
|
|
|
|
**Return type**
|
|
|
|
`AbstractContextManager`\[`None`]
|
|
</Function>
|
|
|