plot_num_truncated_paulis

plot_num_truncated_paulis(metadata, axes)[source]

Plot the number of truncated Pauli terms.

This method populates the provided figure axes with a bar-plot of the number of the truncated Pauli terms at each backpropagated slice. Below is an example where we plot some metadata which exists within our context.

>>> from matplotlib import pyplot as plt
>>> from qiskit_addon_obp.utils.visualization import plot_num_truncated_paulis
>>> fig, axes = plt.subplots(1, 1)
>>> plot_num_truncated_paulis(metadata, axes)
../_images/qiskit_addon_obp-utils-visualization-plot_num_truncated_paulis-2_00.png

Fig. 12 (png, hires.png, pdf)

../_images/qiskit_addon_obp-utils-visualization-plot_num_truncated_paulis-2_01.png

Fig. 13 (png, hires.png, pdf)

../_images/qiskit_addon_obp-utils-visualization-plot_num_truncated_paulis-2_02.png

Fig. 14 (png, hires.png, pdf)

../_images/qiskit_addon_obp-utils-visualization-plot_num_truncated_paulis-2_03.png

Fig. 15 (png, hires.png, pdf)

../_images/qiskit_addon_obp-utils-visualization-plot_num_truncated_paulis-2_04.png

Fig. 16 (png, hires.png, pdf)

As you can see in the figure above, the number of backpropagated slices is displayed along the x-axis. You can think of this as the “time” of the backpropagation algorithm. The number of truncated Pauli terms at each backpropagation step is displayed along the y-axis. Since each observable is treated individually, they are plotted separately.

This data can give you additional insight as to how the accumulated error is split across multiple Pauli terms (see also the output of plot_accumulated_error()).

Parameters:
  • metadata (OBPMetadata) – the metadata to be visualized.

  • axes (Axes) – the matplotlib axes in which to plot.