oscarhiggott / PyMatching

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

decode_to_edges_array says it takes List[int] but actually takes List[bool] #74

Closed Strilanc closed 7 months ago

Strilanc commented 1 year ago
import pymatching

# Works
matching = pymatching.Matching.from_detector_error_model(stim.DetectorErrorModel('error(0.5) D0'))
matching.decode_to_edges_array([0])

# Fails, but should work fine
matching = pymatching.Matching.from_detector_error_model(stim.DetectorErrorModel('error(0.5) D1'))
matching.decode_to_edges_array([1])
Strilanc commented 1 year ago

Okay, I have now realized that it is expected a dense list[bool] instead of a sparse list[int]. In that case the bug is that the signature says "List[int]".

oscarhiggott commented 7 months ago

This is now fixed in 7e3eb37ff3e048fe67c090c17e37e715c59dfc12