pulse_scheme#

Module containing functions for drawing pulse schemes and circuit diagrams using matplotlib.

Module Contents#

Functions#

new_pulse_fig(→ tuple[matplotlib.figure.Figure | None, ...)

Open a new figure and configure it to plot pulse schemes.

new_pulse_subplot(→ matplotlib.axes.Axes)

Add a new subplot configured for plotting pulse schemes to a figure.

mw_pulse(→ float)

Draw a microwave pulse: Gaussian envelope with modulation.

flux_pulse(→ float)

Draw a smooth flux pulse, where the rising and falling edges are given by

ram_Z_pulse(→ float)

Draw a Ram-Z flux pulse, i.e. only part of the pulse is shaded, to indicate

interval(→ None)

Draw an arrow to indicate an interval.

meter(→ None)

Draws a measurement meter on the specified position.

box_text(→ None)

Draws a box filled with text at the specified position.

mwPulse(*args, **kwargs)

fluxPulse(*args, **kwargs)

ramZPulse(*args, **kwargs)

Attributes#

logger[source]#
new_pulse_fig(figsize: tuple[int, int] | None = None, ax: matplotlib.axes.Axes | None = None) tuple[matplotlib.figure.Figure | None, matplotlib.axes.Axes][source]#

Open a new figure and configure it to plot pulse schemes.

Parameters:
  • figsize – Size of the figure.

  • ax – Axis to use for plotting. If None, then creates a new one.

Returns:

Tuple of figure handle and axis handle.

new_pulse_subplot(fig: matplotlib.figure.Figure, *args, **kwargs) matplotlib.axes.Axes[source]#

Add a new subplot configured for plotting pulse schemes to a figure.

All *args and **kwargs are passed to fig.add_subplot.

Parameters:
  • fig – Figure to add the subplot to.

  • *args – Positional arguments to pass to fig.add_subplot.

  • **kwargs – Keyword arguments to pass to fig.add_subplot.

mw_pulse(ax: matplotlib.axes.Axes, pos: float, y_offs: float = 0.0, width: float = 1.5, amp: float = 1, label: str | None = None, phase: float = 0, label_height: float = 1.3, color: str = constants.COLOR_ORANGE, modulation: str = 'normal', **plot_kws) float[source]#

Draw a microwave pulse: Gaussian envelope with modulation.

Parameters:
  • ax – Axis to plot on.

  • pos – Position of the pulse.

  • y_offs – Vertical offset of the pulse.

  • width – Width of the pulse.

  • amp – Amplitude

  • label – Label to add to the pulse.

  • label_height – Height of the label.

  • color – Color of the pulse.

  • modulation – Modulation

flux_pulse(ax: matplotlib.axes.Axes, pos: float, y_offs: float = 0.0, width: float = 2.5, s: float = 0.1, amp: float = 1.5, label: str | None = None, label_height: float = 1.7, color: str = constants.COLOR_ORANGE, **plot_kws) float[source]#

Draw a smooth flux pulse, where the rising and falling edges are given by Fermi-Dirac functions.

Parameters:
  • ax – Axis to plot on.

  • pos – Position of the pulse.

  • y_offs – Vertical offset of the pulse.

  • width – Width of the pulse.

  • s – smoothness of edge

  • amp – Amplitude

  • label – Label to add to the pulse.

  • label_height – Height of the label.

  • color – Color of the pulse.

ram_Z_pulse(ax: matplotlib.axes.Axes, pos: float, y_offs: float = 0.0, width: float = 2.5, s: float = 0.1, amp: float = 1.5, sep: float = 1.5, color: str = constants.COLOR_ORANGE) float[source]#

Draw a Ram-Z flux pulse, i.e. only part of the pulse is shaded, to indicate cutting off the pulse at some time.

Parameters:
  • ax – Axis to plot on.

  • pos – Position of the pulse.

  • y_offs – Vertical offset of the pulse.

  • width – Width of the pulse.

  • s – smoothness of edge

  • amp – Amplitude

  • sep – Separation between pulses.

  • color – Color of the pulse.

interval(ax: matplotlib.axes.Axes, start: float, stop: float, y_offs: float = 0.0, height: float = 1.5, label: str | None = None, label_height: str | None = None, vlines: bool = True, color: str = 'k', arrowstyle: str = '<|-|>', **plot_kws) None[source]#

Draw an arrow to indicate an interval.

Parameters:
  • ax – Axis to plot on.

  • pos – Position of the pulse.

  • y_offs – Vertical offset of the pulse.

  • width – Width of the pulse.

  • s – smoothness of edge

  • amp – Amplitude

  • sep – Separation between pulses.

  • color – Color of the pulse.

  • arrow_style

meter(ax: matplotlib.axes.Axes, x0: float, y0: float, y_offs: float = 0.0, width: float = 1.1, height: float = 0.8, color: str = 'black', framewidth: float = 0.0, fillcolor: str | None = None) None[source]#

Draws a measurement meter on the specified position.

Parameters:
  • ax

  • x0

  • y0

  • y_offs

  • width

  • height

  • color

  • framewidth

  • fillcolor

box_text(ax: matplotlib.axes.Axes, x0: float, y0: float, text: str = '', width: float = 1.1, height: float = 0.8, color: str = 'black', fillcolor: str | None = None, textcolor: str = 'black', fontsize: int | None = None) None[source]#

Draws a box filled with text at the specified position.

Parameters:
  • ax

  • x0

  • y0

  • text

  • width

  • height

  • color

  • fillcolor

  • textcolor

  • fontsize

mwPulse(*args, **kwargs)[source]#
fluxPulse(*args, **kwargs)[source]#
ramZPulse(*args, **kwargs)[source]#