Skip to content

♻️ Move OpenQASM serialization out of operations - #2390

Merged
denialhaag merged 1 commit into
codex/backport-2262from
codex/backport-2249
Sep 5, 2026
Merged

denialhaag merged 1 commit into
codex/backport-2262from
codex/backport-2249

Conversation

@denialhaag

@denialhaag denialhaag commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Description

🤖 AI text below 🤖

Backports the OpenQASM serializer refactor to v3.x:

The refactor moves OpenQASM formatting out of the operation hierarchy and into one serializer while preserving the existing QuantumComputation export APIs and emitted OpenQASM.

This backport intentionally differs from the original implementation:

  • It exposes qasm3::Serializer from qasm3/Serializer.hpp, next to qasm3::Importer, instead of exposing qc::OpenQASMSerializer from ir/OpenQASMSerializer.hpp.
  • It moves the serialization-specific register-map aliases from qc to qasm3.
  • It keeps the implementation in CoreIR because CoreQASM already depends on CoreIR; moving the implementation between targets would create a dependency cycle or change the established CoreIR link contract.
  • It updates the v3.x changelog, upgrade guide, internal calls, and tests for the adapted API and installed path.
  • It omits the upstream internal implementation plan.

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
@denialhaag denialhaag self-assigned this Sep 4, 2026
@denialhaag denialhaag added refactor Anything related to code refactoring minor Minor version update Core Anything related to the Core library and IR c++ Anything related to C++ code OpenQASM Anything related to OpenQASM backport Changes that have been backported to a stable release branch labels Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@denialhaag

Copy link
Copy Markdown
Member Author

@burgholzer and @simon1hofmann, now that we definitely keep this around for a while, I tried moving the serializer into the qasm3 subpackage. For more information, see the PR description. Let me know what you think! 🙂

@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.

I like it 👍🏻

@denialhaag
denialhaag merged commit 317d1f7 into v3.x Sep 5, 2026
25 checks passed
@denialhaag
denialhaag deleted the codex/backport-2249 branch September 5, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Changes that have been backported to a stable release branch c++ Anything related to C++ code Core Anything related to the Core library and IR minor Minor version update OpenQASM Anything related to OpenQASM refactor Anything related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants