I am implementing QEC cycles for CSS codes and using PyMatching for decoding. Since I can quickly obtain the parity-check matrix, PyMatching is convenient. However, when I try to use it for CSS codes where you have more than two non-zero elements per column in the parity-check matrix, which corresponds to having more than two stabilizers per qubit, it gives an error. My current solution is to erase some elements in each column to have, at maximum, two stabilizers per qubit. This is non-optimum (in principle, one could use the additional information per qubit to improve the decoder), and I would like to know what else I can do.
PyMatching is a decoder based on matching. It fundamentally relies on an assumption that errors produce pairs of detection events (or a single detection event next to a boundary), and decoding is done by pairing up (i.e. matching) the detection events to reconstruct the errors.
Not all CSS codes can be decoded using matching. If you try to use pymatching for arbitrary CSS codes, it's not gonna work.
If it is the case that your CSS code has errors with more than two symptoms, but secretly they can be matched in some sort of non-trivial way, you need to decompose those errors into the graphlike parts that can be matched. You need to explain the problem to pymatching in a way it understands.
If you're configuring pymatching using a stim detector error model, the requirement you have to meet is to use splitters
^ to separate ungraphlike errors into graphlike pieces. Stim can do some cases of this automatically when converting from a circuit to a detector error model, e.g. it can automatically decompose the ungraphlike Y errors in the CSS surface code into graphlike X and Z errors.