Skip to content

【代码贡献】新增 Grover 量子计数算法 - #74

Open
tokenjunkielabs wants to merge 1 commit into
OriginQ:developfrom
woahwhattheheck:zz-sol-cinder/origin-cup-quantum-counting-20260920
Open

tokenjunkielabs wants to merge 1 commit into
OriginQ:developfrom
woahwhattheheck:zz-sol-cinder/origin-cup-quantum-counting-20260920

Conversation

@tokenjunkielabs

Copy link
Copy Markdown

概要

本提交为 #13 的代码贡献类参赛条目,补齐仓库中 Grover 振幅放大与 QAE 之间缺失的 Quantum Counting(量子计数)算法。

主要内容

  • 新增 QCount.QuantumCount:对 Grover 振幅放大算子执行相位估计,在未知解数量时估计标记态数量。
  • 复用现有 Grover.amp_operator,保持 oracle / zero-reflection 语义与仓库已有 Grover、QAE 实现一致。
  • 支持调用方提供搜索态制备、phase-marking oracle、zero reflection 与相位精度。
  • 新增 QuantumCountResult,返回估计标记态数量/比例、测量相位、bitstring、概率与 shots。
  • 新增独立 phase_to_count / count_from_bitstring 后处理 API,正确处理 Grover 共轭特征相位 phi 与 1-phi。
  • 将 QCount 暴露到 pyqpanda_alg 包,并加入 focused regression source。

按当前仓库结构,Grover.amp_operator() 文档已明确列出 Quantum Count 为振幅放大的消费者,但此前没有对应模块;此提交补齐该算法层。

未运行额外测试/验证矩阵;本提交直接提交实现与回归源文件。

相关:#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants