Skip to content

Create PyMatching decoder plugin#396

Open
bmhowe23 wants to merge 8 commits intoNVIDIA:mainfrom
bmhowe23:pr-add-pymatching-decoder2
Open

Create PyMatching decoder plugin#396
bmhowe23 wants to merge 8 commits intoNVIDIA:mainfrom
bmhowe23:pr-add-pymatching-decoder2

Conversation

@bmhowe23
Copy link
Collaborator

@bmhowe23 bmhowe23 commented Jan 2, 2026

This PR introduces a PyMatching decoder plugin to the CUDA-Q QEC library.

Ref: https://github.com/oscarhiggott/PyMatching

Summary

The new PyMatching decoder plugin integrates the PyMatching library into the CUDA-Q QEC framework. It allows users to decode syndromes using MWPM by simply requesting the decoder by name. The implementation handles the conversion of a parity check matrix into a PyMatching graph, supporting both standard edges (between check nodes) and boundary edges.

Key Changes

  • MWPM Decoder Plugin: Implemented a new decoder in libs/qec/lib/decoders/plugins/pymatching/pymatching.cpp.
  • Supports error_rate_vec as a parameter to define edge weights based on physical error rates.
  • Maps the PyMatching merge_strategy options (disallow, independent, smallest_weight, keep_original, replace) to CUDA-Q QEC Plugin options.

Tests

  • C++ Unit Tests:
    • libs/qec/unittests/decoders/pymatching/test_pymatching.cpp
  • Python:
    • libs/qec/python/tests/test_decoder.py
    • libs/qec/python/tests/test_sliding_window.py

Signed-off-by: Ben Howe <bhowe@nvidia.com>
Signed-off-by: Ben Howe <bhowe@nvidia.com>
Signed-off-by: Ben Howe <bhowe@nvidia.com>
Signed-off-by: Ben Howe <bhowe@nvidia.com>
@bmhowe23 bmhowe23 requested a review from wsttiger January 27, 2026 20:32
Signed-off-by: Ben Howe <bhowe@nvidia.com>
Signed-off-by: Ben Howe <bhowe@nvidia.com>
Signed-off-by: Ben Howe <bhowe@nvidia.com>
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.

1 participant