deltakit.core.decoding_graphs.HyperMultiGraph#

class deltakit.core.decoding_graphs.HyperMultiGraph#

Bases: ABC, Generic[AnyEdgeT]

Class for abstract immutable multigraph with hyperedges. Any set of vertices can be connected by one or more edges in the multi-hypergraph, forming the basis of all other graph objects.

Methods#

HyperMultiGraph.detector_is_boundary

Return True if given detector is a boundary, False otherwise.

HyperMultiGraph.error_to_syndrome

Assume an error has happened on the given edges and return the corresponding syndrome.

HyperMultiGraph.get_edges

Generator for the edges defined by the given set of detectors.

HyperMultiGraph.incident_edges

Iterator for the incident edges connected to a given detector.

HyperMultiGraph.neighbors

Iterator for the neighbours of a given detector.

HyperMultiGraph.to_parity_check_matrix

Convert the hypergraph to a parity check matrix of size (len(nodes), len(edges)).