pygsti.report.generate_zoomed_boxplot

pygsti.report.generate_zoomed_boxplot(xvals, yvals, xyGateStringDict, subMxCreationFn, strs, xlabel='', ylabel='', m=None, M=None, scale=1.0, prec=0, title='sub-mx', save_to=None, ticSize=14)

Creates an interactive view of one (x,y) matrix of nested box plot data.

Given lists of x and y values, a dictionary to convert (x,y) pairs into gate strings, and a function to convert a “base” gate string into a matrix of floating point values, this function computes (x,y) => matrix data and interactively displays a single (x,y) matrix as a color box plot. The user can change x and y interactively to display the color box plots corresponding to different (x,y) pairs.

Parameters:
  • yvals (xvals,) – List of x and y values. Elements can be any hashable quantity, and will be converted into x and y tic labels. Tuples of strings are converted specially for nice latex rendering of gate strings.
  • xyGateStringDict (dict) – Dictionary with keys == (x_value,y_value) tuples and values == gate strings, where a gate string can either be a GateString object or a tuple of gate labels. Provides the mapping between x,y pairs and gate strings. None values are allowed, and indicate that there is not data for that x,y pair and nothing should be plotted.
  • subMxCreationFn (function) – A function that takes a singe gate string parameter and returns a matrix of values to display. If the function is passed None instead of a gate string, the function should return an appropriately sized matrix of NaNs to indicate these elements should not be displayed.
  • strs (2-tuple) – A (rhoStrs,EStrs) tuple usually generated by calling get_spam_strs(...)
  • ylabel (xlabel,) – X and Y axis labels
  • M (m,) – Min and max values of the color scale.
  • scale (float, optional) – Scaling factor to adjust the size of the final figure.
  • prec (int, optional) – Precision for box labels. Allowed values are: ‘compact’ = round to nearest whole number using at most 3 characters ‘compacthp’ = show as much precision as possible using at most 3 characters int >= 0 = fixed precision given by int int < 0 = number of significant figures given by -int
  • title (string, optional) – Plot title (latex can be used)
  • save_to (str, optional) – save figure to this filename (usually ending in .pdf)
  • ticSize (int, optional) – size of tic marks
Returns:

Return type:

None