Skip to content

Conversation

@inmzhang
Copy link
Contributor

@inmzhang inmzhang commented Aug 13, 2025

Some tests failed due to issues in the correlated pymatching implementation. Wait for oscarhiggott/PyMatching#166 to be merged and a new patched version released. Then bump the pymatching version requirement in decoder predicates added in this PR, e.g.:

if version.parse(pymatching.__version__) < version.parse("2.3.0"):

Update:

  • Handle undetectable errors oscarhiggott/PyMatching#167 has fixed the undetectable error cases. And the fix is included in pymatching v2.3.1.
  • Correlated pymatching does not support errors with probabilities greater than 0.5 yet. Therefore, I've changed the test_post_selection in _decoding_test.py a bit.

@inmzhang inmzhang marked this pull request as ready for review October 8, 2025 08:58
@inmzhang inmzhang changed the title [WIP] Add correlated_pymatching decoder to sinter builtin decoder list Add correlated_pymatching decoder to sinter builtin decoder list Oct 8, 2025
def test_post_selection(decoder: str, force_streaming: Optional[bool]):
circuit = stim.Circuit("""
X_ERROR(0.6) 0
X_ERROR(0.4) 0
Copy link
Collaborator

@Strilanc Strilanc Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was potentially intentionally testing the ability to handle probabilities larger than 0.5. Why was it changed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the correlated version of pymatching can't support errors larger than 50% yet, then I don't think it's ready to be added as a default supported decoder yet.

Copy link

@oscarhiggott oscarhiggott Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, but is it not still useful to include even if it doesn't support this? Surely p>0.5 errors are a much rarer property of practical stim circuits than matchability? I can look into supporting negative edge weights with correlations but it's possible it will require a major refactor. The approach I took in #1012 was to skip this test for pymatching-correlated.

assert 650 <= result.discards <= 950
if 'vacuous' not in decoder:
assert 40 <= result.errors <= 160
assert 60 <= result.errors <= 240
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

custom_decoders=TEST_CUSTOM_DECODERS,
)
assert 1050 <= result.discards <= 1350
assert 650 <= result.discards <= 950
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed to a non-overlapping range?

@oscarhiggott
Copy link

oscarhiggott commented Nov 27, 2025

I just opened another similar PR (#1012) as I had forgotten there was already a WIP PR here. Since correlated pymatching doesn't support correlations I had it skip the test with the p>0.5 errors.

@inmzhang
Copy link
Contributor Author

Hi Oscar @oscarhiggott, I'll close this one in favor of your "official" implementation :-)

@inmzhang inmzhang closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants