Skip to content

📐 MLIR - Optionally represent angles as fixed-point (quantized) type #1128

@burgholzer

Description

@burgholzer

Background

OpenQASM 3 provides a dedicated angle type that corresponds to binary angular measure (fixed precision). Some hardware only supports limited precision (e.g., a few bits) rotation angles.

Problem

Input programs (e.g. written in OpenQASM 3) might be using this angle type and we should be able to handle them.
Furthermore, some devices may only support limited precision for rotation angles.
Thus, we would need a quantization pass for rotation angles so that the resulting circuit can actually be executed on the hardware.

Proposal:

  • Evaluate MLIR’s quant/fixed-point facilities to model angles; define a mapping and conversions to/from arith when needed.
  • Decide where angle typing lives (Ref vs Opt vs frontend-only) and document trade-offs.

This partially depends on #30 if we want to build the support for the angle type into the regular MQT Core IR.
Alternatively, one could consider adapting the existing OQ3 parser to act as a direct translator to MLIR. There is no current tracking issue for that.

Acceptance criteria:

  • Design note with chosen representation and examples; parser/lowering hooks planned or implemented.

Metadata

Metadata

Labels

MLIRAnything related to MLIRc++Anything related to C++ codefeatureNew feature or request

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions