【代码贡献】补充 QSEncode 稀疏编码模块单元测试与文档示例 - #51
Open
B664577 wants to merge 1 commit into
Open
Conversation
- Test_class_basic_sparecode_QSpare_Code: 1 -> 22 用例(walsh/fourier 双模式、 参数校验异常路径、补零/截断边界、独立 WHT/DFT 矩阵与手工小例子逐值对拍) - docs/【完善文档】QSEncode稀疏编码文档与示例.md: 按官方模板补算法介绍/ 数学原理/可运行示例/限制说明 - QSEncode.py: 仅修正 docstring(构造器返回说明、Warning 行为),无逻辑改动 - 验证: 该文件 22 passed; QAlgBase 目录 32 passed 无连带破坏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动内容
test/QAlgBase/Test_class_basic_sparecode_QSpare_Code.py由 1 个用例扩充至 22 个——walsh/fourier 双模式基本功能、构造参数校验与异常路径(None/类型错误/空表/int 元素/负数/概率和偏差)、补零到 2^n 与 cut_length 截断边界、Transform与独立构造的 WHT/DFT 矩阵逐值对拍、Quantum_Res端到端小例子(1–2 比特)与手工基准值逐值对拍(atol=1e-9,模拟器结果两次运行 bit 级一致)。docs/【完善文档】QSEncode稀疏编码文档与示例.md(按官方文档模板:算法介绍 / 核心思想 / 数学原理 / 可运行示例 / 限制说明)。pyqpanda_alg/QSEncode/QSEncode.py仅修正 docstring(构造器"Returns"误述改为 Notes、Warning 抛出行为与 mode 校验时机说明、Examples 格式),无任何逻辑改动。测试
22 passedpython -m pytest QAlgBase→32 passed(无连带破坏)说明
本 PR 为 2026 CCF 本源杯开源创新赛道参赛作品(团队:量子溯源)。改动为零风险纯增量:不触碰任何核心 API 与其他模块。