Skip to content

Commit 656bfaf

Browse files
authored
More decoders2 (#253)
* add relay-bp
1 parent a31fc79 commit 656bfaf

24 files changed

Lines changed: 3590 additions & 221 deletions

File tree

Cargo.lock

Lines changed: 221 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,21 @@ pecos-chromobius = { version = "0.1.1", path = "crates/pecos-chromobius" }
167167
# Fusion Blossom decoder wrapper (pure Rust MWPM)
168168
pecos-fusion-blossom = { version = "0.1.1", path = "crates/pecos-fusion-blossom" }
169169

170+
# Relay BP decoder wrapper (pure Rust BP for qLDPC codes)
171+
pecos-relay-bp = { version = "0.1.1", path = "crates/pecos-relay-bp" }
172+
170173
# Fusion Blossom library (pure Rust MWPM decoder)
171174
fusion-blossom = "0.2"
172175

176+
# Relay BP library (pure Rust belief propagation decoder)
177+
relay-bp = "0.2"
178+
179+
# ndarray 0.16 for relay-bp compatibility (relay-bp uses ndarray 0.16, PECOS uses 0.17)
180+
ndarray-016 = { package = "ndarray", version = "0.16" }
181+
182+
# sprs for sparse matrix construction (pinned to 0.11.3 for ndarray 0.16 compat with relay-bp)
183+
sprs = "=0.11.3"
184+
173185
# petgraph for graph algorithms (used by pymatching)
174186
petgraph = "0.8"
175187

crates/pecos-decoders/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pecos-fusion-blossom = { workspace = true, optional = true }
1818
pecos-pymatching = { workspace = true, optional = true }
1919
pecos-tesseract = { workspace = true, optional = true }
2020
pecos-chromobius = { workspace = true, optional = true }
21+
pecos-relay-bp = { workspace = true, optional = true }
2122

2223
[features]
2324
default = []
@@ -26,7 +27,8 @@ fusion-blossom = ["dep:pecos-fusion-blossom"]
2627
pymatching = ["dep:pecos-pymatching"]
2728
tesseract = ["dep:pecos-tesseract"]
2829
chromobius = ["dep:pecos-chromobius"]
29-
all = ["ldpc", "fusion-blossom", "pymatching", "tesseract", "chromobius"]
30+
relay-bp = ["dep:pecos-relay-bp"]
31+
all = ["ldpc", "fusion-blossom", "pymatching", "tesseract", "chromobius", "relay-bp"]
3032

3133
[lints]
3234
workspace = true

crates/pecos-decoders/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Enable the appropriate features to include specific decoder families:
1515
- `pymatching` - PyMatching MWPM decoder
1616
- `tesseract` - Tesseract search-based decoder
1717
- `chromobius` - Chromobius color code decoder
18+
- `relay-bp` - Relay BP decoder for qLDPC codes
1819
- `all` - Enable all decoders
1920

2021
## Key Types

crates/pecos-decoders/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//! - `pymatching` - `PyMatching` MWPM decoder (C++ FFI)
1111
//! - `tesseract` - Tesseract search-based decoder (C++ FFI)
1212
//! - `chromobius` - Chromobius color code decoder (C++ FFI)
13+
//! - `relay-bp` - Relay BP decoder for qLDPC codes (pure Rust)
1314
//! - `all` - Enable all decoders
1415
1516
// Re-export core traits
@@ -80,3 +81,10 @@ pub use pecos_chromobius::{
8081
ChromobiusConfig, ChromobiusDecoder, ChromobiusError,
8182
DecodingResult as ChromobiusDecodingResult,
8283
};
84+
85+
// Re-export Relay BP decoder when feature is enabled
86+
#[cfg(feature = "relay-bp")]
87+
pub use pecos_relay_bp::{
88+
DecodingResult as RelayBpDecodingResult, MinSumBpBuilder, MinSumBpDecoder, MinSumConfig,
89+
RelayBpBuilder, RelayBpDecoder, RelayBpError, RelayConfig, StoppingCriterion,
90+
};

crates/pecos-fusion-blossom/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Wraps the Fusion Blossom minimum-weight perfect matching decoder for quantum err
1515

1616
## Acknowledgements
1717

18-
This crate wraps [Fusion Blossom](https://github.com/yuewuo/fusion-blossom), a fast MWPM decoder developed by Yue Wu, Namitha Liyanage, and Lin Zhong at Yale University.
18+
This crate wraps [Fusion Blossom](https://github.com/yuewuo/fusion-blossom), a fast MWPM decoder developed by Yue Wu and Lin Zhong at Yale University.
1919

2020
**Paper:**
21-
- Wu, Y., Liyanage, N., & Zhong, L. (2023). "Fusion Blossom: Fast MWPM Decoders for QEC." [arXiv:2305.08307](https://arxiv.org/abs/2305.08307)
21+
- Wu, Y. & Zhong, L. (2023). "Fusion Blossom: Fast MWPM Decoders for QEC." [arXiv:2305.08307](https://arxiv.org/abs/2305.08307)

crates/pecos-ldpc-decoders/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Provides LDPC (Low-Density Parity-Check) based decoders including belief propaga
2121
This crate wraps [ldpc](https://github.com/quantumgizmos/ldpc), a high-performance LDPC decoder library developed by Joschka Roffe and collaborators.
2222

2323
**Paper:**
24-
- Roffe, J., White, D. R., Burton, S., & Campbell, E. (2020). "Decoding across the quantum low-density parity-check code landscape." Physical Review Research, 2(4), 043423. [arXiv:2005.07016](https://arxiv.org/abs/2005.07016)
24+
- Roffe, J., White, D. R., Burton, S., & Campbell, E. T. (2020). "Decoding Across the Quantum LDPC Code Landscape." Physical Review Research, 2(4), 043423. [arXiv:2005.07016](https://arxiv.org/abs/2005.07016)

crates/pecos-relay-bp/Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "pecos-relay-bp"
3+
version.workspace = true
4+
edition.workspace = true
5+
readme = "README.md"
6+
authors.workspace = true
7+
homepage.workspace = true
8+
repository.workspace = true
9+
license.workspace = true
10+
keywords.workspace = true
11+
categories.workspace = true
12+
description = "Relay BP decoder for PECOS"
13+
14+
[dependencies]
15+
pecos-decoder-core.workspace = true
16+
ndarray.workspace = true
17+
ndarray-016.workspace = true
18+
thiserror.workspace = true
19+
relay-bp.workspace = true
20+
sprs.workspace = true
21+
rayon.workspace = true
22+
23+
[lib]
24+
name = "pecos_relay_bp"
25+
26+
[lints]
27+
workspace = true

crates/pecos-relay-bp/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# pecos-relay-bp
2+
3+
Relay BP decoder for PECOS.
4+
5+
## Purpose
6+
7+
Wraps the Relay BP decoder for quantum low-density parity-check (qLDPC) code decoding. Relay BP enhances standard min-sum belief propagation with disordered memory strengths, ensembling, and relaying for improved convergence on codes like bivariate bicycle codes.
8+
9+
## Key Types
10+
11+
- `RelayBpDecoder` - Relay BP ensemble decoder
12+
- `MinSumBpDecoder` - Plain min-sum BP decoder
13+
- `RelayConfig` - Relay ensemble configuration
14+
- `MinSumConfig` - Min-sum BP configuration
15+
- `RelayBpBuilder` / `MinSumBpBuilder` - Builder patterns for decoder construction
16+
17+
## Acknowledgements
18+
19+
This crate wraps [relay-bp](https://github.com/trmue/relay), a Relay BP decoder developed by Tristan Mueller, Thomas Alexander, Michael E. Beverland, Markus Buehler, Blake R. Johnson, Thilo Maurer, and Drew Vandeth.
20+
21+
**Paper:**
22+
- Mueller, T., Alexander, T., Beverland, M. E., Buehler, M., Johnson, B. R., Maurer, T., & Vandeth, D. (2025). "Improved Belief Propagation Is Sufficient for Real-Time Decoding of Quantum Memory." [arXiv:2506.01779](https://arxiv.org/abs/2506.01779)

0 commit comments

Comments
 (0)