bosing.Play

class bosing.Play(channel_id, shape_id, amplitude, width, *, plateau=Ellipsis, drag_coef=0.0, frequency=Ellipsis, phase=Ellipsis, flexible=False, margin=None, alignment=None, phantom=False, duration=None, max_duration=Ellipsis, min_duration=Ellipsis, label=None)

基类:Element

A pulse play element.

Given the pulse envelope \(E(t)\), channel total frequency \(f_c\), and channel phase \(\phi_c\), the the final pulse \(P(t)\) starts at \(t_0\) with sideband will be

\[ \begin{align}\begin{aligned}E_d(t) = \left( 1 + i \alpha \frac{d}{dt} \right) E(t)\\P(t) = E_d(t) \exp \big[ i 2 \pi (f_c t + f_p (t-t_0) + \phi_c + \phi_p) \big]\end{aligned}\end{align} \]

where \(\alpha\) is the drag_coef parameter, \(f_p\) is the frequency parameter, and \(\phi_p\) is the phase parameter. The derivative is calculated using the central difference method. An exceptional case is when the pulse is a rectangular pulse. In this case, the drag coefficient is ignored.

If flexible is set to True, the plateau parameter is ignored and the actual plateau length is determined by the duration of the element.

小心

The unit of phase is number of cycles, not radians. For example, a phase of \(0.5\) means a phase shift of \(\pi\) radians.

参数:
  • channel_id (str) -- Target channel ID.

  • shape_id (str | None) -- Shape ID of the pulse. If None, the pulse is a rectangular pulse.

  • amplitude (float) -- Amplitude of the pulse.

  • width (float) -- Width of the pulse.

  • plateau (float) -- Plateau length of the pulse. Defaults to 0.

  • drag_coef (float) -- Drag coefficient of the pulse. If the pulse is a rectangular pulse, the drag coefficient is ignored. Defaults to 0.

  • frequency (float) -- Additional frequency of the pulse on top of channel base frequency and frequency shift. Defaults to 0.

  • phase (float) -- Additional phase of the pulse in cycles. Defaults to 0.

  • flexible (bool) -- Whether the pulse has flexible plateau length. Defaults to False.

alignment
amplitude
channel_id
drag_coef
duration
flexible
frequency
label
margin
max_duration
measure()

Measure the minimum total duration required by the element.

This value includes both inner duration and outer margin of the element.

This value is a minimum total duration wanted by the element. If the element is a child of other element, the final total duration will be determined by alignment option and parent container type.

min_duration
phantom
phase
plateau
plot(ax=None, *, channels=None, max_depth=5, show_label=True)

Plot arrange result with the element as root.

参数:
  • ax (matplotlib.axes.Axes | None) -- Axes to plot. If None, matplotlib.pyplot.gca is used.

  • channels (Sequence[str] | None) -- Channels to plot. If None, all channels are plotted.

  • max_depth (int) -- Maximum depth to plot. Defaults to 5.

  • show_label (bool) -- Whether to show label of elements. Defaults to True.

返回:

Axes with the plot.

返回类型:

matplotlib.axes.Axes

shape_id
width