Skip to content

【代码贡献】完善 QARM 高阶关联规则枚举 - #55

Open
woahwhattheheck wants to merge 2 commits into
OriginQ:developfrom
woahwhattheheck:origin-cup/qarm-complete-rules-20260908-sol-01
Open

woahwhattheheck wants to merge 2 commits into
OriginQ:developfrom
woahwhattheheck:origin-cup/qarm-complete-rules-20260908-sol-01

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Sep 8, 2026 •

Copy link
Copy Markdown

Summary

Related to #13.

QARM currently derives confidence rules by comparing each frequent k-itemset only with frequent (k-1)-itemsets. For a frequent 3-itemset such as {A,B,C}, that emits the 2→1 rules but misses valid 1→2 rules such as A->B,C.

This contribution keeps the existing quantum frequent-itemset search unchanged and extends only association-rule enumeration:

  • enumerate every non-empty proper subset of each frequent itemset as a possible antecedent;
  • reuse the already-computed frequent-itemset support table for confidence;
  • preserve the existing two-decimal confidence semantics and public dict result shape;
  • sort antecedent/consequent item ids when formatting rule keys so output is deterministic;
  • expose the enhanced implementation through the existing pyqpanda_alg.QARM.QuantumAssociationRulesMining package API while retaining the original QARM implementation as the base class.

Validation

The recorded focused deterministic validation covers all 12 expected rules across frequent 2- and 3-itemsets, higher-order rules under a confidence threshold, and deterministic key formatting for unordered sets. Syntax compilation also passed. Full native repository tests were not run because pyqpanda3 was unavailable in the recorded validation environment; the recorded checks above do not establish a native repository or hosted CI result.

This scope is intentionally separate from #50: that PR changes QARM search correctness in qarm.py and explicitly leaves higher-order _get_all_conf() rule enumeration unresolved. The paths are disjoint, and this subclass composes on top of the base QARM implementation.

Recorded validation snapshot: base develop at 5f973efccb84bc193157d1ccebe32137e307293b; implementation head c74d9273bdd87d4e9aacacceb25cf155c9d8dbc8; diff of 3 paths, +111/-1. Current PR head: 7c1439eb8f168af67433fca447e9bf93eb327cb7. This description update does not change the submitted source or extend the recorded validation to a different head.

Original contribution and reward claim

I, @woahwhattheheck, claim this original code contribution under the contribution-reward route described in #13 and request the applicable reward and payment. This PR was submitted on September 8, 2026, during the stated April 10–September 30 participation window. Please confirm contribution acceptance, eligibility, the applicable reward amount and the settlement process after the required maintainer review and merge. My contribution and compensation claim remain active while those decisions are pending.

I will provide my original recipient details through the official Origin Quantum Cloud community's established private payout channel identified in #13. Please confirm the appropriate official contact and required recipient information. No recipient, beneficiary or payment route is being changed.

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.

1 participant