Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7f3f8a6
Add Tanner Graph Walkthrough tutorial and logical error rate analysis
GiggleLiu Jan 20, 2026
abc8122
Add OSD decoder implementation with bug fixes
ChanceSiyuan Jan 21, 2026
10d709c
Update run_demo.py to use BP-only decoding by default
ChanceSiyuan Jan 21, 2026
4093e92
Fix BP+OSD decoder: use soft-weighted cost instead of Hamming weight
ChanceSiyuan Jan 21, 2026
cb4b0ac
Implement comprehensive BP+OSD decoder improvements (Phases 1-4)
ChanceSiyuan Jan 22, 2026
26a94c7
Add GPU-accelerated OSD decoder (BatchOSDDecoder)
ChanceSiyuan Jan 22, 2026
456672d
Add threshold comparison plots and update LER data
ChanceSiyuan Jan 23, 2026
735456a
Update the threshold graph
ChanceSiyuan Jan 23, 2026
c0f1870
Finish the circuit level threshold plot
ChanceSiyuan Jan 24, 2026
f663765
Realized the threshold
ChanceSiyuan Jan 24, 2026
fa41115
refactor: remove redundant osd.py (batch_osd.py covers all functional…
GiggleLiu Jan 24, 2026
9731275
refactor: remove hyperedge merging from dem.py
GiggleLiu Jan 24, 2026
8e6720e
refactor: simplify observable prediction to binary mod-2 dot product
GiggleLiu Jan 24, 2026
449055e
data: add missing d=9 p=0.009 dataset for threshold analysis
GiggleLiu Jan 24, 2026
5e59592
docs: add Getting_threshold.md with reproduction steps and reference …
GiggleLiu Jan 24, 2026
0d426e5
test: add comprehensive tests for BatchBPDecoder and BatchOSDDecoder
GiggleLiu Jan 24, 2026
3c3426e
fix: correct prob_tag format and update test expectations
GiggleLiu Jan 24, 2026
827188a
test: add non-trivial correctness tests for BP and OSD
GiggleLiu Jan 24, 2026
a11d9ba
fix: restore ^ separator handling in DEM parsing (critical for BP dec…
GiggleLiu Jan 25, 2026
bd99156
docs: explain separator splitting vs hyperedge merging in Getting_thr…
GiggleLiu Jan 25, 2026
eb2b493
test: add strict round-trip tests inspired by TensorQEC
GiggleLiu Jan 25, 2026
7822993
fix: restore hyperedge merging for optimal threshold performance
ChanceSiyuan Jan 25, 2026
fad21ef
fix: restore XOR probability chain for observable prediction
ChanceSiyuan Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ docs/*.typ
# Dataset-specific
*.npz.tmp
*.stim.bak

/.claude
70 changes: 70 additions & 0 deletions DECODER_CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# BP+OSD Decoder Configuration for p=0.001 Target

## Changes Made

### 1. Dataset Update
- **Changed from**: `sc_d3_r3_p0010_z` (p=0.010)
- **Changed to**: `sc_d3_r3_p0001_z` (p=0.001)
- Dataset contains 10,000 syndrome samples

### 2. BP Iterations Increased
- **Changed from**: `BP_MAX_ITER = 20`
- **Changed to**: `BP_MAX_ITER = 50`
- Rationale: More iterations needed for convergence at lower error rates

### 3. OSD Order
- **Maintained**: `OSD_ORDER = 15` (searches 2^15 = 32,768 candidates)
- This provides good balance between accuracy and runtime

### 4. Test Configuration
- **Samples**: 1000 (for reasonable runtime ~1.6 hours)
- **Batch size**: 50
- **Device**: CUDA (GPU acceleration enabled)

## Target Performance

According to paper http://arxiv.org/abs/2005.07016:
- **Target logical error rate**: 0.0001 (0.01%)
- **Code**: d=3 rotated surface code
- **Physical error rate**: p=0.001

## Current Status

The decoder is running with the updated configuration:
- File: `run_batch_demo.py`
- Output log: `decoder_output_1000.log`
- Monitor script: `monitor_decoder.sh`

### Preliminary Results (100 samples)
- BP-only: 0.0000 (0 errors)
- BP+OSD-15: 0.0100 (1 error)

### Expected Runtime
- ~6 seconds per sample
- 1000 samples: ~1.6 hours
- Full 10,000 samples: ~16 hours

## Monitoring Progress

To monitor the decoder progress:
```bash
./monitor_decoder.sh
```

Or check the log directly:
```bash
tail -f decoder_output_1000.log
```

## Next Steps

1. Wait for 1000-sample run to complete
2. If logical error rate is close to target (0.0001), consider running with more samples
3. If error rate is higher, may need to:
- Increase OSD order (e.g., OSD-20 or OSD-25)
- Further increase BP iterations
- Adjust damping parameter

## Files Modified

- `run_batch_demo.py`: Updated dataset path, BP_MAX_ITER, and NUM_SAMPLES
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,24 @@ python examples/evidence_example.py
python examples/minimal_example.py
```

### Tanner Graph Decoding Tutorial

For a comprehensive walkthrough of using Belief Propagation on Tanner graphs for surface code decoding, see the [Tanner Graph Walkthrough](https://giggleliu.github.io/BPDecoderPlus/tanner_graph_walkthrough/) documentation.

The walkthrough covers:

- **Tanner graph theory** - Bipartite graph representation of parity check codes
- **Complete decoding pipeline** - From circuit generation to BP decoding and evaluation
- **Visualization** - Interactive graph structures and convergence analysis
- **Parameter tuning** - Damping, tolerance, and iteration optimization
- **Hands-on examples** - Runnable code with d=3 surface code datasets

**Run the companion script:**

```bash
uv run python examples/tanner_graph_walkthrough.py
```

## Project Structure

```
Expand Down
245 changes: 0 additions & 245 deletions datasets/dems/test.dem

This file was deleted.

Loading