:py:mod:`pygsti.extras.idletomography.idtreport` ================================================ .. py:module:: pygsti.extras.idletomography.idtreport .. autoapi-nested-parse:: Idle Tomography reporting and plotting functions Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pygsti.extras.idletomography.idtreport.IdleTomographyObservedRatesTable pygsti.extras.idletomography.idtreport.IdleTomographyObservedRatesForIntrinsicRateTable pygsti.extras.idletomography.idtreport.IdleTomographyObservedRatePlot pygsti.extras.idletomography.idtreport.IdleTomographyIntrinsicErrorsTable Functions ~~~~~~~~~ .. autoapisummary:: pygsti.extras.idletomography.idtreport.create_idletomography_report .. py:class:: IdleTomographyObservedRatesTable(ws, idtresults, threshold=1.0, mdl_simulator=None) Bases: :py:obj:`pygsti.report.workspace.WorkspaceTable` A table of the largest N (in absolute value) observed error rates. Create a IdleTomographyObservedRatesTable object. Parameters ---------- idtresults : IdleTomographyResults The idle tomography results object from which to extract observed-rate data. threshold : int or float Specifies how many observed error rates to display. If an integer, display the top `threshold` rates. If a float, display the top `threshold` fraction of all the rates (e.g. 0.2 will show the to 20%). mdl_simulator : Model, optional If not None, use this Model to simulate the observed data points and plot these simulated values alongside the data. Returns ------- ReportTable .. py:class:: IdleTomographyObservedRatesForIntrinsicRateTable(ws, idtresults, typ, error_op, threshold=1.0, mdl_simulator=None) Bases: :py:obj:`pygsti.report.workspace.WorkspaceTable` A table showing the observed error rates relevant for determining a particular intrinsic rate. Output can be limited to just the largest observed rates. Create a IdleTomographyObservedRatesForIntrinsicRateTable. Parameters ---------- idtresults : IdleTomographyResults The idle tomography results object from which to extract observed-rate data. typ : {"hamiltonian", "stochastic", "affine"} The type of the intrinsic rate to target. error_op : NQPauliOp The intrinsic error (of the given `typ`), specified as a N-qubit Pauli operator. threshold : int or float Specifies how many observed error rates to consider. If an integer, display the top `threshold` rates of *all* the observed rates. For example, if `threshold=10` and none of the top 10 rates are applicable to the given `typ`,`error_op` error, then nothing is displayed. If a float, display the top `threshold` fraction, again of *all* the rates (e.g. 0.2 means the top 20%). mdl_simulator : Model, optional If not None, use this Model to simulate the observed data points and plot these simulated values alongside the data. Returns ------- ReportTable .. py:class:: IdleTomographyObservedRatePlot(ws, idtresults, typ, fidpair, obs_or_outcome, title='auto', scale=1.0, mdl_simulator=None) Bases: :py:obj:`pygsti.report.workspace.WorkspacePlot` A plot showing how an observed error rate is obtained by fitting a sequence of observed data to a simple polynomial. Create a IdleTomographyObservedRatePlot. Parameters ---------- idtresults : IdleTomographyResults The idle tomography results object from which to extract observed-rate data. typ : {"samebasis","diffbasis"} The type of observed-rate: same-basis or definite-outcome rates prepare and measure in the same Pauli basis. Other rates prepare and measure in different bases, and so have non-definite-outcomes. fidpair : tuple A `(prep,measure)` 2-tuple of :class:`NQPauliState` objects specifying the fiducial pair (a constant) for the data used to obtain the observed rate being plotted. obs_or_outcome : NQPauliOp or NQOutcome The observable (if `typ` == "diffbasis") or outcome (if `typ` == "samebasis") identifying the observed rate to plot. title : str, optional The plot title to use. If `"auto"`, then one is created based on the parameters. scale : float, optional Scaling factor to adjust the size of the final figure. mdl_simulator : Model, optional If not None, use this Model to simulate the observed data points and plot these simulated values alongside the data. .. py:class:: IdleTomographyIntrinsicErrorsTable(ws, idtresults, display=('H', 'S', 'A'), display_as='boxes') Bases: :py:obj:`pygsti.report.workspace.WorkspaceTable` A table of all the intrinsic rates found by idle tomography. Create a IdleTomographyIntrinsicErrorsTable. Parameters ---------- idtresults : IdleTomographyResults The idle tomography results object from which to extract observed-rate data. display : tuple of {"H","S","A"} Specifes which columns to include: the intrinsic Hamiltonian, Stochastic, and/or Affine errors. Note that if an error type is not included in `idtresults` it's column will not be displayed regardless of the value of `display`. display_as : {"numbers", "boxes"}, optional How to display the matrices, as either numerical grids (fine for small matrices) or as a plot of colored boxes (space-conserving and better for large matrices). Returns ------- ReportTable .. py:function:: create_idletomography_report(results, filename, title='auto', ws=None, auto_open=False, link_to=None, brevity=0, advanced_options=None, verbosity=1) Creates an Idle Tomography report, summarizing the results of running idle tomography on a data set. Parameters ---------- results : IdleTomographyResults An object which represents the set of results from an idle tomography run, typically obtained from running :func:`do_idle_tomography` OR a dictionary of such objects, representing multiple idle tomography runs to be compared (typically all with *different* data sets). The keys of this dictionary are used to label different data sets that are selectable in the report. filename : string, optional The output filename where the report file(s) will be saved. If None, then no output file is produced (but returned Workspace still caches all intermediate results). title : string, optional The title of the report. "auto" causes a random title to be generated (which you may or may not like). ws : Workspace, optional The workspace used as a scratch space for performing the calculations and visualizations required for this report. If you're creating multiple reports with similar tables, plots, etc., it may boost performance to use a single Workspace for all the report generation. auto_open : bool, optional If True, automatically open the report in a web browser after it has been generated. link_to : list, optional If not None, a list of one or more items from the set {"tex", "pdf", "pkl"} indicating whether or not to create and include links to Latex, PDF, and Python pickle files, respectively. "tex" creates latex source files for tables; "pdf" renders PDFs of tables and plots ; "pkl" creates Python versions of plots (pickled python data) and tables (pickled pandas DataFrams). advanced_options : dict, optional A dictionary of advanced options for which the default values aer usually are fine. Here are the possible keys of `advanced_options`: - connected : bool, optional Whether output HTML should assume an active internet connection. If True, then the resulting HTML file size will be reduced because it will link to web resources (e.g. CDN libraries) instead of embedding them. - cachefile : str, optional filename with cached workspace results - precision : int or dict, optional The amount of precision to display. A dictionary with keys "polar", "sci", and "normal" can separately specify the precision for complex angles, numbers in scientific notation, and everything else, respectively. If an integer is given, it this same value is taken for all precision types. If None, then `{'normal': 6, 'polar': 3, 'sci': 0}` is used. - resizable : bool, optional Whether plots and tables are made with resize handles and can be resized within the report. - autosize : {'none', 'initial', 'continual'} Whether tables and plots should be resized, either initially -- i.e. just upon first rendering (`"initial"`) -- or whenever the browser window is resized (`"continual"`). verbosity : int, optional How much detail to send to stdout. Returns ------- Workspace The workspace object used to create the report