pygsti.tools.group

Encapsulates a group in terms of matrices and relations

Module Contents

Classes

MatrixGroup

Encapsulates a group where each element is represented by a matrix.

Functions

is_integer(x)

Check if x is an integer type.

construct_1q_clifford_group()

Returns the 1 qubit Clifford group as a MatrixGroup object

pygsti.tools.group.is_integer(x)

Check if x is an integer type.

Parameters

xobject

Object to test.

Returns

bool

pygsti.tools.group.construct_1q_clifford_group()

Returns the 1 qubit Clifford group as a MatrixGroup object

Returns

MatrixGroup

class pygsti.tools.group.MatrixGroup(list_of_matrices, labels=None)

Bases: object

Encapsulates a group where each element is represented by a matrix.

Parameters

list_of_matriceslist

A list of the group elements (should be 2d numpy arrays), and can be mdl.gate.values() for some Model mdl that forms a group.

labelslist, optional

A label corresponding to each group element.

Constructs a new MatrixGroup object

Parameters

list_of_matriceslist

A list of the group elements (should be 2d numpy arrays), and can be mdl.gate.values() for some Model mdl that forms a group.

labelslist, optional

A label corresponding to each group element.

mxs
labels
product_table
inverse_table
matrix(i)

Returns the matrix corresponding to index or label i

Parameters
iint or other

If an integer, an element index. Otherwise, an element label.

Returns

numpy array

inverse_matrix(i)

Returns the inverse of the matrix corresponding to index or label i

Parameters
iint or other

If an integer, an element index. Otherwise, an element label.

Returns

numpy array

inverse_index(i)

Returns the index/label corresponding to the inverse of index/label i

Parameters
iint or str

If an integer, an element index. Otherwise, an element label.

Returns
int or str

If i is an integer, returns the element’s index. Otherwise returns the element’s label.

product(indices)

Returns the index/label of corresponding to the product of a list or tuple of indices/labels.

Parameters
indicesiterable

Specifies the sequence of group elements to include in the matrix product. If indices contains integers, they an interpreted as group element indices, and an integer is returned. Otherwise, indices is assumed to contain group element labels, and a label is returned.

Returns
int or str

If indices contains integers, returns the resulting element’s index. Otherwise returns the resulting element’s label.