qiskit-documentation/docs/api/qiskit/0.26/qiskit.pulse.builder.phase_...

46 lines
1.2 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: phase_offset (v0.26)
description: API reference for qiskit.pulse.builder.phase_offset in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.pulse.builder.phase_offset
---
<span id="qiskit-pulse-builder-phase-offset" />
# qiskit.pulse.builder.phase\_offset
<Function id="qiskit.pulse.builder.phase_offset" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/pulse/builder.py" signature="phase_offset(phase, *channels)">
Shift the phase of input channels on entry into context and undo on exit.
Examples:
```python
import math
from qiskit import pulse
d0 = pulse.DriveChannel(0)
with pulse.build() as pulse_prog:
with pulse.phase_offset(math.pi, d0):
pulse.play(pulse.Constant(10, 1.0), d0)
assert len(pulse_prog.instructions) == 3
```
**Parameters**
* **phase** (`float`) Amount of phase offset in radians.
* **channels** ([`PulseChannel`](qiskit.pulse.channels#pulsechannel "qiskit.pulse.channels.PulseChannel")) Channels to offset phase of.
**Yields**
None
**Return type**
`AbstractContextManager`\[`None`]
</Function>