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)
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.