deltakit.decode.PyMatchingDecoder#

class deltakit.decode.PyMatchingDecoder(decoding_graph: GraphT, logicals: Sequence[Set[DecodingHyperEdge]], lvl: int = 40)#

Bases: GraphDecoder

PyMatching decoder for minimum weight perfect matching (MWPM), configured to use our decoding graph representation.

Parameters:
  • decoding_graph (NXDecodingGraph) – Decoding graph to define the matching problem.

  • logicals (Tuple[OrderedDecodingEdges, ...]) – Tuple of reference logicals to keep track of, as a collection of decoding edges.

Notes

MWPM relies on contiguous indices for nodes.

Methods#

PyMatchingDecoder.construct_decoder_and_stim_circuit

Helper factory to create a MWPM decoder and the Stim circuit used during its construction.

PyMatchingDecoder.decode_batch_to_full_correction

Decodes a batch of syndrome bitstrings to full correction.

PyMatchingDecoder.decode_batch_to_logical_flip

Decodes a batch of syndrome bitstrings to logical flips.

PyMatchingDecoder.decode_to_full_correction

Decode to full correction returning OrderedDecodingEdges object

PyMatchingDecoder.decode_to_logical_flip

Decode a given syndrome and return a flip boolean for each logical.