paulie.classifier.classification.Morph#

class paulie.classifier.classification.Morph(legs, dependents)#

Bases: object

Stores the structural data of a canonical graph.

counts()#

Get counts of length 1 legs, length 2 legs, and number of vertices on the longest leg.

Returns:

Counts of length 1 legs, length 2 legs, and number of vertices on the longest leg.

Return type:

tuple[int,int,int]

Raises:

ClassificationException – If the graph is of non-canonical type.

gen_generators()#

Generate generators.

Yields:

List of generators.

gen_independent_pair()#

Generate all independent pairs of Pauli strings in the transformed generating set.

Yields:

All independent pairs of Pauli strings in the canonical graph.

gen_pq()#

Generate products of all pairs of Pauli strings in the canonical graph.

Yields:

Dictionary of v (PauliString): Vertex of graph. w (PauliString): Other vertex of graph. vw (PauliString): Proportional product of v and w. neighbour: True if v and w are neighbours.

get_algebra_properties()#

Get the properties of the algebra.

If the algebra is

\[\bigoplus_{i=1}^{n}\mathfrak{a}(m)\]

Then the tuple \(\{\mathfrak{a},n,m\}\) is returned.

Returns:

Tuple of type of algebra, number of copies of the algebra, and the size of the algebra.

Return type:

tuple[TypeAlgebra,int,int]

get_dependents()#

Get a list of dependent Pauli strings.

Returns:

List of dependent Pauli strings.

Return type:

list[PauliString]

get_legs()#

Get list of legs.

Returns:

List of legs.

Return type:

list[list[PauliString]]

get_properties()#

Get the properties of the graph including its type.

Returns:

Type of the graph and counts of length 1 legs, length 2 legs, and number of vertices on the longest leg.

Return type:

tuple[TypeGraph,int,int,int]

Raises:

ClassificationException – If the graph is of non-canonical type.

get_type()#

Get the type of the graph.

Returns:

Type of the graph.

Return type:

TypeGraph

get_vertices()#

Get a list of vertices in the graph.

Returns:

List of vertices in the graph.

Return type:

list[PauliString]

is_empty()#

Check if the graph is empty.

Returns:

True if graph is empty.

Return type:

bool

is_empty_legs()#

Check if the graph has a center but no legs.

Returns:

True if the graph only has a center.

Return type:

bool