deltakit.core.decoding_graphs.NXDecodingMultiGraph#

class deltakit.core.decoding_graphs.NXDecodingMultiGraph(graph: _QECNXMG, boundaries: Iterable[int] = frozenset({}))#

Bases: NXGraph[_QECNXMG, tuple[DecodingEdge, int]]

Implementation of a decoding multigraph using NetworkX and QEC syndrome and edge objects. All edges in this graph are size 2, and a pair of syndromes can be connected by multiple edges (a multi-edge). As with the non-multiedge decoding graph, a fictitious boundary vertex exists to match isolated vertices.

Parameters:
  • graph (_QECNXMG) – NetworkX MultiGraph to wrap.

  • boundaries (Optional[Iterable[int]], optional) – Optional indices of detectors that should be treated as a boundary, by default frozenset().

Methods#

NXDecodingMultiGraph.detector_is_boundary

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

NXDecodingMultiGraph.error_to_syndrome

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

NXDecodingMultiGraph.from_edge_list

Create a graph, where connectivity is defined by an edge list.

NXDecodingMultiGraph.get_edges

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

NXDecodingMultiGraph.get_relevant_nodes

Return the nodes that have an edge with a path to logical that is not via the boundary

NXDecodingMultiGraph.incident_edges

Iterator for the incident edges connected to a given detector.

NXDecodingMultiGraph.neighbors

Iterator for the neighbours of a given detector.

NXDecodingMultiGraph.shortest_path

Find the shortest path between two syndrome bits, as a sequence of decoding edges.

NXDecodingMultiGraph.shortest_path_length

Find the length of the shortest path between two syndrome bits.

NXDecodingMultiGraph.shortest_path_length_no_boundaries

Find the length of the shortest path between two syndrome bits without going via any boundaries.

NXDecodingMultiGraph.shortest_path_no_boundaries

Find the shortest path between two syndrome bits without going via any boundaries, as a sequence of decoding edges.

NXDecodingMultiGraph.to_parity_check_matrix

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

NXDecodingMultiGraph.with_multi_edges_merged

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