Skip to content

⚡ Speed up HRS and graph-state construction - #1119

Open
simon1hofmann wants to merge 2 commits into
mainfrom
codex/bench-construction-performance
Open

simon1hofmann wants to merge 2 commits into
mainfrom
codex/bench-construction-performance

Conversation

@simon1hofmann

@simon1hofmann simon1hofmann commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

Build each HRS multiplier's controlled adder once and reuse it for each product bit. Generate graph-state H/CZ gates directly from NetworkX edges, avoiding a dense adjacency matrix and a scan of every potential edge. Preserve the existing node-to-wire mapping and gate order for seeded graphs.

Extend arithmetic coverage with 3 × 3 and compare small seeded graph circuits with Qiskit's adjacency-matrix implementation. No new dependencies or migration steps.

Validation: full test suite on Qiskit 2.2.3 and 2.6.0 (706 passed and 4 existing expected failures on each); uvx nox -s lint; local construction timing comparisons (median of five runs: about 32× faster for a 129-qubit HRS circuit and 21× faster for a 2,000-qubit graph state). Seeded graph circuits also matched the previous implementation exactly.

AI assistance: Codex helped implement and test these MQT Bench fixes and prepare this description.

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.

@simon1hofmann simon1hofmann added enhancement New feature or request python Pull requests that update Python code mqt.bench Issues that affect mqt.bench labels Oct 25, 2026
@simon1hofmann simon1hofmann added the mqt.bench Issues that affect mqt.bench label Oct 25, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in MQT Applications Oct 25, 2026
@simon1hofmann
simon1hofmann marked this pull request as ready for review October 25, 2026 19:20
@simon1hofmann simon1hofmann self-assigned this Oct 25, 2026
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mqt.bench Issues that affect mqt.bench python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants