Skip to content

♻️ Move OpenQASM serialization out of the operation hierarchy #2098

Description

@burgholzer

🤖 AI text below 🤖

Goal

Preserve the public QuantumComputation OpenQASM export behavior while removing serialization responsibilities from every operation subclass.

Scope

  • Introduce a dedicated serializer or visitor for classic IR.
  • Remove dumpOpenQASM from the Operation virtual contract and subclasses.
  • Move serializer-only register formatting aliases out of generic IR headers.
  • Preserve deterministic output, layout comments, symbolic parameters, conditions, compound operations, and Python export behavior.
  • Let QMAP own serialization for neutral-atom extensions after their extraction.

This issue concerns separation of responsibilities. It does not require classic circuits to be converted to MLIR before export.

Acceptance criteria

  • Operation classes contain no OpenQASM formatting logic.
  • Golden and round-trip tests demonstrate output compatibility.
  • Debugger and QMAP consumers of direct operation dumping have an explicit replacement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreAnything related to the Core library and IRc++Anything related to C++ codemajorMajor version updaterefactorAnything related to code refactoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions