flamingpy.decoders.mwpm_decoder

flamingpy.decoders.mwpm_decoder(code, ec, backend='retworkx', draw=False, drawing_opts=None)[source]

Run the minimum-weight perfect matching decoder on code.

Parameters
  • code (SurfaceCode) – the code class to decode and correct

  • ec (string) – the error complex (“primal” or “dual”)

  • backend (str or flamingpy.matching.MatchingGraph, optional) – The type of matching graph to build. If providing a string, it must be either “networkx”, “retworkx” or “lemon” to pick one of the already implemented backends. Else, the provided type should inherit from the MatchingGraph abstract base class and have an empty init. The default is the retworkx.

  • draw (bool) – whether or not to draw the MWPM decoding process: stabilizer graph, matching graph, syndrome plot, and matching.

  • drawing_opts (dict) – the drawing options, to be fed into viz.draw_mwpm_decoding (see that function for more details).

Returns

the nodes (representing qubits) be fed into the recovery

(i.e. whose bit values must be flipped).

Return type

set[tuples]