relay-bp


Namerelay-bp JSON
Version 0.0.1b2 PyPI version JSON
download
home_pageNone
SummaryPython bindings for the rust implementation of relay belief propagation for qLDPC codes.
upload_time2025-07-25 19:35:06
maintainerNone
docs_urlNone
authorThomas Alexander, Tristan Müller
requires_python>=3.8
licenseApache 2.0
keywords relay relay-bp bp belief propagation quantum error correction qec decoder quantum computing quantum stim qldpc ldpc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# Relay-BP decoder

A rust implementation of the [Relay-BP(arXiv:2506.01779)](https://arxiv.org/abs/2506.01779)
decoder for qLDPC codes with python bindings.

[![Licensed under the Apache 2.0 open-source license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative\&logoColor=white\&style=flat-square)](https://github.com/trmue/relay/blob/main/LICENSE)
![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

[Installation](#installation) &ndash;
[Usage](#usage) &ndash;
[Paper](https://arxiv.org/abs/2506.01779) &ndash;
[Help](#help) &ndash;
[Citation](#citation) &ndash;

</div>

**Relay-BP** is an enhanced belief propagation (BP) decoder designed to overcome the limitations of standard BP when decoding quantum low-density parity-check (qLDPC) codes. It introduces three key innovations:

- *Disordered Memory Strengths* – Breaks trapping sets by diversifying memory dynamics.
- *Ensembling* – Explores a broader space of valid corrections through multiple decoding attempts.
- *Relaying* – Shares ensemble posteriors to accelerate convergence toward nearby alternative solutions.

**🔬 Performance Highlights**

Relay-BP achieves order-of-magnitude improvements in decoding performance for bivariate bicycle codes, including the Gross and Two-Gross codes. It also performs strongly on the rotated surface code, all while maintaining high throughput and hardware compatibility—especially when compared to general-purpose decoders like BP-OSD.

**✅ Tested On**
- Bivariate Bicycle (BB) Codes
- Logical Operations on/between BB code modules ([arXiv:2506.03094](https://arxiv.org/abs/2506.03094))
- Rotated Surface Codes

**💬 Get Involved**
We’re actively exploring Relay-BP and its potential extensions. If you're interested in contributing, experimenting, or just curious, feel free to:
- Open an issue for discussion
- Reach out to the authors directly

## Installation
- [Install rust](https://www.rust-lang.org/tools/install)
- (Optional) Setup a Python virtual environment and activate it:
    - `pyenv install 3.12 --keep`
    - `pyenv virtualenv 3.12 relay_bp`
    - `pyenv activate relay_bp`
- `pip install ".[stim]"` ([stim](https://github.com/quantumlib/Stim) support is optional but helpful for testing.)

## Usage
The Relay-BP package supports decoding support for decoding by setting up
the decoding problem manually by specifying a check matrix, (optional) observable matrix, and, error priors.

Alternatively, optional support for Stim+Sinter is provided to enable easy integration with other Stim based efforts.

Below we give a quick example for both the Python and Sinter APIs. However, we recommend
seeing the getting started [notebook](./examples/GettingStarted.ipynb) for a more detailed
overview of how to use the decoder.

### Python

Below is a simple program that demonstrates how to run Relay for a repetition code with the Python API:

```python
import relay_bp
import numpy as np
from scipy.sparse import csr_matrix

check_matrix = csr_matrix(np.asarray([
    [1, 1, 0],
    [0, 1, 1],
])) # detectors x error variables

decoder = relay_bp.RelayDecoderF32(
    check_matrix,
    error_priors=np.array([0.003, 0.003, 0.003], dtype=np.float64), # Set the priors probability for each error
    gamma0=0.65, # Uniform memory weight for the first ensemble
    pre_iter=80, # Max BP iterations for the first ensemble
    num_sets=100, # Number of relay ensemble elements
    set_max_iter=60, # Max BP iterations per relay ensemble
    gamma_dist_interval=(-0.24, 0.66), # Set the uniform distribution range for disordered memory weight selection
    stop_nconv=5, # Number of relay solutions to find before stopping (the best will be selected)
)

detectors = np.array([1, 1], dtype=np.uint8)

decoding = decoder.decode(detectors)

print(f"For the detectors {detectors} the decoded errors were {decoding}")
```

Will yield output:
```bash
>>> For the detectors [1 1] the decoded errors were [0 1 0]
```

If you want to decode a batch of detectors you may use `decode_batch` or `par_decode_batch`
to decode the batch in parallel.

```python
detector_batch = np.array([[0, 1], [1, 0], [1, 1]], dtype=np.uint8)

decoding = decoder.decode_batch(detector_batch)
print(decoding)
```

Giving:
```
[[0 0 1]
 [1 0 0]
 [0 1 0]]
```


### Stim + Sinter
The Relay-BP package includes optional integration with [`stim`](https://github.com/quantumlib/Stim) and [`sinter`](https://github.com/quantumlib/Stim/tree/main/glue/sample)
for constructing and running decoding experiments. Install with `pip install ".[stim]"`.

We include reference circuits for a variety of codes in [`testdata/`](./src/relay_bp/stim/testdata/) along with utility method to load these.
Below is an example of decoding the gross code with Stim + Sinter.

```python
import sinter
import multiprocessing
from relay_bp.stim import sinter_decoders
from relay_bp.stim.testdata import get_test_circuit, filter_detectors_by_basis

num_workers = multiprocessing.cpu_count()

circuit = "bicycle_bivariate_144_12_12_memory_Z"
distance = 12
rounds = 12
shots = 10000
error_rate = 0.003
XYZ_decoding = False

decoders = sinter_decoders(
    gamma0=0.1,
    pre_iter=80,
    num_sets=60,
    set_max_iter=60,
    gamma_dist_interval=(-0.24, 0.66),
    stop_nconv=1,
)

circuit = get_test_circuit(circuit=circuit, distance=distance, rounds=rounds, error_rate=error_rate)
if not XYZ_decoding:
    circuit = filter_detectors_by_basis(circuit, "Z")

task = sinter.Task(
    circuit=circuit,
    decoder="relay-bp",
    collection_options=sinter.CollectionOptions(max_shots=shots)
)

# Collect the samples (takes a few minutes).
samples = sinter.collect(
        tasks=[task],
        num_workers=num_workers,
        custom_decoders=decoders,
   )

task_output = samples[0]
print(f"Sinter execution - shots: {task_output.shots}, errors: {task_output.errors}, logical error rate: {task_output.errors/task_output.shots}")
```

Which should yield:

```bash
Sinter execution - shots: 10000, errors: 13, logical error rate: 0.0013
```

### Performance
Relay-BP is a highly configurable algorithm and may be tuned to tradeoff decoding for runtime performance.
As we describe in the [paper](https://arxiv.org/abs/2506.01779) Relay-BP decoding performance is sensitive
to the selection of the selected disordered memory weight (gamma) distribution. Empirically, this distribution is different for every decoding
graph and must be tuned. It is provided to the implementation in the form of an input distribution parameter - `gamma_dist_interval`.
Relatively good defaults are set, although tuning can yield at least an order of magnitude improvement. Similarly, the uniform memory
parameter `gamma0` must also be tuned.

Relay-BP may run until a configurable number of solutions have been found and enables the algorithm to explore a larger solution space for better quality solutions - this is controlled by the parameter `stop_nconv`.
It should be kept in mind that a better `gamma_dist_interval` will result in the number of solutions requested by `stop_nconv` to be met after fewer BP iterations.
As a result, specifying good gammas is critical to achieving good runtime performance.
In the worst-case where no solutions are found the algorithm may run for `pre_iter + num_sets*set_max_iter` BP iterations before exiting.
This can yield very poor runtime performance.

Below we summarize the parameters impacting decoding and runtime performance:
- `alpha`: Enable a check to [variable message scaling factor](https://ieeexplore.ieee.org/document/6940497) with an iteration-dependent exponential ramp. Improves BP convergence. The default is normally fine.
- `alpha_iteration_scaling_factor`: Provide the alpha scaling constant. The default is normally fine.
- `gamma0`: Set the ordered memory parameter. A default around 0.1 is normally good, but should be tuned as in the code analysis [notebooks](./examples/).
- `pre_iter`: Set the maximum number of BP iterations for the first ensemble iteration in which `gamma0` will be used. Increasing this value may improve decoding performance at the expense of runtime.
- `num_sets`: The number of Relay-BP ensembles to run. More ensembles will help improve decoding performance. However, runtime performance is very sensitive to this parameter.
- `set_max_iter`: The number of iteration to run per-ensemble. Similar to `pre_iter`.
- `gamma_dist_interval`: The uniform distribution range to select uniformly random memory weights over. The performance of Relay-BP is highly sensitive to this value and should be tuned as in the code analysis [notebooks](./examples/).
- `explicit_gammas`: Instead of selecting gammas from a uniform distribution they may be specified for each error variable. This is a 2D array of `np.float64` of shape `(num_sets, num_errors)`.
- `stop_nconv`: How many Relay ensemble solutions to find before terminating. Setting this value greater than one can better explore the solution space to improve decoding performance at the cost of running more ensemble elements (up to the max of `num_sets`).

While we make no direct claims about the performance of this implementation, it performs relatively well due to its Rust implementation which is backed by an efficient sparse array message-passing data structure with a contiguous memory layout.

#### Sinter
When running with Sinter we have noticed a relatively significant performance difference between using the packages builtin parallelism with `parallel=True` and Sinter's multiprocessing approach
to task-scheduled parallelism. For large simulations it may be important to consider a different parallelism/batching strategy with Sinter but we have not explored this in detail.


### Additional comments/features
- Stim test circuits are available in [testdata](./src/relay_bp/stim/testdata/) and may be fetched using the helper functions `relay_bp.stim.testdata.circuits.get_test_circuit` and `relay_bp.stim.testdata.circuits.get_all_test_circuits`.
- The `ObservableDecoderRunner` supports batch decoding in parallel with a progress bar as `observable_decoder.decode_batch(syndromes, parallel=True, progress_bar=False)`.
- Detailed execution information may be reported with `decode_detailed` and `decode_detailed_batch` returning a `DecodeResult`.
- A variety of Relay-BP implementation data types are available such as `RelayDecoderF32/RelayDecoderF64/RelayDecoderI32/RelayDecoderI64`. These may be further limited in their messaging precision using the input parameters `data_scale_value` and `max_data_value` to effectively explore a range of non-native precisions such as `I5`.
    - Separately a fixed point implementation is available as `MinSumBPDecoderFixed` using the Rust [fixed-point](https://docs.rs/fixed/latest/fixed/) number crate.
- The core MinSum BP implementation of Relay-BP is available as `relay_bp.MinSumBPDecoder<Type>`.

## Development

### Testing
- Python: `pytest tests/`
- Rust: `cargo test`

#### Static checks

If you are developing the package we recommend you install pre-commit and other related development tools in addition to the above:
```bash
poetry install
pre-commit install
```

This will ensure you are only ever committing code that passes the pre-commit checks.
You may manually run these checks before committing with:

```bash
pre-commit run --all-files
```

### Benchmarking
There are benchmarks bundled with the library
To run the benchmark it is as simple as
- `cargo bench`

**Profiling with Instruments**
It is also quick and easy to benchmark with Instruments on OSX.
- First install the [Cargo Instruments](https://crates.io/crates/cargo-instruments) crate with `cargo install --git https://github.com/reilabs/cargo-instruments.git --branch support-tests` (using the specific branch to enable test support)
- Then profile a specific benchmark with `cargo instruments --template time --test relay_bp --profile release -- bp::relay::tests::decode_144_12_12 --exact`. This will automatically launch the Instruments GUI when complete.
    - See the documentation of [Cargo Instruments](https://crates.io/crates/cargo-instruments) for more info on usage.
    - Make sure to click the run tab to see the output.
- You will need to make sure that debug symbols are available. Add them to the `Cargo.toml` temporarily with
    - ```toml
        [profile.release]
        debug = 1
      ```
## Python wrapper

### Development with Maturin
The project's [pyo3](https://pyo3.rs/main/doc/pyo3/) bindings are built with [maturin](https://www.maturin.rs/).
A simple way to do iterative development is to use Maturin directly:
- `pip install maturin`
- `maturin develop`

This will automatically build the relevant Rust crates, bindings and install to your activated Python installation

## Help

Relay-BP is not an IBM product. However, if you have any questions/concerns or want to report a bug/feature
please create an [issue](https://github.com/trmue/relay/issues). If you want to contribute code back to the project
please make a [pull request](https://github.com/trmue/relay/pulls).

## Citation

If you are publishing a paper or writing about the Relay-BP decoder please cite:

```
@misc{mullerImprovedBeliefPropagation2025,
  title = {Improved Belief Propagation Is Sufficient for Real-Time Decoding of Quantum Memory},
  author = {M{\"u}ller, Tristan and Alexander, Thomas and Beverland, Michael E. and B{\"u}hler, Markus and Johnson, Blake R. and Maurer, Thilo and Vandeth, Drew},
  year = {2025},
  month = jun,
  number = {arXiv:2506.01779},
  eprint = {2506.01779},
  primaryclass = {quant-ph},
  publisher = {arXiv},
  doi = {10.48550/arXiv.2506.01779},
  urldate = {2025-06-06},
  archiveprefix = {arXiv},
  keywords = {Quantum Physics},
}
```


## Disclaimer
This software is not a supported IBM product.

(C) Copyright IBM 2025


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "relay-bp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "relay, relay-bp, bp, belief propagation, quantum error correction, qec, decoder, quantum computing, quantum, stim, qldpc, ldpc",
    "author": "Thomas Alexander, Tristan M\u00fcller",
    "author_email": "Thomas Alexander <thomas.a.alexander@ibm.com>, Tristan M\u00fcller <tristan.mueller@ibm.com>",
    "download_url": "https://files.pythonhosted.org/packages/b7/c5/e1aee32d8c85009f01e234807be5372feec7b0fbfa9d137739e9c9e41c47/relay_bp-0.0.1b2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# Relay-BP decoder\n\nA rust implementation of the [Relay-BP(arXiv:2506.01779)](https://arxiv.org/abs/2506.01779)\ndecoder for qLDPC codes with python bindings.\n\n[![Licensed under the Apache 2.0 open-source license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative\\&logoColor=white\\&style=flat-square)](https://github.com/trmue/relay/blob/main/LICENSE)\n![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)\n\n[Installation](#installation) &ndash;\n[Usage](#usage) &ndash;\n[Paper](https://arxiv.org/abs/2506.01779) &ndash;\n[Help](#help) &ndash;\n[Citation](#citation) &ndash;\n\n</div>\n\n**Relay-BP** is an enhanced belief propagation (BP) decoder designed to overcome the limitations of standard BP when decoding quantum low-density parity-check (qLDPC) codes. It introduces three key innovations:\n\n- *Disordered Memory Strengths* \u2013 Breaks trapping sets by diversifying memory dynamics.\n- *Ensembling* \u2013 Explores a broader space of valid corrections through multiple decoding attempts.\n- *Relaying* \u2013 Shares ensemble posteriors to accelerate convergence toward nearby alternative solutions.\n\n**\ud83d\udd2c Performance Highlights**\n\nRelay-BP achieves order-of-magnitude improvements in decoding performance for bivariate bicycle codes, including the Gross and Two-Gross codes. It also performs strongly on the rotated surface code, all while maintaining high throughput and hardware compatibility\u2014especially when compared to general-purpose decoders like BP-OSD.\n\n**\u2705 Tested On**\n- Bivariate Bicycle (BB) Codes\n- Logical Operations on/between BB code modules ([arXiv:2506.03094](https://arxiv.org/abs/2506.03094))\n- Rotated Surface Codes\n\n**\ud83d\udcac Get Involved**\nWe\u2019re actively exploring Relay-BP and its potential extensions. If you're interested in contributing, experimenting, or just curious, feel free to:\n- Open an issue for discussion\n- Reach out to the authors directly\n\n## Installation\n- [Install rust](https://www.rust-lang.org/tools/install)\n- (Optional) Setup a Python virtual environment and activate it:\n    - `pyenv install 3.12 --keep`\n    - `pyenv virtualenv 3.12 relay_bp`\n    - `pyenv activate relay_bp`\n- `pip install \".[stim]\"` ([stim](https://github.com/quantumlib/Stim) support is optional but helpful for testing.)\n\n## Usage\nThe Relay-BP package supports decoding support for decoding by setting up\nthe decoding problem manually by specifying a check matrix, (optional) observable matrix, and, error priors.\n\nAlternatively, optional support for Stim+Sinter is provided to enable easy integration with other Stim based efforts.\n\nBelow we give a quick example for both the Python and Sinter APIs. However, we recommend\nseeing the getting started [notebook](./examples/GettingStarted.ipynb) for a more detailed\noverview of how to use the decoder.\n\n### Python\n\nBelow is a simple program that demonstrates how to run Relay for a repetition code with the Python API:\n\n```python\nimport relay_bp\nimport numpy as np\nfrom scipy.sparse import csr_matrix\n\ncheck_matrix = csr_matrix(np.asarray([\n    [1, 1, 0],\n    [0, 1, 1],\n])) # detectors x error variables\n\ndecoder = relay_bp.RelayDecoderF32(\n    check_matrix,\n    error_priors=np.array([0.003, 0.003, 0.003], dtype=np.float64), # Set the priors probability for each error\n    gamma0=0.65, # Uniform memory weight for the first ensemble\n    pre_iter=80, # Max BP iterations for the first ensemble\n    num_sets=100, # Number of relay ensemble elements\n    set_max_iter=60, # Max BP iterations per relay ensemble\n    gamma_dist_interval=(-0.24, 0.66), # Set the uniform distribution range for disordered memory weight selection\n    stop_nconv=5, # Number of relay solutions to find before stopping (the best will be selected)\n)\n\ndetectors = np.array([1, 1], dtype=np.uint8)\n\ndecoding = decoder.decode(detectors)\n\nprint(f\"For the detectors {detectors} the decoded errors were {decoding}\")\n```\n\nWill yield output:\n```bash\n>>> For the detectors [1 1] the decoded errors were [0 1 0]\n```\n\nIf you want to decode a batch of detectors you may use `decode_batch` or `par_decode_batch`\nto decode the batch in parallel.\n\n```python\ndetector_batch = np.array([[0, 1], [1, 0], [1, 1]], dtype=np.uint8)\n\ndecoding = decoder.decode_batch(detector_batch)\nprint(decoding)\n```\n\nGiving:\n```\n[[0 0 1]\n [1 0 0]\n [0 1 0]]\n```\n\n\n### Stim + Sinter\nThe Relay-BP package includes optional integration with [`stim`](https://github.com/quantumlib/Stim) and [`sinter`](https://github.com/quantumlib/Stim/tree/main/glue/sample)\nfor constructing and running decoding experiments. Install with `pip install \".[stim]\"`.\n\nWe include reference circuits for a variety of codes in [`testdata/`](./src/relay_bp/stim/testdata/) along with utility method to load these.\nBelow is an example of decoding the gross code with Stim + Sinter.\n\n```python\nimport sinter\nimport multiprocessing\nfrom relay_bp.stim import sinter_decoders\nfrom relay_bp.stim.testdata import get_test_circuit, filter_detectors_by_basis\n\nnum_workers = multiprocessing.cpu_count()\n\ncircuit = \"bicycle_bivariate_144_12_12_memory_Z\"\ndistance = 12\nrounds = 12\nshots = 10000\nerror_rate = 0.003\nXYZ_decoding = False\n\ndecoders = sinter_decoders(\n    gamma0=0.1,\n    pre_iter=80,\n    num_sets=60,\n    set_max_iter=60,\n    gamma_dist_interval=(-0.24, 0.66),\n    stop_nconv=1,\n)\n\ncircuit = get_test_circuit(circuit=circuit, distance=distance, rounds=rounds, error_rate=error_rate)\nif not XYZ_decoding:\n    circuit = filter_detectors_by_basis(circuit, \"Z\")\n\ntask = sinter.Task(\n    circuit=circuit,\n    decoder=\"relay-bp\",\n    collection_options=sinter.CollectionOptions(max_shots=shots)\n)\n\n# Collect the samples (takes a few minutes).\nsamples = sinter.collect(\n        tasks=[task],\n        num_workers=num_workers,\n        custom_decoders=decoders,\n   )\n\ntask_output = samples[0]\nprint(f\"Sinter execution - shots: {task_output.shots}, errors: {task_output.errors}, logical error rate: {task_output.errors/task_output.shots}\")\n```\n\nWhich should yield:\n\n```bash\nSinter execution - shots: 10000, errors: 13, logical error rate: 0.0013\n```\n\n### Performance\nRelay-BP is a highly configurable algorithm and may be tuned to tradeoff decoding for runtime performance.\nAs we describe in the [paper](https://arxiv.org/abs/2506.01779) Relay-BP decoding performance is sensitive\nto the selection of the selected disordered memory weight (gamma) distribution. Empirically, this distribution is different for every decoding\ngraph and must be tuned. It is provided to the implementation in the form of an input distribution parameter - `gamma_dist_interval`.\nRelatively good defaults are set, although tuning can yield at least an order of magnitude improvement. Similarly, the uniform memory\nparameter `gamma0` must also be tuned.\n\nRelay-BP may run until a configurable number of solutions have been found and enables the algorithm to explore a larger solution space for better quality solutions - this is controlled by the parameter `stop_nconv`.\nIt should be kept in mind that a better `gamma_dist_interval` will result in the number of solutions requested by `stop_nconv` to be met after fewer BP iterations.\nAs a result, specifying good gammas is critical to achieving good runtime performance.\nIn the worst-case where no solutions are found the algorithm may run for `pre_iter + num_sets*set_max_iter` BP iterations before exiting.\nThis can yield very poor runtime performance.\n\nBelow we summarize the parameters impacting decoding and runtime performance:\n- `alpha`: Enable a check to [variable message scaling factor](https://ieeexplore.ieee.org/document/6940497) with an iteration-dependent exponential ramp. Improves BP convergence. The default is normally fine.\n- `alpha_iteration_scaling_factor`: Provide the alpha scaling constant. The default is normally fine.\n- `gamma0`: Set the ordered memory parameter. A default around 0.1 is normally good, but should be tuned as in the code analysis [notebooks](./examples/).\n- `pre_iter`: Set the maximum number of BP iterations for the first ensemble iteration in which `gamma0` will be used. Increasing this value may improve decoding performance at the expense of runtime.\n- `num_sets`: The number of Relay-BP ensembles to run. More ensembles will help improve decoding performance. However, runtime performance is very sensitive to this parameter.\n- `set_max_iter`: The number of iteration to run per-ensemble. Similar to `pre_iter`.\n- `gamma_dist_interval`: The uniform distribution range to select uniformly random memory weights over. The performance of Relay-BP is highly sensitive to this value and should be tuned as in the code analysis [notebooks](./examples/).\n- `explicit_gammas`: Instead of selecting gammas from a uniform distribution they may be specified for each error variable. This is a 2D array of `np.float64` of shape `(num_sets, num_errors)`.\n- `stop_nconv`: How many Relay ensemble solutions to find before terminating. Setting this value greater than one can better explore the solution space to improve decoding performance at the cost of running more ensemble elements (up to the max of `num_sets`).\n\nWhile we make no direct claims about the performance of this implementation, it performs relatively well due to its Rust implementation which is backed by an efficient sparse array message-passing data structure with a contiguous memory layout.\n\n#### Sinter\nWhen running with Sinter we have noticed a relatively significant performance difference between using the packages builtin parallelism with `parallel=True` and Sinter's multiprocessing approach\nto task-scheduled parallelism. For large simulations it may be important to consider a different parallelism/batching strategy with Sinter but we have not explored this in detail.\n\n\n### Additional comments/features\n- Stim test circuits are available in [testdata](./src/relay_bp/stim/testdata/) and may be fetched using the helper functions `relay_bp.stim.testdata.circuits.get_test_circuit` and `relay_bp.stim.testdata.circuits.get_all_test_circuits`.\n- The `ObservableDecoderRunner` supports batch decoding in parallel with a progress bar as `observable_decoder.decode_batch(syndromes, parallel=True, progress_bar=False)`.\n- Detailed execution information may be reported with `decode_detailed` and `decode_detailed_batch` returning a `DecodeResult`.\n- A variety of Relay-BP implementation data types are available such as `RelayDecoderF32/RelayDecoderF64/RelayDecoderI32/RelayDecoderI64`. These may be further limited in their messaging precision using the input parameters `data_scale_value` and `max_data_value` to effectively explore a range of non-native precisions such as `I5`.\n    - Separately a fixed point implementation is available as `MinSumBPDecoderFixed` using the Rust [fixed-point](https://docs.rs/fixed/latest/fixed/) number crate.\n- The core MinSum BP implementation of Relay-BP is available as `relay_bp.MinSumBPDecoder<Type>`.\n\n## Development\n\n### Testing\n- Python: `pytest tests/`\n- Rust: `cargo test`\n\n#### Static checks\n\nIf you are developing the package we recommend you install pre-commit and other related development tools in addition to the above:\n```bash\npoetry install\npre-commit install\n```\n\nThis will ensure you are only ever committing code that passes the pre-commit checks.\nYou may manually run these checks before committing with:\n\n```bash\npre-commit run --all-files\n```\n\n### Benchmarking\nThere are benchmarks bundled with the library\nTo run the benchmark it is as simple as\n- `cargo bench`\n\n**Profiling with Instruments**\nIt is also quick and easy to benchmark with Instruments on OSX.\n- First install the [Cargo Instruments](https://crates.io/crates/cargo-instruments) crate with `cargo install --git https://github.com/reilabs/cargo-instruments.git --branch support-tests` (using the specific branch to enable test support)\n- Then profile a specific benchmark with `cargo instruments --template time --test relay_bp --profile release -- bp::relay::tests::decode_144_12_12 --exact`. This will automatically launch the Instruments GUI when complete.\n    - See the documentation of [Cargo Instruments](https://crates.io/crates/cargo-instruments) for more info on usage.\n    - Make sure to click the run tab to see the output.\n- You will need to make sure that debug symbols are available. Add them to the `Cargo.toml` temporarily with\n    - ```toml\n        [profile.release]\n        debug = 1\n      ```\n## Python wrapper\n\n### Development with Maturin\nThe project's [pyo3](https://pyo3.rs/main/doc/pyo3/) bindings are built with [maturin](https://www.maturin.rs/).\nA simple way to do iterative development is to use Maturin directly:\n- `pip install maturin`\n- `maturin develop`\n\nThis will automatically build the relevant Rust crates, bindings and install to your activated Python installation\n\n## Help\n\nRelay-BP is not an IBM product. However, if you have any questions/concerns or want to report a bug/feature\nplease create an [issue](https://github.com/trmue/relay/issues). If you want to contribute code back to the project\nplease make a [pull request](https://github.com/trmue/relay/pulls).\n\n## Citation\n\nIf you are publishing a paper or writing about the Relay-BP decoder please cite:\n\n```\n@misc{mullerImprovedBeliefPropagation2025,\n  title = {Improved Belief Propagation Is Sufficient for Real-Time Decoding of Quantum Memory},\n  author = {M{\\\"u}ller, Tristan and Alexander, Thomas and Beverland, Michael E. and B{\\\"u}hler, Markus and Johnson, Blake R. and Maurer, Thilo and Vandeth, Drew},\n  year = {2025},\n  month = jun,\n  number = {arXiv:2506.01779},\n  eprint = {2506.01779},\n  primaryclass = {quant-ph},\n  publisher = {arXiv},\n  doi = {10.48550/arXiv.2506.01779},\n  urldate = {2025-06-06},\n  archiveprefix = {arXiv},\n  keywords = {Quantum Physics},\n}\n```\n\n\n## Disclaimer\nThis software is not a supported IBM product.\n\n(C) Copyright IBM 2025\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Python bindings for the rust implementation of relay belief propagation for qLDPC codes.",
    "version": "0.0.1b2",
    "project_urls": {
        "Source Code": "https://github.com/trmue/relay"
    },
    "split_keywords": [
        "relay",
        " relay-bp",
        " bp",
        " belief propagation",
        " quantum error correction",
        " qec",
        " decoder",
        " quantum computing",
        " quantum",
        " stim",
        " qldpc",
        " ldpc"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4aac392526f698b6cb3c94729a7fdfd07c9ce28a918d4b0b1cb2912c96e86b1b",
                "md5": "8a38f5edbf3e912113fb4d7e8dd7b7c2",
                "sha256": "259603ebc736ea4afa8d729322aad14d3e93eafc4bc86635a0e71f28c0cc6f47"
            },
            "downloads": -1,
            "filename": "relay_bp-0.0.1b2-cp311-cp311-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "8a38f5edbf3e912113fb4d7e8dd7b7c2",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 21421515,
            "upload_time": "2025-07-25T19:35:01",
            "upload_time_iso_8601": "2025-07-25T19:35:01.075683Z",
            "url": "https://files.pythonhosted.org/packages/4a/ac/392526f698b6cb3c94729a7fdfd07c9ce28a918d4b0b1cb2912c96e86b1b/relay_bp-0.0.1b2-cp311-cp311-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b7c5e1aee32d8c85009f01e234807be5372feec7b0fbfa9d137739e9c9e41c47",
                "md5": "5b4858e7f53c6ebc7fc2a4d65fdd6c40",
                "sha256": "cf7b63f510b9555c6827fc53f11b1ba8ba2cbf354ad3ef0199ec7a4fe05fedab"
            },
            "downloads": -1,
            "filename": "relay_bp-0.0.1b2.tar.gz",
            "has_sig": false,
            "md5_digest": "5b4858e7f53c6ebc7fc2a4d65fdd6c40",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20658841,
            "upload_time": "2025-07-25T19:35:06",
            "upload_time_iso_8601": "2025-07-25T19:35:06.379533Z",
            "url": "https://files.pythonhosted.org/packages/b7/c5/e1aee32d8c85009f01e234807be5372feec7b0fbfa9d137739e9c9e41c47/relay_bp-0.0.1b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 19:35:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "trmue",
    "github_project": "relay",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "relay-bp"
}
        
Elapsed time: 1.20658s