About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
qiskit.pulse.builder.frequency_offset
frequency_offset(frequency, *channels, compensate_phase=False)
Shift the frequency of inputs channels on entry into context and undo on exit.
Examples:
from qiskit import pulse
d0 = pulse.DriveChannel(0)
with pulse.build(backend) as pulse_prog:
# shift frequency by 1GHz
with pulse.frequency_offset(1e9, d0):
pulse.play(pulse.Constant(10, 1.0), d0)
assert len(pulse_prog.instructions) == 3
with pulse.build(backend) as pulse_prog:
# Shift frequency by 1GHz.
# Undo accumulated phase in the shifted frequency frame
# when exiting the context.
with pulse.frequency_offset(1e9, d0, compensate_phase=True):
pulse.play(pulse.Constant(10, 1.0), d0)
assert len(pulse_prog.instructions) == 4
Parameters
- frequency (
float
) – Amount of frequency offset in Hz. - channels (
PulseChannel
) – Channels to offset frequency of. - compensate_phase (
bool
) – Compensate for accumulated phase accumulated with respect to the channels’ frame at its initial frequency.
Yields
None
Return type
AbstractContextManager
[None
]
Was this page helpful?
Report a bug or request content on GitHub.