plot_accumulated_error¶
- plot_accumulated_error(metadata, axes)[source]¶
Plot the accumulated error.
This method populates the provided figure axes with a line-plot of the
OBPMetadata.accumulated_error()
. Below is an example where we plot somemetadata
which exists within our context.>>> from matplotlib import pyplot as plt >>> from qiskit_addon_obp.utils.visualization import plot_accumulated_error >>> fig, axes = plt.subplots(1, 1) >>> plot_accumulated_error(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 accumulated error due to truncated Pauli terms is displayed along the y-axis. If
OBPMetadata.truncation_error_budget.max_error_total
is notnumpy.inf
, it is displayed as a red horizontal line. Each observable that was backpropagated, gets its own line.This data is related to the one visualized by
plot_slice_errors()
. This method plots 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.