Skip to content

✨ Add IQM move gate support and star-topology Qiskit compilation via resonator abstraction#1848

Open
marcelwa wants to merge 5 commits into
mainfrom
move-gate-and-star-topology-support
Open

✨ Add IQM move gate support and star-topology Qiskit compilation via resonator abstraction#1848
marcelwa wants to merge 5 commits into
mainfrom
move-gate-and-star-topology-support

Conversation

@marcelwa

@marcelwa marcelwa commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR finishes off the move gate support started in #1844: move circuits were already recognized in the target, but converting them to IQM JSON for job submission wasn't implemented yet, so actually submitting one just raised UnsupportedOperationError.

While at it, I pulled a couple of _build_target and run internals out into small overridable methods so IQM's star-topology backend can customize target construction and circuit preprocessing without having to duplicate the whole pipeline.

Part of this PR has been assisted by Claude Sonnet 5 in Claude Code.

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 as per our AI Usage Guidelines.
  • 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.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
python/mqt/core/plugins/qiskit/backend.py 90.1% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@marcelwa marcelwa self-assigned this Jul 3, 2026
@marcelwa marcelwa added feature New feature or request python Anything related to Python code labels Jul 3, 2026
@marcelwa

marcelwa commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a MoveGate Qiskit gate class representing IQM's opaque 2-qubit move operation, exports it from the plugin package, and integrates it into IQM JSON conversion. QDMIBackend is refactored to extract operation-to-Target mapping logic into a helper method and add two overridable extension hooks: _target_num_qubits() and _preprocess_circuit().

Changes

MoveGate Feature and Backend Extension Seams

Layer / File(s) Summary
MoveGate class definition and exports
python/mqt/core/plugins/qiskit/gates.py, python/mqt/core/plugins/qiskit/__init__.py
New MoveGate(Gate) class representing a 2-qubit "move" opcode with __dir__() and __all__; exported conditionally from the plugin package.
QDMIBackend refactor and extension hooks
python/mqt/core/plugins/qiskit/backend.py
Removes local MoveGate definition in favor of the imported class; extracts _add_operation_to_target() from _build_target(); adds overridable _target_num_qubits() and _preprocess_circuit() hooks, the latter called in run() after parameter binding.
IQM JSON conversion support
python/mqt/core/plugins/qiskit/converters.py
qiskit_to_iqm_json now recognizes MoveGate and emits a "move" instruction with a two-qubit "locus" and empty args.
Tests and changelog
test/python/plugins/qiskit/test_mock_backend.py, CHANGELOG.md
Adds tests verifying MoveGate exposure in the backend target and correct IQM JSON conversion; updates changelog with the new feature entry and PR link.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: QDMI

Suggested reviewers: burgholzer

Poem

A rabbit hops with sites in tow,
from qubit here to qubit there we go,
the move gate whispers "star-shaped hop,"
through JSON locus, never stop.
🐇✨ hooks now bend to your design—
preprocess, target, all align!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly reflects the main change: IQM move gate support plus star-topology Qiskit compilation refactoring.
Description check ✅ Passed The description includes the change summary, motivation, and context, and its checklist is mostly complete despite a few unchecked optional items.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch move-gate-and-star-topology-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/mqt/core/plugins/qiskit/backend.py`:
- Around line 259-356: _reduce complexity in _add_operation_to_target by
extracting the single- and two-qubit property population logic into a small
helper and restructuring early exits so the method has fewer return statements
and branches. Keep the behavior of _add_operation_to_target,
_get_operation_qargs, and target.add_instruction/update_instruction_properties
unchanged, but move the qargs/property update loops for one- and two-qubit
operations into a separate helper to make the override path readable and satisfy
PLR0911/PLR0912 without suppressing warnings._

In `@python/mqt/core/plugins/qiskit/converters.py`:
- Around line 125-137: The MOVE handling in converters.py duplicates the same
two-qubit locus lookup used by the CZ branch, so extract that shared logic into
a helper such as a two_qubit_locus function used by both the MoveGate and CZ
operation paths. Keep the operation-specific "name" value in each branch, but
reuse the helper for building the locus from circuit, qargs, and sites so future
empty-args two-qubit operations can share the same code path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 86756e14-6d2e-4844-aeef-d2df2b90655a

📥 Commits

Reviewing files that changed from the base of the PR and between 26a0d98 and 1f18042.

⛔ Files ignored due to path filters (2)
  • docs/fig-qpe-dark.svg is excluded by !**/*.svg
  • docs/fig-qpe-light.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • CHANGELOG.md
  • python/mqt/core/plugins/qiskit/__init__.py
  • python/mqt/core/plugins/qiskit/backend.py
  • python/mqt/core/plugins/qiskit/converters.py
  • python/mqt/core/plugins/qiskit/gates.py
  • test/python/plugins/qiskit/test_mock_backend.py

Comment thread python/mqt/core/plugins/qiskit/backend.py
Comment thread python/mqt/core/plugins/qiskit/converters.py
@marcelwa marcelwa requested a review from burgholzer July 3, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request python Anything related to Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant