pygsti.report.gate_matrix_boxplot

pygsti.report.gate_matrix_boxplot(gateMatrix, size=None, m=-1.0, M=1.0, save_to=None, fontSize=20, mxBasis=None, mxBasisDims=None, xlabel=None, ylabel=None, title=None, boxLabels=False, prec=0, mxBasisDimsY=None)

Creates a color box plot of a gate matrix using a diverging color map.

This can be a useful way to display large matrices which have so many entries that their entries cannot easily fit within the width of a page.

Parameters:
  • gateMatrix (ndarray) – The gate matrix data to display.
  • size (tuple, optional) – The (width,height) figure size in inches. None enables automatic calculation based on gateMatrix size.
  • M (m,) – Min and max values of the color scale.
  • save_to (str, optional) – save figure as this filename (usually ending in .pdf)
  • fontSize (int, optional) – size of font for title
  • mxBasis (str, optional) – The name abbreviation for the basis. Typically in {“pp”,”gm”,”std”}. Used to label the rows & columns. If you don’t want labels, leave as None.
  • mxBasisDims (int or list, optional) – The dimension of the density matrix space this basis spans, or a list specifying the dimensions of terms in a direct-sum decomposition of the density matrix space. Used to label the rows & columns. If you don’t want labels, leave as None.
  • xlabel (str, optional) – An x-axis label for the plot.
  • ylabel (str, optional) – A y-axis label for the plot.
  • title (str, optional) – A title for the plot.
  • boxLabels (bool, optional) – Whether box labels are displayed. If False, then a colorbar is displayed to the right of the box plot.
  • prec (int or {‘compact’,’compacthp’}, optional) –

    Precision for box labels. Only relevant when boxLabels == True. 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
  • mxBasisDimsY (int or list, optional) – Specifies the dimension of the basis along the Y-axis direction if and when this is different from the X-axis direction. If the two are the same, this parameter can be set to None.
Returns:

Return type:

ReportFigure