bosing.generate_waveforms

bosing.generate_waveforms(channels, shapes, schedule, *, time_tolerance=Ellipsis, amp_tolerance=Ellipsis, allow_oversize=False, crosstalk=None)

Generate waveforms from a schedule.

小心

Crosstalk matrix will not be applied to offset of the channels.

参数:
  • channels (Mapping[str, Channel]) -- Information of the channels.

  • shapes (Mapping[str, Shape]) -- Shapes used in the schedule.

  • schedule (Element) -- Root element of the schedule.

  • time_tolerance (float) -- Tolerance for time comparison. Default is 1e-12.

  • amp_tolerance (float) -- Tolerance for amplitude comparison. Default is 0.1 / 2**16.

  • allow_oversize (bool) -- Allow elements to occupy a longer duration than available. Default is False.

  • crosstalk (tuple[array_like, Sequence[str]] | None) -- Crosstalk matrix with corresponding channel ids. Default is None.

返回:

Waveforms of the channels. The key is the

channel name and the value is the waveform. The shape of the waveform is (n, length), where n is 2 for complex waveform and 1 for real waveform.

返回类型:

dict[str, numpy.ndarray]

抛出:

示例

from bosing import Barrier, Channel, Hann, Play, Stack, generate_waveforms
channels = {"xy": Channel(30e6, 2e9, 1000)}
shapes = {"hann": Hann()}
schedule = Stack(duration=500e-9).with_children(
    Play(
        channel_id="xy",
        shape_id="hann",
        amplitude=0.3,
        width=100e-9,
        plateau=200e-9,
    ),
    Barrier(duration=10e-9),
)
result = generate_waveforms(channels, shapes, schedule)