-
Notifications
You must be signed in to change notification settings - Fork 4
v0.3.0: Refactor API, type hierarchy, and documentation #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-Authored-By: Claude Opus 4.5 <[email protected]>
…e_k) for all codes Add parity_matrix, code_k, parity_matrix_x, and parity_matrix_z implementations for all TensorQEC code types, enabling them to fully conform to the QECCore interface. This creates a bidirectional bridge: QECCore codes can be converted to PauliStrings (existing fallback), and TensorQEC codes can now produce parity matrices for QECCore consumers. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Provides a simplified entry point to the decoding pipeline by constructing the appropriate DecodingProblem directly from a code and error model, without requiring the user to build a Tanner graph. Co-Authored-By: Claude Opus 4.5 <[email protected]>
…ingData, qc2einsum) Rename misspelled public API names: - check_linear_indepent -> check_linear_independent - TrainningData -> TrainingData - qc2enisum -> qc2einsum Add deprecation aliases in src/deprecate.jl for backward compatibility. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Reduce exported symbols to only the public API. Internal implementation details are no longer exported but remain accessible via TensorQEC.name. Test files updated with explicit imports for previously-exported internals. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Group include statements by logical subsystem with section comments for improved readability. The dependency order is verified to compile and pass all tests. Sections: Mod2, Pauli/Clifford, Codes, Tensor Network Core, Error Models, DEM, Decoding Framework, Decoders, Measurement, Tensor Network Simulation, Inference, Yao Extensions, STIM Parser, Multiprocessing, Deprecations. Co-Authored-By: Claude Opus 4.5 <[email protected]>
These deprecations have been around since v2.x and have had sufficient time for users to migrate. The v0.3 typo-fix deprecations are retained. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
… interop Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Extend the pipeline test file with multi-decoder tests (BPDecoder, IPDecoder, MatchingDecoder, TNMAP, TNMMAP), logical error checking with zero syndromes, classical decoding problems, and round-trip error simulation across multiple code types (SteaneCode, SurfaceCode, ShorCode, ToricCode). Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Major v0.3.0 refactor to align TensorQEC with QECCore’s type hierarchy and introduce a new decoding pipeline API, alongside export cleanup and expanded documentation/tests.
Changes:
- Migrates code types to QECCore
AbstractQECC/AbstractCSSCodeand implements QECCore interface methods (e.g.,parity_matrix,code_k). - Introduces/standardizes the decoding pipeline entrypoint (
DecodingProblem→compile→decode) and adds an end-to-end pipeline test suite. - Reorganizes exports and significantly expands/structures docs (new “Getting Started” guide + API reference).
Reviewed changes
Copilot reviewed 40 out of 41 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Project.toml | Bumps package version for the release. |
| src/TensorQEC.jl | Reorganizes exports and include order around the new public API surface. |
| src/codes/codes.jl | Migrates code type hierarchy to QECCore + adds QECCore interface implementations. |
| src/codes/ldpc.jl | Updates CSSTannerGraph constructor to accept QECCore CSS abstract type. |
| src/codes/gaussian_elimination.jl | Renames linear-independence helpers to corrected spelling. |
| src/codes/code_distance.jl | Improves/updates docstring for code_distance. |
| src/decoding/interfaces.jl | Adds DecodingProblem entrypoints and expands compile/decode docs. |
| src/decoding/error_model.jl | Adds docstrings for syndrome types (SimpleSyndrome, CSSSyndrome). |
| src/decoding/bposd.jl | Updates BP decoder docs and renames linear-independence call site. |
| src/decoding/ipdecoder.jl | Expands IP decoder documentation with the new pipeline framing. |
| src/decoding/matching.jl | Updates Matching decoder documentation and API description. |
| src/decoding/tndecoder.jl | Expands TN decoder documentation with the new pipeline framing. |
| src/decoding/measurement.jl | Adds documentation for measurement circuit helper. |
| src/decoding/threshold.jl | Adds documentation for multi-round QEC simulation helper. |
| src/decoding/dem.jl | Adds documentation for detector error model types/functions. |
| src/nonclifford/simulation.jl | Renames qc2enisum → qc2einsum and adds docstrings. |
| src/nonclifford/error_learning.jl | Renames TrainningData → TrainingData and updates call sites. |
| src/stim_parser/stim_parser.jl | Expands Stim parser docstring and clarifies return type/coverage. |
| src/deprecate.jl | Replaces old deprecations with v0.3 typo-fix deprecations/aliases and notes removed exports. |
| src/clifford/tableaux.jl | Adds documentation for Tableau and tableau simulation helpers. |
| src/clifford/cliffordgroup.jl | Adds documentation for compile_clifford_circuit. |
| docs/make.jl | Adds “Getting Started” to docs navigation. |
| docs/src/guide.md | New user-facing guide for v0.3 workflows (simulation, analysis, STIM interop). |
| docs/src/man.md | Replaces generic index/autodocs with a curated API reference layout. |
| test/runtests.jl | Adds decoding pipeline tests to the test runner. |
| test/decoding/decoding_pipeline.jl | New end-to-end tests for DecodingProblem/compile/decode across codes/decoders. |
| test/decoding/bposd.jl | Updates tests to the corrected check_linear_independent name and imports. |
| test/decoding/matching.jl | Adjusts imports to reflect export cleanup for matching solver types. |
| test/decoding/measurement.jl | Adjusts imports to reflect export cleanup. |
| test/decoding/truthtable.jl | Adjusts imports to reflect export cleanup. |
| test/decoding/general_decoding.jl | Adjusts imports to reflect export cleanup. |
| test/decoding/inferenceswithencoder.jl | Adjusts imports to reflect export cleanup. |
| test/codes/codes.jl | Adds tests for QECCore type hierarchy + QECCore interface conformance. |
| test/codes/ldpc.jl | Adjusts imports to reflect export cleanup. |
| test/clifford/tableaux.jl | Adjusts imports to reflect export cleanup. |
| test/clifford/cliffordgroup.jl | Adjusts imports to reflect export cleanup. |
| test/deprecate.jl | Replaces removed v2-era deprecation tests with v0.3 typo-alias coverage. |
| test/nonclifford/simulation.jl | Updates test names and imports to reflect renamed/hidden APIs. |
| test/nonclifford/error_learning.jl | Updates tests for TrainingData rename and export cleanup. |
| test/nonclifford/tensornetwork.jl | Adjusts imports to reflect export cleanup. |
| test/nonclifford/correction.jl | Adjusts imports to reflect export cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
==========================================
+ Coverage 94.84% 94.87% +0.02%
==========================================
Files 29 29
Lines 2869 2944 +75
==========================================
+ Hits 2721 2793 +72
- Misses 148 151 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove Aqua from [deps] (test-only dependency) - Add test/Project.toml with all test dependencies - Fix method ambiguity in chsubblocks(::NumberedMeasure, ::AbstractBlock) - Fix cross-reference errors in docs (@P_str, CliffordSimulateResult) - Export code_n, code_s, code_k - Fix bare `using Yao` in test files to use TensorQEC.Yao - Add parity matrix tests for codes - Move compile() outside loop in decoding pipeline test - Fix docstring for MatchingDecoder 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
| function DecodingProblem(code::AbstractCSSCode, error_model::IndependentFlipError) | ||
| tanner = CSSTannerGraph(code) | ||
| return ClassicalDecodingProblem(tanner.stgx, error_model) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IndependentFlipError usually models bit-flip (X) errors whose syndrome is given by Z stabilizers. Using tanner.stgx here seems inverted relative to syndrome_extraction; should this be stgz, or clarify if this is meant to model phase flips?
| uuid = "0500ac79-7fb5-4262-aaea-37bb1845d1ef" | ||
| version = "0.3.0" | ||
| authors = ["Zhongyi Ni"] | ||
| version = "2.2.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version number looks wrong here. Should this be 3.0.0?
Summary
Major refactor for v0.3.0 release:
QuantumCode/CSSQuantumCodeto QECCore'sAbstractQECC/AbstractCSSCode, enabling cross-package interopDecodingProblem(code, error_model)→compile(decoder, problem)→decode(compiled, syndrome)parity_matrix,code_n,code_s,code_kcheck_linear_indepent→check_linear_independent,TrainningData→TrainingData,qc2enisum→qc2einsumBreaking Changes
AbstractQECC/AbstractCSSCodeinstead of removedQuantumCode/CSSQuantumCodeTensorQEC.nameor explicit import)PauliGroup,densitymatrix2sumofpaulis, etc.) removedTest plan
🤖 Generated with Claude Code