It seems that your circuit experiment includes some error mechanisms that flip more than two detectors.
This means your syndrome decoding graph is actually an hypergraph, with some hyperedges connecting more than 2 vertices. These hyperedges can be a property of hypergraph product codes or a consequence of the circuit you consider (e.g.
hyperedges appear in some experiments with the surface code).
Stim's default decoders are Minimal Weight Perfect Matching decoders, which only works with circuit experiments involving no hyperedges. The decompose_errors=True
option uses a heuristic method that can in some cases replace the hyperedges with regular edges, but won't work in general. It seems that stim cannot decompose the hyperedges in your case.
The BpOsdDecoder
(and probably the BeliefFindDecoder
) from the ldpc
library you linked should be able to handle syndrome decoding hypergraphs. The main issue appears to be that the Sinter version of this decoder does not let you choose to allow stim.DetectorErrorModel
with hyperedges.
(To be precise, the function called at line 98 of this file would have to pass a second True
-valued argument, see its definition, line 61)
I can see no direct solution that would go around it.
You can probably create an issue on GitHub to ask about this choice to not expose this option.
As a possible workaround, you can try to modify the SinterBpOsdDecoder class to pass a second True
argument, by copy/pasting/editing its definition directly in your code.