pygsti.report.python

Routines for converting python objects to python.

Module Contents

Functions

table(custom_headings, col_headings_formatted, rows, spec)

Create a "Python table" - really a pandas DataFrame

cell(data, label, spec)

Format the cell of a python table

list(l, specs)

Stub for conversion that isn't needed in python case.

vector(v, specs)

Stub for conversion that isn't needed in python case.

matrix(m, specs)

Stub for conversion that isn't needed in python case.

value(el, specs)

Stub for conversion that isn't needed in python case.

escaped(txt, specs)

Stub for conversion that isn't needed in python case.

pygsti.report.python.table(custom_headings, col_headings_formatted, rows, spec)

Create a “Python table” - really a pandas DataFrame

Parameters
  • custom_headings (None, dict) – optional dictionary of custom table headings

  • col_headings_formatted (list) – formatted column headings

  • rows (list of lists of cell-strings) – Data in the table, pre-formatted

  • spec (dict) – options for the formatter

Returns

dict (contains key ‘python’, which corresponds to a) – pandas.DataFrame object representing the table

pygsti.report.python.cell(data, label, spec)

Format the cell of a python table

Parameters
  • data (string) – string representation of cell content

  • label (string) – optional cell label, used for tooltips

  • spec (dict) – options for the formatters

Returns

string

pygsti.report.python.list(l, specs)

Stub for conversion that isn’t needed in python case.

(Convert a python list to python.)

Parameters
  • l (list) – list to convert into latex. sub-items pre formatted

  • specs (dictionary) – Dictionary of user-specified and default parameters to formatting

Returns

list

pygsti.report.python.vector(v, specs)

Stub for conversion that isn’t needed in python case.

(Convert a 1D numpy array to python.)

Parameters
  • v (numpy array) – 1D array to convert.

  • specs (dictionary) – Dictionary of user-specified and default parameters to formatting

Returns

numpy array

pygsti.report.python.matrix(m, specs)

Stub for conversion that isn’t needed in python case.

Convert a 2D numpy array to python.

Parameters
  • m (numpy array) – 2D array to convert.

  • specs (dictionary) – Dictionary of user-specified and default parameters to formatting

Returns

numpy array

pygsti.report.python.value(el, specs)

Stub for conversion that isn’t needed in python case.

(this function would be for converting python to python).

Parameters
  • el (float or complex) – Value to convert into latex.

  • specs (dictionary) – Dictionary of user-specified and default parameters to formatting

Returns

float or complex

pygsti.report.python.escaped(txt, specs)

Stub for conversion that isn’t needed in python case.

(Escape txt so it is python safe.)

Parameters
  • txt (string) – value to escape

  • specs (dictionary) – Dictionary of user-specified and default parameters to formatting

Returns

string