Skip to content

Commit 13cb07b

Browse files
authored
Merge pull request #62 from TensorBFS/fix/issue-61-cleanup
Clean up fix/osd-decoder-improvements branch (resolves #61)
2 parents 2df0cc8 + fad21ef commit 13cb07b

253 files changed

Lines changed: 647146 additions & 23745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ docs/*.typ
5252
# Dataset-specific
5353
*.npz.tmp
5454
*.stim.bak
55+
56+
/.claude

DECODER_CONFIG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# BP+OSD Decoder Configuration for p=0.001 Target
2+
3+
## Changes Made
4+
5+
### 1. Dataset Update
6+
- **Changed from**: `sc_d3_r3_p0010_z` (p=0.010)
7+
- **Changed to**: `sc_d3_r3_p0001_z` (p=0.001)
8+
- Dataset contains 10,000 syndrome samples
9+
10+
### 2. BP Iterations Increased
11+
- **Changed from**: `BP_MAX_ITER = 20`
12+
- **Changed to**: `BP_MAX_ITER = 50`
13+
- Rationale: More iterations needed for convergence at lower error rates
14+
15+
### 3. OSD Order
16+
- **Maintained**: `OSD_ORDER = 15` (searches 2^15 = 32,768 candidates)
17+
- This provides good balance between accuracy and runtime
18+
19+
### 4. Test Configuration
20+
- **Samples**: 1000 (for reasonable runtime ~1.6 hours)
21+
- **Batch size**: 50
22+
- **Device**: CUDA (GPU acceleration enabled)
23+
24+
## Target Performance
25+
26+
According to paper http://arxiv.org/abs/2005.07016:
27+
- **Target logical error rate**: 0.0001 (0.01%)
28+
- **Code**: d=3 rotated surface code
29+
- **Physical error rate**: p=0.001
30+
31+
## Current Status
32+
33+
The decoder is running with the updated configuration:
34+
- File: `run_batch_demo.py`
35+
- Output log: `decoder_output_1000.log`
36+
- Monitor script: `monitor_decoder.sh`
37+
38+
### Preliminary Results (100 samples)
39+
- BP-only: 0.0000 (0 errors)
40+
- BP+OSD-15: 0.0100 (1 error)
41+
42+
### Expected Runtime
43+
- ~6 seconds per sample
44+
- 1000 samples: ~1.6 hours
45+
- Full 10,000 samples: ~16 hours
46+
47+
## Monitoring Progress
48+
49+
To monitor the decoder progress:
50+
```bash
51+
./monitor_decoder.sh
52+
```
53+
54+
Or check the log directly:
55+
```bash
56+
tail -f decoder_output_1000.log
57+
```
58+
59+
## Next Steps
60+
61+
1. Wait for 1000-sample run to complete
62+
2. If logical error rate is close to target (0.0001), consider running with more samples
63+
3. If error rate is higher, may need to:
64+
- Increase OSD order (e.g., OSD-20 or OSD-25)
65+
- Further increase BP iterations
66+
- Adjust damping parameter
67+
68+
## Files Modified
69+
70+
- `run_batch_demo.py`: Updated dataset path, BP_MAX_ITER, and NUM_SAMPLES

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ python examples/evidence_example.py
171171
python examples/minimal_example.py
172172
```
173173

174+
### Tanner Graph Decoding Tutorial
175+
176+
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.
177+
178+
The walkthrough covers:
179+
180+
- **Tanner graph theory** - Bipartite graph representation of parity check codes
181+
- **Complete decoding pipeline** - From circuit generation to BP decoding and evaluation
182+
- **Visualization** - Interactive graph structures and convergence analysis
183+
- **Parameter tuning** - Damping, tolerance, and iteration optimization
184+
- **Hands-on examples** - Runnable code with d=3 surface code datasets
185+
186+
**Run the companion script:**
187+
188+
```bash
189+
uv run python examples/tanner_graph_walkthrough.py
190+
```
191+
174192
## Project Structure
175193

176194
```

datasets/dems/test.dem

Lines changed: 0 additions & 245 deletions
This file was deleted.

0 commit comments

Comments
 (0)