qsttoolkit.plots Submodule

Functions to produce standard formatted plots for QSTToolkit data and results.

qsttoolkit.plots.plot_Hinton(density_matrix: Qobj, ax: axes = None, label: str = None, colorbar: bool = True, label_fontsize: float = 15, axes_fontsize: float = 14, tick_fontsize: float = 12) axes[source]

Plots the Hinton diagram of the density matrix.

Parameters:
  • density_matrix (Qobj) – Density matrix to be plotted.

  • ax (plt.axes) – Axes object to plot on. If None, a new figure is created.

  • label (str) – Label for the plot. Defaults to None.

  • colorbar (bool) – Whether to include a colorbar. Defaults to True.

  • label_fontsize (float) – Fontsize of the title. Defaults to 15.

  • axes_fontsize (float) – Fontsize of the axes labels. Defaults to 14.

  • tick_fontsize (float) – Fontsize of the tick labels. Defaults to 12.

Returns:

Axes object containing the plot.

Return type:

plt.axes

qsttoolkit.plots.plot_Husimi_Q(density_matrix: Qobj, xgrid: ndarray = None, ygrid: ndarray = None, fig: figure = None, ax: axes = None, cmap: str = 'hot', label: str = None, colorbar: bool = True, label_fontsize: float = 15, axes_fontsize: float = 14, tick_fontsize: float = 12) axes[source]

Plots a heatmap of the Husimi Q function of the state described by the density matrix.

Parameters:
  • density_matrix (Qobj) – Density matrix to be plotted.

  • xgrid (np.ndarray) – Grid for the real part of the coherent state parameter. Defaults to np.linspace(-5, 5, 100).

  • ygrid (np.ndarray) – Grid for the imaginary part of the coherent state parameter. Defaults to np.linspace(-5, 5, 100).

  • fig (plt.figure) – Figure object to plot on. If None, a new figure is created.

  • ax (plt.axes) – Axes object to plot on. If None, a new figure is created.

  • cmap (str) – Colormap to use. Defaults to ‘hot’.

  • label (str) – Label for the plot. Defaults to None.

  • colorbar (bool) – Whether to include a colorbar. Defaults to True.

  • label_fontsize (float) – Fontsize of the title. Defaults to 15.

  • axes_fontsize (float) – Fontsize of the axes labels. Defaults to 14.

  • tick_fontsize (float) – Fontsize of the tick labels. Defaults to 12.

Returns:

Axes object containing the plot.

Return type:

plt.axes

qsttoolkit.plots.plot_Wigner(density_matrix: Qobj, xgrid: ndarray = None, ygrid: ndarray = None, fig: figure = None, ax: axes = None, cmap: str = 'hot', label: str = None, colorbar: bool = True, label_fontsize: float = 15, axes_fontsize: float = 14, tick_fontsize: float = 12) axes[source]

Plots a heatmap of the Wigner function of the state described by the density matrix.

Parameters:
  • density_matrix (Qobj) – Density matrix to be plotted.

  • xgrid (np.ndarray) – Grid for the real part of the coherent state parameter. Defaults to np.linspace(-5, 5, 100).

  • ygrid (np.ndarray) – Grid for the imaginary part of the coherent state parameter. Defaults to np.linspace(-5, 5, 100).

  • fig (plt.figure) – Figure object to plot on. If None, a new figure is created.

  • ax (plt.axes) – Axes object to plot on. If None, a new figure is created.

  • cmap (str) – Colormap to use. Defaults to ‘hot’.

  • label (str) – Label for the plot. Defaults to None.

  • colorbar (bool) – Whether to include a colorbar. Defaults to True.

  • label_fontsize (float) – Fontsize of the title. Defaults to 15.

  • axes_fontsize (float) – Fontsize of the axes labels. Defaults to 14.

  • tick_fontsize (float) – Fontsize of the tick labels. Defaults to 12.

Returns:

Axes object containing the plot.

Return type:

plt.axes

qsttoolkit.plots.plot_hinton(density_matrix: Qobj, ax: axes = None, label: str = None) axes[source]

Deprecated alias for plot_Hinton. Plots a Hinton diagram of the density matrix.

qsttoolkit.plots.plot_occupations(density_matrix: Qobj, Nc: int, ax: axes = None, label: str = None, color='#68246D', label_fontsize: float = 15, axes_fontsize: float = 14, tick_fontsize: float = 12) axes[source]

Plots the photon number occupation probabilities for a given density matrix.

Parameters:
  • density_matrix (Qobj) – Density matrix to be plotted.

  • Nc (int) – Hilbert space cutoff.

  • ax (plt.axes) – Axes object to plot on. If None, a new figure is created.

  • label (str) – Label for the plot. Defaults to None.

  • color (str) – Color of the bars. Defaults to ‘#68246D’ (Palatinate purple).

  • label_fontsize (float) – Fontsize of the title. Defaults to 15.

  • axes_fontsize (float) – Fontsize of the axes labels. Defaults to 14.

  • tick_fontsize (float) – Fontsize of the tick labels. Defaults to 12.

Returns:

Axes object containing the plot.

Return type:

plt.axes