Skip to content

Add IQPE benchmark#916

Open
kpassito wants to merge 3 commits into
munich-quantum-toolkit:mainfrom
kpassito:codex/issue-797-iqpe-benchmark
Open

Add IQPE benchmark#916
kpassito wants to merge 3 commits into
munich-quantum-toolkit:mainfrom
kpassito:codex/issue-797-iqpe-benchmark

Conversation

@kpassito
Copy link
Copy Markdown

@kpassito kpassito commented Jun 3, 2026

Description

This PR adds an iqpe benchmark for Iterative Quantum Phase Estimation.

The circuit uses one reusable measurement qubit and num_qubits - 1 target qubits. The num_bits parameter controls the number of measured phase bits.

Fixes #797

Tests

I added coverage for the IQPE circuit structure, invalid parameters, num_bits scaling, num_qubits scaling, and invalid qubit counts.

Local checks:

  • python -m pytest -o addopts='' tests/test_bench.py: 203 passed
  • ruff check src/mqt/bench/benchmarks/iqpe.py tests/test_bench.py: passed
  • ruff format --check src/mqt/bench/benchmarks/iqpe.py tests/test_bench.py: passed
  • git diff --check: passed

AI disclosure

Codex assisted with implementation and local testing. I reviewed the changes and take responsibility for the submitted code.

The commits include the required footer:

Assisted-by: GPT-5 Codex 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:

  • I have disclosed the use of AI tools in the PR description.
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

Assisted-by: GPT-5 Codex via Codex
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@flowerthrower flowerthrower left a comment

Choose a reason for hiding this comment

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

Dear @kpassito, thanks for the initial draft. Currently this looks like heavily AI generated. Please review our AI guidelines. I left a first quick review that you might want to address personally.

Comment thread docs/benchmark_selection.md Outdated
Comment thread src/mqt/bench/benchmarks/iqpe.py Outdated
QuantumCircuit: A dynamic IQPE circuit with mid-circuit measurements,
reset-by-feedback operations, and classically controlled rotations.
"""
if num_qubits != 2:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why constrain to 2 qubits only? should be possible for larger sizes too

if num_qubits != 2:
msg = "Number of qubits must be exactly 2 for IQPE."
raise ValueError(msg)
if num_bits < 1:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should not be the dynamic size of the benchmark (it should be num_qubits)

Comment thread CHANGELOG.md Outdated
Assisted-by: GPT-5 Codex via Codex
@kpassito
Copy link
Copy Markdown
Author

kpassito commented Jun 3, 2026

Thanks @flowerthrower, I went through the PR again and addressed the review points.

I removed the extra benchmark selection docs section, updated iqpe so num_qubits controls the circuit width, and fixed the changelog entry with the PR number and author.

I also reran the local checks listed in the PR description.

@flowerthrower
Copy link
Copy Markdown
Collaborator

flowerthrower commented Jun 5, 2026

Dear @kpassito, thank you for your continued efforts. Please give us some time to review. We are currently internally discussing the best way forward for this Benchmark.

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.

✨ Iterative Quantum Phase Estimation (IQPE)

2 participants