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

moduleModule

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

xmatrix-like

The object to get the dimension of.

Returns

int

pygsti.report.convert.item_type(x)

Differentiate an item’s type

Parameters

xanything

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

xobject

The object to convert.

specsdictionary

Dictionary of user-specified and default parameters to formatting

fmtstr

The format to convert to, e.g. “html” or “latex”.

Returns

str

x rendered as fmt.

pygsti.report.convert.converter(fmt)

Create a converter function for some specific format

Parameters

fmtstr

The format to convert to, e.g. “html” or “latex”.

Returns

function