Skip to content

【代码贡献】新增 Hadamard Test 复期望值估计模块 - #76

Open
tokenjunkielabs wants to merge 5 commits into
OriginQ:developfrom
woahwhattheheck:zz-iridiumloon/hadamard-test-20260920
Open

tokenjunkielabs wants to merge 5 commits into
OriginQ:developfrom
woahwhattheheck:zz-iridiumloon/hadamard-test-20260920

Conversation

@tokenjunkielabs

Copy link
Copy Markdown

关联 #13(2026 本源杯开源创新赛道|代码贡献)。

Adds a reusable pyqpanda_alg.HadamardTest module for estimating the full complex overlap ⟨ψ|U|ψ⟩ with one ancilla:

  • real component through the ancilla X basis;
  • imaginary component through the ancilla Y basis;
  • caller-supplied PyQPanda3 state-preparation and controllable-unitary circuit builders;
  • explicit q0-first data-register convention with a separate ancilla;
  • independent NumPy reference_expectation for exact state-vector comparison and input-contract checks;
  • public package export, runnable RX/|+⟩ example, and focused regression source.

For the example, |ψ⟩=|+⟩ and U=RX(θ), so the reference value is exp(-iθ/2), exercising both real and imaginary components.

Branch is based on sponsor develop@5f973efccb84bc193157d1ccebe32137e307293b; delivered fork head is e4caadd2dbd1add0ec0a6f058d923601c5bec473. Per the current owner execution directive, no test/verification run was performed and none is claimed. Maintainer CI/review remains authoritative.

Prepared with AI assistance for TokenJunkieLabs under @woahwhattheheck. Opening this PR makes no merge, prize, award, or payment claim.

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