pygsti.report.convert

This module defines type-differentiation for low level formatting types.

Its main function, convert, takes any item x, a specs dictionary, and a format (ie ‘html’) and returns a formatted version of x using the format

Module Contents

Functions

functions_in(module)

Create a dictionary of the functions in a module

calc_dim(x)

Calculate the dimension of some matrix-like type

item_type(x)

Differentiate an item's type

convert(x, specs, fmt)

Convert any item to a format

converter(fmt)

Create a converter function for some specific format

Attributes

convert_dict

pygsti.report.convert.functions_in(module)

Create a dictionary of the functions in a module

Parameters

module (Module) – module to run on.

Returns

dict

pygsti.report.convert.convert_dict
pygsti.report.convert.calc_dim(x)

Calculate the dimension of some matrix-like type

Parameters

x (matrix-like) – The object to get the dimension of.

Returns

int

pygsti.report.convert.item_type(x)

Differentiate an item’s type

Parameters

x (anything) – Value to convert.

Returns

string – name of low-level formatter to use (i.e. value or matrix)

pygsti.report.convert.convert(x, specs, fmt)

Convert any item to a format

Parameters
  • x (object) – The object to convert.

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

  • fmt (str) – The format to convert to, e.g. “html” or “latex”.

Returns

strx rendered as fmt.

pygsti.report.convert.converter(fmt)

Create a converter function for some specific format

Parameters

fmt (str) – The format to convert to, e.g. “html” or “latex”.

Returns

function