Skip to content

✨ Add controlled multiplication modulo N benchmark - #2409

Draft
denialhaag wants to merge 4 commits into
codex/add-classical-qft-adderfrom
codex/add-controlled-multiplication-modulo-n
Draft

✨ Add controlled multiplication modulo N benchmark#2409
denialhaag wants to merge 4 commits into
codex/add-classical-qft-adderfrom
codex/add-controlled-multiplication-modulo-n

Conversation

@denialhaag

Copy link
Copy Markdown
Member

Description

🤖 AI text below 🤖

Add a controlled multiplication modulo N benchmark based on Figures 5 and 6 of Beauregard's circuit for Shor's algorithm: https://arxiv.org/abs/quant-ph/0205095

Each instance prepares the control and multiplicand registers in a uniform superposition, then conditionally writes multiplier * multiplicand mod modulus to an n + 1-qubit accumulator. The logical result preserves the control, multiplicand, and accumulator so the analytic reference checks their full correlation.

Expose the benchmark through validated C++ and Python APIs, strict instance specifications and manifests, command-line discovery, and structured MLIR generation. The generator retains the modular Fourier-adder schedule, including its multi-controlled phase operations and work-qubit cleanup.

This PR is stacked on #2408.

AI notice

This PR and its contents were created with the assistance of GPT-5.6 Sol via Codex.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@denialhaag denialhaag added feature New feature or request c++ Anything related to C++ code python Anything related to Python code MLIR Anything related to MLIR labels Sep 5, 2026
@denialhaag denialhaag self-assigned this Sep 5, 2026
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
@denialhaag
denialhaag force-pushed the codex/add-controlled-multiplication-modulo-n branch from 83fc28f to 9c5d25f Compare September 5, 2026 17:34
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.59615% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bench/JSON.cpp 86.3% 3 Missing ⚠️
...bench/programs/ControlledMultiplicationModuloN.cpp 98.1% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
@denialhaag denialhaag added this to the v4.0.0 - IEEE Quantum Week milestone Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code feature New feature or request MLIR Anything related to MLIR python Anything related to Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant