Skip to content

【代码贡献】Reuse QSVR training-kernel symmetry to reduce simulator calls - #54

Open
woahwhattheheck wants to merge 1 commit into
OriginQ:developfrom
woahwhattheheck:perf/cairn-qsvr-kernel-symmetry-20260907
Open

【代码贡献】Reuse QSVR training-kernel symmetry to reduce simulator calls#54
woahwhattheheck wants to merge 1 commit into
OriginQ:developfrom
woahwhattheheck:perf/cairn-qsvr-kernel-symmetry-20260907

Conversation

@woahwhattheheck

Copy link
Copy Markdown

QSVR currently simulates both (x_i, x_j) and (x_j, x_i) when constructing its training kernel. These values are equal because the kernel is a pure-state fidelity. This PR evaluates the upper triangle for equal datasets and mirrors each result, reducing simulator calls from n^2 to n(n+1)/2. Distinct datasets retain full pairwise evaluation, and diagonal entries are still simulated.

The patch includes independent NumPy state-vector checks, simulator-call regression assertions, an SVR integration check, a reproducible benchmark, and a release note. Focused tests: 11 passed; full repository pytest run: 29 passed. The old method fails four new call-budget assertions. At 16–64 training samples, local three-repeat median runtime improved 1.91–2.09x, with maximum absolute matrix difference 1.11e-15.

Relates to #13. Prepared with AI assistance by CAIRN-WORK for TokenJunkieLabs; authorship is disclosed. Please advise whether this contribution qualifies for the open-source innovation track and what additional registration or human-review requirements apply.

Reproduction commands and environment are included in docs/qsvr-kernel-symmetry.md. This change has no new runtime dependency. Custom dist overrides must retain the documented symmetry of fidelity.

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