A Python project for learning and implementing SGrand (Soft Maximum Likelihood Decoding using GRAND with abandonment) decoding algorithms for error-correcting codes.
Provides a simple and easy-to-use framework for quickly combining codes, channels, and decoders through a runner, offering both single-run execution and Monte Carlo simulation.
Most importantly, it includes an intuitive visualization page for SGrand decoding.
This project for Jaist I437E Coding Theory Final Project Report.
Learn_SGrand_Decoding/
├── main.py # Entry point for the application
├── runner.py # Test runner and execution orchestration
├── channel.py # Channel models (e.g., AWGN)
├── codes.py # Error-correcting code implementations
├── decoder.py # SGrand decoder implementation
├── sgrand_visualization.html # Visualization output for decoding results
├── traces/ # Trace files and logs from experiments
│ ├── awgn_monte_carlo.log
│ └── trace_*.json
└── requirements.txt # Python dependencies
- Hamming codes (e.g., Hamming(8,4))
- Golay codes (e.g., Golay(24,12))
[1. Clone the repository:
git clone <repository-url>
cd Learn_SGrand_Decoding-
Install dependencies:
pip install -r requirements.txt
-
visualization:
You can view the decoding process using sgrand_visualization.html.
Either deploy the HTML file locally, or directly open:
https://www.jaist.ac.jp/~s2510082/sgrand_visualization.html
Then load one of the example JSON traces in the
tracesfolder, or generate new traces with thegenerate_SGRAND_tracefunction.
- Soft-decision decoding using SGrand algorithm
- AWGN channel simulation
- Monte Carlo simulations for performance analysis
- Query tracing and logging with timestamps
- HTML visualization of decoding results
- Support for multiple error-correcting codes
- Trace logs: JSON files in
traces/directory with formattrace_<code>_queries<N>_<timestamp>.json - Monte Carlo logs:
awgn_monte_carlo.logintraces/directory - Visualization: Interactive HTML report in
sgrand_visualization.html - Performance metrics: BER, decoding success rates, and query counts
Thanks for Gemini3 Pro, GPT5.1