Skip to content

Port the tropical tensor network backend to surface code decoder #59

Description

@GiggleLiu
No description provided.

Activity

  1. ChanceSiyuan commented on Jan 28, 2026

    @ChanceSiyuan
    Collaborator

    Issue Resolved: Tropical Tensor Network Backend Ported to Surface Code Decoder

    This issue has been resolved with a fully functional tropical TN MAP decoder for surface codes.

    Results Summary

    Metric Value
    MWPM agreement rate ≥90% on d=3 surface code
    Syndrome satisfaction 100% (valid codewords guaranteed)
    Memory requirement d=3 works well; d≥5 requires >16GB RAM

    Implementation Evidence

    Core Implementation:

    • tropical_in_new/src/ - Tropical tensor network library:

    Surface Code Integration:

    • scripts/analyze_tropical_threshold.py - Complete threshold analysis script that:
      • Builds UAI model from parity check matrix H
      • Runs tropical TN MAP inference
      • Compares with MWPM (pymatching) when available
      • Generates threshold plots
    • bpdecoderplus/dem.py::build_decoding_uai() - UAI model generation from DEM

    Validation Tests:

    • tropical_in_new/tests/test_tropical_mwpm_match.py:
      • test_surface_code_d3_agreement - Verifies ≥90% agreement with MWPM
      • test_surface_code_single_detector_active - Syndrome satisfaction test
      • test_all_factors_included_in_contraction - Verifies contraction tree completeness
    • tropical_in_new/tests/test_connected_components.py - Disconnected component handling

    Output:

    • outputs/tropical_threshold_plot.png - Tropical TN vs MWPM comparison plot

    Integration with bpdecoderplus:
    The tropical decoder uses bpdecoderplus.dem functions (build_parity_check_matrix, build_decoding_uai) with merge_hyperedges=True for efficient computation. The connected components fix (PR #70) ensures all factors are included in contraction.

  2. ChanceSiyuan commented on Jan 28, 2026

    @ChanceSiyuan
    Collaborator

    Closing as resolved - tropical TN backend integrated with surface code decoder, achieving ≥90% MWPM agreement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions