--- id: ldpc version: "2.4.1" license: MIT License Copyright (c) 2024 Joschka Roffe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # ldpc — LDPC: Python Tools for Low Density Parity Check Codes License: permissive · Maintenance: aging · Downloads: 121.3K/mo ## What it is and what it does LDPC is a Python library for decoding low-density parity check codes, with a focus on quantum error correction. It provides multiple decoder implementations—belief propagation (BP), ordered statistics decoding (OSD), union-find matching, and hybrid approaches like BP+LSD and BeliefFind—suitable for both classical and quantum codes. The package wraps C++ code via Cython and depends on numpy, scipy, tqdm, pytest, stim, sinter, and pymatching for its runtime. The library is designed for researchers and practitioners working with error-correcting codes, particularly in quantum computing contexts. Installation requires a C compiler and Python 3.10 or later. It provides utilities for constructing codes (e.g., Hamming codes), computing code parameters via GF2 linear algebra, and decoding syndromes using configurable algorithms. The package is in beta status and remains a work in progress, with ongoing development for parallel processing and additional decoder implementations. Use it for: - Decode quantum surface codes and other matchable syndromes using the union-find or BeliefFind decoders - Benchmark belief propagation with ordered statistics decoding (BP+OSD) for quantum error correction research - Compute low-density parity check code parameters and perform GF2 linear algebra operations - Simulate quantum error correction pipelines by integrating with stim and sinter for code construction and syndrome generation - Evaluate BP+LSD (belief propagation plus localized statistics decoding) as an alternative to OSD-based approaches ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides decoders for low-density parity check (LDPC) codes, including belief propagation, ordered statistics decoding, union-find matching, and hybrid approaches for classical and quantum error correction. Yes, with conditions. Install if you are working on quantum error correction research or classical LDPC decoding and can meet the C compiler requirement. The MIT license and broad platform support (wheels for macOS, Linux, Windows) are favorable. However, the aging maintenance status (249 days since last release) and beta classification mean you should verify that the package meets your specific decoding accuracy and performance needs before committing to production use. No known security vulnerabilities. ## Install pip install ldpc uv add ldpc poetry add ldpc ## Installing ldpc Before you install: Medium install friction due to C++ compilation requirement (needs a C compiler like gcc or clang). Supports current Python versions (3.10+) with prebuilt wheels for common platforms. Maintenance status is aging—last release was 249 days ago—though the package remains functional. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both academic and commercial projects. Quickstart: pip install ldpc import numpy as np import ldpc.codes from ldpc.bplsd_decoder import BpLsdDecoder H = ldpc.codes.hamming_code(5) decoder = BpLsdDecoder(H, error_rate=0.1, lsd_order=0) syndrome = np.random.randint(0, 2, size=H.shape[0], dtype=np.uint8) decoding = decoder.decode(syndrome) Requires a C compiler (gcc on Linux, clang on macOS/Windows) and Python >= 3.10 to build from source or install wheels. Verify before relying: - Whether the package is actively maintained or in maintenance-only mode beyond the aging status flag - Performance characteristics and decoding accuracy compared to other LDPC implementations - Stability of the C++ rewrite relative to LDPCv1, given the documented possibility of breaking changes ## Package facts - License: MIT License Copyright (c) 2024 Joschka Roffe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: medium - Maintenance: aging - Downloads: 121.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags LDPC decoder, parity check code decoding, quantum error correction, belief propagation decoder, syndrome decoding, error correction codes, quantum code simulation, quantum-error-correction, error-correcting-codes, decoding-algorithms [View on SkillFed](https://skillfed.io/packages/ldpc) · [View on PyPI](https://pypi.org/project/ldpc/)