deltakit.core.decoding_graphs.DecodingHyperMultiGraph#

class deltakit.core.decoding_graphs.DecodingHyperMultiGraph(edge_data: Iterable[DecodingHyperEdge | tuple[int, ...] | tuple[DecodingHyperEdge, EdgeRecord]], detector_records: dict[int, DetectorRecord] | None = None)#

Bases: HyperMultiGraph[tuple[DecodingHyperEdge, int]]

Representation of a decoding multigraph with hyper-edges.

Parameters:
  • multi_hyper_edges (Iterable[Tuple[DecodingHyperEdge, int]]) – Edges that form this graph.

  • detector_records (Optional[Dict[int, DetectorRecord]], optional) – Optional mapping of detector indices to detector records, by default None.

Methods#

DecodingHyperMultiGraph.detector_is_boundary

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

DecodingHyperMultiGraph.error_to_syndrome

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

DecodingHyperMultiGraph.get_edges

Fetch the edges connecting a sequence of detectors.

DecodingHyperMultiGraph.incident_edges

Iterator for the incident edges connected to a given detector.

DecodingHyperMultiGraph.neighbors

Iterator for the neighbours of a given detector.

DecodingHyperMultiGraph.to_parity_check_matrix

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

DecodingHyperMultiGraph.with_multi_edges_merged

Create a DecodingHyperGraph instance with the same nodes but with only single edges, merging the multi-edge edge records to a single edge record.