quimb.utils_plot

Attributes

Functions

default_to_neutral_style(fn)

Wrap a function or method to use the neutral style by default.

_ensure_dict(k, v)

plot(*args, **kwargs)

Wrapper around matplotlib.pyplot.plot to use the neutral style by

plot_multi_series_zoom(data[, zoom, zoom_max, ...])

Plot possibly multiple series of data, using the asinh scale for an

_progress_log_file(path)

Resolve path, which can be a log directory or the file itself, to

load_progress_log(path)

Load the progress data written by a running TEBD or simple update

plot_progress_log(path[, watch, interval])

Plot the progress of a TEBD or simple update evolution, which can still

Module Contents

quimb.utils_plot.NEUTRAL_STYLE
quimb.utils_plot.default_to_neutral_style(fn)[source]

Wrap a function or method to use the neutral style by default.

quimb.utils_plot._ensure_dict(k, v)[source]
quimb.utils_plot.plot(*args, **kwargs)[source]

Wrapper around matplotlib.pyplot.plot to use the neutral style by default (style=”neutral”) as well as showing and closing the plot by default (`show_and_close=True).

quimb.utils_plot.plot_multi_series_zoom(data, zoom='auto', zoom_max=100, zoom_marker='|', zoom_markersize=3, xlabel='Iteration', width=8, height=None, figsize=None, **kwargs)[source]

Plot possibly multiple series of data, using the asinh scale for an overview and a linear scale for a zoomed in final section.

Parameters:

data (dict[dict], dict[array], dict, array, optional) – The data to plot.

quimb.utils_plot._progress_log_file(path)[source]

Resolve path, which can be a log directory or the file itself, to the progress file.

quimb.utils_plot.load_progress_log(path)[source]

Load the progress data written by a running TEBD or simple update evolution, see quimb.tensor.tnag.tebd.TEBDSweepMixin.write_progress_log().

Parameters:

path (str or pathlib.Path) – Either the log directory the run was given, or the "progress.json" file within it.

Returns:

With keys "cls", "info", "time", "elapsed", "running" and "data", the last being the series to plot.

Return type:

dict

quimb.utils_plot.plot_progress_log(path, watch=False, interval=1.0, **kwargs)[source]

Plot the progress of a TEBD or simple update evolution, which can still be running, possibly in another process.

Parameters:
  • path (str or pathlib.Path) – Either the log directory the run was given, or the "progress.json" file within it.

  • watch (bool, optional) – Whether to keep reloading and redrawing until the run reports that it has finished. Only redraws when the file has actually been rewritten. Intended for use in a notebook.

  • interval (float, optional) – How many seconds to wait between checks when watching.

  • kwargs – Supplied to plot_multi_series_zoom().

Returns:

fig, axs

Return type:

matplotlib.Figure, tuple[matplotlib.Axes]