amazon-braket / amazon-braket/qirtoqasm
Lower QIR output-recording intrinsics to OpenQASM 3 output variables
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 5
Descripción
**Describe the feature you'd like**
Translate QIR's output-recording calls — `__quantum__rt__result_record_output`, `__quantum__rt__array_record_output`, plus the i1-load / store-to-alloca patterns some producers emit for labeled output under the Base Profile — into corresponding OpenQASM 3 `output bit[N] ;` declarations with appropriate assignments. Today these are out of scope and surface as `Unsupported`.
**How would this feature be used? Please describe.**
Producers that emit named outputs (rather than relying on positional measurement order) currently can't be translated under the Base Profile, even though their QIR is otherwise simple. A small example: a QIR module that records two results under labels `"q0"` and `"q1"` should translate to OpenQASM 3 with two `output bit[1]` declarations and assignments at the corresponding measurement sites.
**Describe alternatives you've considered**
Today users either fall back to the Adaptive Profile (which carries unrelated semantic weight) or rewrite their producer to emit unlabeled measurements. Both are workarounds rather than fixes.
**Additional context**
Output-variable lowering is largely additive: it touches the parser (recognise the intrinsics), the translator (allocate names and emit declarations + assignments), and the printer (already supports `output bit[N]` declarations). It does not require AST changes for measurement, gate, or branching nodes.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.