pygsti.report.table

Defines the ReportTable class

Module Contents

Classes

ReportTable

Table representation, renderable in multiple formats

class pygsti.report.table.ReportTable(col_headings, formatters, custom_header=None, col_heading_labels=None, confidence_region_info=None)

Bases: object

Table representation, renderable in multiple formats

Parameters
  • col_headings (list or dict) – Default column headings if list; dictionary of overrides if dict.

  • formatters (list) – Names of default column heading formatters.

  • custom_header (dict) – Dictionary of overriden headers.

  • col_heading_labels (list) – Labels for column headings (tooltips).

  • confidence_region_info (ConfidenceRegion, optional) – If not None, specifies a confidence-region used to display error intervals. Specifically, tells reportableqtys if they should use non markovian error bars or not

num_rows

The number of rows in this table

Type

int

num_cols

The number of columns in this table

Type

int

row_names

The names (keys) of the rows in this table

Type

list

col_names

The names (keys) of the columns in this table

Type

list

add_row(self, data, formatters=None, labels=None, non_markovian_ebs=None)

Adds a row to the table.

Parameters
  • data (list) – A list of the data for each cell of the added row.

  • formatters (list[string], optional) – Formatting options for each cell of the added row.

  • labels (list[string], optional) – Labeling options for each cell of the added row.

  • non_markovian_ebs (bool) – Whether non-Markovian error bars should be used

Returns

None

finish(self)

Finish table creation. Indicates no more rows will be added.

Returns

None

_get_col_headings(self, fmt, spec)
render(self, fmt, longtables=False, table_id=None, tableclass=None, output_dir=None, precision=6, polarprecision=3, sciprecision=0, resizable=False, autosize=False, fontsize=None, complex_as_polar=True, brackets=False, click_to_display=False, link_to=None, render_includes=True)

Render a table object

Parameters
  • fmt (string) – name of format to be used

  • longtables (bool) – latex table option

  • table_id (string) – id tag for HTML tables

  • tableclass (string) – class tag for HTML tables

  • output_dir (string) – directory for latex figures to be rendered in

  • precision (int) – number of digits to render

  • polarprecision (int) – number of digits to render for polars

  • sciprecision (int) – number of digits to render for scientific notation

  • resizable (bool) – allow a table to be resized

  • autosize (bool) – allow a table to be automatically sized

  • fontsize (int) – override fontsize of a tabel

  • complex_as_polar (bool) – render complex numbers as polars

  • brackets (bool) – render matrix like types w/ brackets

  • click_to_display (bool) – table plots must be clicked to prompt creation

  • link_to (list or {'tex', 'pdf', 'pkl'}) – whether to create links to TEX, PDF, and/or PKL files

  • render_includes (bool) – whether files included in rendered latex should also be rendered (usually as PDFs for use with the ‘includegraphics’ latex statement)

Returns

string

__str__(self)

Return str(self).

__getitem__(self, key)

Indexes the first column rowdata

__len__(self)
__contains__(self, key)
__getstate__(self)
__setstate__(self, d)
keys(self)

A list of the first element of each row, which can be used for indexing.

Returns

list

row(self, key=None, index=None)

Retrieve a row’s cell data.

A row is identified by either its key (its first cell’s value) OR its index (0-based). You cannot specify both key and index.

Parameters
  • key (object, optional) – Value of a row’s first cell.

  • index (int, optional) – Row index.

Returns

list

col(self, key=None, index=None)

Retrieve a column’s cell data.

A column is identified by either its key (its column header’s value) OR its index (0-based). You cannot specify both key and index.

Parameters
  • key (object, optional) – Value of a column’s header value.

  • index (int, optional) – Column index.

Returns

list

property num_rows(self)

The number of rows in this table

Returns

int

property num_cols(self)

The number of columns in this table

Returns

int

property row_names(self)

The names (keys) of the rows in this table

Returns

list

property col_names(self)

The names (keys) of the columns in this table

Returns

list