Skip to content

Commit e1cce29

Browse files
GiggleLiuclaudeCopilot
authored
Professional restructuring for v0.1 release (#35)
* refactor: Professional restructuring for v0.1 release Transform BPDecoderPlus from training project to production-ready package. Resolves #28 ## Added - LICENSE file (MIT License) - CONTRIBUTING.md with development guidelines and setup instructions - CHANGELOG.md following Keep a Changelog format - .pre-commit-config.yaml with ruff, security checks, and file validation - .editorconfig for consistent coding styles across editors - Project URLs in pyproject.toml (Homepage, Documentation, Repository, Issues) - Maintainers field in package metadata - Ruff configuration for linting and formatting (line-length: 100) - Development dependencies: ruff, pre-commit, mypy - New Makefile targets: format, lint, lint-fix, type-check, pre-commit, check, dev-setup ## Changed - Reorganized dataset structure to single-source flat layout in datasets/ - Moved all dataset files from subdirectories to datasets/ root - Moved visualization PNGs to datasets/visualizations/ - Updated CLI default dataset path from datasets/noisy_circuits to datasets - Updated README.md to focus on Python implementation - Updated dataset documentation to reflect new structure - Fixed pyproject.toml structure (dependencies before project.urls) - Migrated tool.uv.dev-dependencies to dependency-groups.dev - Updated Makefile dataset generation paths - Moved lecture notes from docs/ to note/ directory - Updated .gitignore with development tools and binary file patterns ## Removed - Duplicate dataset files from subdirectories (circuits/, dems/, uais/, syndromes/, noisy_circuits/) - Julia code examples and references from README - Winter school training references from project description ## Testing - All 71 tests pass - Package builds and imports correctly - Dataset structure validated 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * [WIP] Update to address feedback from PR #35 for v0.1 release (#36) * Initial plan * fix: Correct package path configuration to src/bpdecoderplus Co-authored-by: GiggleLiu <6257240+GiggleLiu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: GiggleLiu <6257240+GiggleLiu@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: GiggleLiu <6257240+GiggleLiu@users.noreply.github.com>
1 parent a33645d commit e1cce29

37 files changed

Lines changed: 3916 additions & 746 deletions

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# EditorConfig helps maintain consistent coding styles across editors and IDEs
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.py]
13+
indent_style = space
14+
indent_size = 4
15+
max_line_length = 100
16+
17+
[*.{yaml,yml}]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[*.{json,json5}]
22+
indent_style = space
23+
indent_size = 2
24+
25+
[*.toml]
26+
indent_style = space
27+
indent_size = 2
28+
29+
[*.md]
30+
trim_trailing_whitespace = false
31+
max_line_length = off
32+
33+
[Makefile]
34+
indent_style = tab

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ uv.lock
3939
*.fdb_latexmk
4040
*.synctex.gz
4141
note/belief_propagation_qec_plan.pdf.claude/settings.local.json
42+
43+
# Development tools
44+
.ruff_cache/
45+
.mypy_cache/
46+
47+
# Binary files in docs (prevent future additions)
48+
# Note: note/ directory is allowed to contain PDFs/Typst files
49+
docs/*.pdf
50+
docs/*.typ
51+
52+
# Dataset-specific
53+
*.npz.tmp
54+
*.stim.bak

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-toml
9+
- id: check-added-large-files
10+
args: ['--maxkb=500']
11+
- id: check-merge-conflict
12+
- id: check-case-conflict
13+
- id: mixed-line-ending
14+
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.8.4
17+
hooks:
18+
- id: ruff
19+
args: [--fix, --exit-non-zero-on-fix]
20+
- id: ruff-format
21+
22+
- repo: https://github.com/PyCQA/bandit
23+
rev: 1.7.10
24+
hooks:
25+
- id: bandit
26+
args: ['-c', 'pyproject.toml']
27+
additional_dependencies: ['bandit[toml]']

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Changed
11+
- Reorganized dataset structure to single-source flat layout in `datasets/` directory
12+
- Updated CLI default dataset path from `datasets/noisy_circuits` to `datasets`
13+
- Moved all visualization images to `datasets/visualizations/` subdirectory
14+
- Updated package metadata in `pyproject.toml` with project URLs and maintainers
15+
- Updated README.md to focus on Python implementation
16+
- Updated dataset documentation to reflect new structure
17+
18+
### Added
19+
- LICENSE file (MIT License)
20+
- CONTRIBUTING.md with development guidelines
21+
- Project URLs in package metadata (Homepage, Documentation, Repository, Issues, Changelog)
22+
- Maintainers field in package metadata
23+
24+
### Removed
25+
- Duplicate dataset files from subdirectories (`circuits/`, `dems/`, `uais/`, `syndromes/`, `noisy_circuits/`)
26+
- Julia code examples and references from README
27+
- Winter school training references from project description
28+
29+
## [0.1.0] - 2025-01-20
30+
31+
### Added
32+
- Initial release of BPDecoderPlus
33+
- Noisy circuit generation for surface codes using Stim
34+
- Belief propagation decoder implementation using PyTorch
35+
- CLI tool for generating noisy circuits and detector error models
36+
- Support for surface code distances 3, 5, 7, 9
37+
- Syndrome database generation and storage
38+
- UAI format export for inference problems
39+
- PyTorch-based BP solver with customizable iterations
40+
- GitHub Pages documentation with MkDocs
41+
- Comprehensive test suite with pytest
42+
- CI/CD pipeline with GitHub Actions
43+
- Example datasets for d=3 surface codes with varying rounds
44+
45+
### Features
46+
- Circuit-level surface code simulation
47+
- Detector error model (DEM) generation
48+
- Syndrome extraction and database management
49+
- Multiple output formats: Stim circuits, DEM files, UAI files, NPZ syndrome databases
50+
- Configurable physical error rates and code parameters
51+
- Integration with Stim for fast quantum circuit simulation

0 commit comments

Comments
 (0)