deltakit.core.decoding_graphs.NXDecodingGraph#
- class deltakit.core.decoding_graphs.NXDecodingGraph(graph: _QECNX, boundaries: Iterable[int] = frozenset({}))#
Bases:
NXGraph[_QECNX,DecodingEdge]Implementation of a decoding graph using NetworkX and the QEC syndrome and edge objects. This works much like the hypergraph, but all edges are size 2. To account for boundaries, which in a hypergraph exist as size 1 edges, extra nodes may be added. These are virtual detectors that do not physically exist when running the syndrome extraction circuit.
- Parameters:
graph (_QECNX) – NetworkX graph to wrap.
boundaries (Optional[Iterable[int]], optional) – Optional indices of detectors that should be treated as a boundary, by default None.
Methods#
Return True if given detector is a boundary, False otherwise. |
|
Assume an error has happened on the given edges and return the corresponding syndrome. |
|
Create a graph, where connectivity is defined by an edge list. |
|
Returns the unique edge in the graph corresponding to the given set of detector indices. |
|
Given a set of detectors that define an edge in the graph, return its correspoiding EdgeRecord. |
|
Generator for the edges defined by the given set of detectors. |
|
Return the nodes that have an edge with a path to logical that is not via the boundary |
|
Iterator for the incident edges connected to a given detector. |
|
Iterator for the neighbours of a given detector. |
|
Find the shortest path between two syndrome bits, as a sequence of decoding edges. |
|
Find the length of the shortest path between two syndrome bits. |
|
Find the length of the shortest path between two syndrome bits without going via any boundaries. |
|
Find the shortest path between two syndrome bits without going via any boundaries, as a sequence of decoding edges. |
|
Elevate decoding graph to hypergraph. |
|
Convert the hypergraph to a parity check matrix of size (len(nodes), len(edges)). |