Skip to content

♻️ Consolidate OpenQASM import around the compiler frontend #2097

Description

@burgholzer

🤖 AI text below 🤖

Goal

Reduce the duplicated OpenQASM parser and semantic implementation while preserving lightweight QuantumComputation consumers.

Direction to evaluate

  • Make the compiler's OpenQASM parser and semantic analysis the canonical frontend.
  • Provide separate emitters for MLIR programs and QuantumComputation rather than requiring every CoreIR consumer to link the complete LLVM/MLIR stack.
  • Retire the legacy parser only after behavioral parity is demonstrated.
  • Coordinate with the compiler translation work tracked in ✨ Extend OpenQASM-to-QC translation #1733.

Required compatibility

  • OpenQASM 2 and supported OpenQASM 3 input.
  • Python QuantumComputation imports.
  • DDSIM inputs and layout comments.
  • Symbolic parameters, custom gates, control flow, diagnostics, and source locations to the extent supported today.

Acceptance criteria

  • One lexer/parser/semantic implementation serves both compiler and classic IR paths.
  • Lightweight CoreIR consumers do not acquire a runtime LLVM/MLIR dependency merely to parse OpenQASM.
  • Differential tests cover accepted programs, rejected programs, diagnostics, and constructed circuit semantics before the old frontend is deleted.

Activity

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

Metadata

Metadata

Assignees

Labels

CoreAnything related to the Core library and IRMLIRAnything related to MLIRmajorMajor version updaterefactorAnything related to code refactoring

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions