flamingpy.decoders.decoder.correct(code, decoder='MWPM', weight_options=None, sanity_check=False, decoder_opts=None, draw=False, drawing_opts=None)[source]

Run through the qubit-level error-correction steps.

Combines weight assignment and outer (qubit) decoding. The latter of these includes the creation of decoding objects, the decoding algorithm, the recovery, and the correctness check.

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

  • decoder (str, optional) –

    the qubit-level (outer) decoder. Options are:

    ”MWPM”: minimum-weight perfect matching (the default) “UF”: Union-Find.

  • weight_options (dict, optional) –

    how to assign weights for the outer decoder; options are

    ’method’: ‘uniform’ or ‘blueprint’ (latter for MWPM decoder) ‘integer’: True (for rounding) or False (for not) ‘multiplier’: integer denoting multiplicative factor before rounding

    Uniform weights by default.

  • sanity_check (bool, optional) – if True, check that the recovery operation has succeeded and verify that parity is conserved among all correlation surfaces

  • decoder_opts (dict, optional) – a dictionary of decoding options, including the backend (“networkx” or “retworkx” for “MWPM”)

  • draw (bool, optional) – set to True to illustrate the decoding procedure, including the stabilizer graph, syndrome plot, and recovery.

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


True if error correction succeded, False if not.

Return type

result (bool)




Using FlamingPy


Getting Help

Python API