plot_sum_paulis

plot_sum_paulis(metadata, axes)[source]

Plot the total number of all Pauli terms.

This method populates the provided figure axes with a line-plot of the total number of all 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_sum_paulis
>>> fig, axes = plt.subplots(1, 1)
>>> plot_sum_paulis(metadata, axes)
../_images/qiskit_addon_obp-utils-visualization-plot_sum_paulis-2_00.png

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

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

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

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

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

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

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

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

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

../_images/qiskit_addon_obp-utils-visualization-plot_sum_paulis-2_05.png

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

../_images/qiskit_addon_obp-utils-visualization-plot_sum_paulis-2_06.png

Fig. 23 (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 total number of all Pauli terms at each backpropagation step is displayed along the y-axis. If OBPMetadata.operator_budget.max_paulis is not None, it is displayed as a red horizontal line.

This data can give you additional insight into how many unique Pauli terms are spread across all of the backpropagated observables. See also the output of plot_num_paulis() for the number of Pauli terms in each observable individually.

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

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