oscarhiggott / PyMatching

PyMatching: A Python/C++ library for decoding quantum error correcting codes with minimum-weight perfect matching.
Apache License 2.0
177 stars 32 forks source link

Stim, Surface Code and Parity check matrix #73

Closed yoyocni closed 1 week ago

yoyocni commented 1 year ago

Thank you for the great repo! I can see many other are interested in surface code (from parity check matrix). In the documentation https://pymatching.readthedocs.io/en/stable/toric-code-example.html#Simulating-circuit-level-noise , you propose to test surface code with circuit noise. Do you know if it is possible to extract the corresponding parity check matrix from the stim circuit or from the pymatching decoder instantiated with the stim circuit? Thanks!

oscarhiggott commented 7 months ago

Hi @yoyocni, apologies for the slow response. You can use the detector_error_model_to_check_matrices method from the BeliefMatching python package. Is that the check matrix you were looking for?