pygsti.report.direct_deviation_boxplot¶
-
pygsti.report.
direct_deviation_boxplot
(xvals, yvals, xy_gatestring_dict, dataset, gateset, directGatesets, xlabel='', ylabel='', m=None, M=None, scale=1.0, prec='compact', title='Direct Deviation', boxLabels=True, histogram=False, histBins=50, save_to=None, ticSize=20)¶ Create a box plot showing the difference in max-fidelity-with-unitary between gateset’s estimate for each base gate string and the Direct-X estimate.
Creates a color box plot whose box at position (x,y) shows the the difference between:
- the upper bound of the fidelity between the map corresponding to this base gate string using the Direct-X estimate of this map (i.e. by using only data relevant to this particular string) and a unitary map.
- the upper bound of the fidelity between the map corresponding to this base gate string using gateset (i.e. by multiplying together single gate estimates) and a unitary map.
The plotted quantity indicates how much more “unitary”, i.e. how much less “depolarized”, the map corresponding to each base gate sequence is when considering only the data immediately relevant to predicting that map. Large absolute values indicate that the data used for fitting other gate sequences has made the estimate for the subject gate sequence more depolarized (~worse) than the data for the sequence alone would suggest.
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.
- xy_gatestring_dict (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.
- dataset (DataSet) – The data used to specify frequencies and counts
- directGatesets (dict) – Dictionary with keys == gate strings and values == GateSets. directGatesets[sigma] must be a GateSet which contains an estimate of sigma stored under the gate label “GsigmaLbl”.
- 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)
- boxLabels (bool, optional) – Whether box labels are displayed. It takes much longer to generate the figure when this is set to True.
- histogram (bool, optional) – Whether a histogram of the matrix element values or summed matrix values (depending on sumUp) should also be computed and displayed.
- histBins (int, optional) – The number of bins to use in the histogram.
- save_to (str, optional) – save figure to this filename (usually ending in .pdf)
- ticSize (int, optional) – size of tic marks
Returns: rptFig – The encapsulated matplotlib figure that was generated. Extra figure info is a dict with keys:
- nUsedXs : int
The number of used X-values, proportional to the overall final figure width
- nUsedYs : int
The number of used Y-values, proportional to the overall final figure height
Return type: ReportFigure