To perform circuit-level noise decoding and Monte Carlo sampling, the BPOSD and BeliefFind decoders are integrated with the Stim Sinter library.
To use them, you must pass the SinterBpOsdDecoder and SinterBeliefFindDecoder classes into the custom_decoders dictionary within the sinter.collect function. This allows Sinter to use these specific LDPC decoders to process the quantum error correction circuits generated by Stim.
import sinter
from ldpc.sinter_decoders import SinterBeliefFindDecoder, SinterBpOsdDecoder
# Example usage within sinter.collect
samples = sinter.collect(
tasks=my_tasks,
decoders=["bposd", "belief_find"],
custom_decoders={
"bposd": SinterBpOsdDecoder(
max_iter=5,
bp_method="ms",
ms_scaling_factor=0.625,
schedule="parallel",
osd_method="osd0",
),
"belief_find": SinterBeliefFindDecoder(
max_iter=5,
bp_method="ms",
ms_scaling_factor=0.625,
schedule="parallel"
),
},
# ... other arguments
)