Skip to content

✨ Add controlled multiplication modulo N benchmark - #2409

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

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

Conversation

@denialhaag

@denialhaag denialhaag commented Sep 5, 2026

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.

Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
@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
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.80220% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bench/JSON.cpp 88.2% 8 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
@denialhaag
denialhaag force-pushed the codex/add-classical-qft-adder branch from bdf6b92 to 14f4f76 Compare September 7, 2026 11:43
@mergify mergify Bot added the conflict label Sep 7, 2026
@burgholzer
burgholzer force-pushed the codex/add-classical-qft-adder branch from 14f4f76 to b4bb2c7 Compare September 7, 2026 12:16
@denialhaag
denialhaag force-pushed the codex/add-classical-qft-adder branch from b4bb2c7 to 8a6a067 Compare September 7, 2026 12:54
@burgholzer
burgholzer force-pushed the codex/add-classical-qft-adder branch from 8a6a067 to b30291a Compare September 7, 2026 12:57
@denialhaag
denialhaag force-pushed the codex/add-classical-qft-adder branch from b30291a to 77e1d2d Compare September 7, 2026 13:17
@burgholzer
burgholzer force-pushed the codex/add-classical-qft-adder branch from 77e1d2d to 93001d5 Compare September 7, 2026 13:43
Base automatically changed from codex/add-classical-qft-adder to codex/add-quantum-qft-adder September 7, 2026 15:07
@burgholzer
burgholzer force-pushed the codex/add-quantum-qft-adder branch from ba68e13 to 9761141 Compare September 7, 2026 15:26
@denialhaag
denialhaag force-pushed the codex/add-quantum-qft-adder branch from 9761141 to 3339f92 Compare September 7, 2026 17:08
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 conflict 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