I am trying to use Pymatching to decode some non CSS codes like the XZZX code. Pymatching is a perfect decoder for CSS codes, which can work effectively even of a large code distance. I have tried to decode XZZX code with Pymatching (circuits written with stim language), and certainly it gives wrong results (as d increases, logical error increases). I have learned that the algorithm in Pymatching (Sparse Blossom MWPM) performs well dealing with graph-like errors, while the correction operation of XZZX differs from that of CSS code, which leads to a wrong outcome. So my question is more technically:How could I modify the error-correction part in the Pymatching package and make it suitable for non CSS codes (e.g. XZZX code)?
Where are you getting the idea CSS codes are "more matchable"? That's not true. I'm not even sure why you'd think it's true.
The XZZX and CSS surface codes have identical decoding graph structures. Decoding one is decoding the other. If you're getting the wrong answer, it's because of a bug in how you make the decoding graph or in how you apply the corrections. It's somewhere in your glue code.
I recommend using
pymatching.Matching.from_stim_circuit, as this will avoid several potential bugs with how you configure pymatching.