plot_slice_errors¶
- plot_slice_errors(metadata, axes)[source]¶
Plot the slice errors.
This method populates the provided figure axes with a bar-plot of the truncation error incurred 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_slice_errors >>> fig, axes = plt.subplots(1, 1) >>> plot_slice_errors(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 truncation error incurred at each backpropagation step is displayed along the y-axis. Since each observable is treated individually, they are plotted separately.
This data is related to the one visualized by
plot_accumulated_error()
. That method will plot the cumulative sum of the slice errors along the x-axis.- Parameters:
metadata (OBPMetadata) – the metadata to be visualized.
axes (Axes) – the matplotlib axes in which to plot.