amazon-braket / amazon-braket/qirtoqasm

Optional emission of OpenQASM 3 physical qubits

オープン
#20 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Rust
スター
2
フォーク
1
平均マージ
3日 21時間
マージ済み PR(30日)
5

説明

**Describe the feature you'd like**
Currently the translator emits a single virtual register `qubit[N] q;` with `q[i]` indexed references everywhere a qubit is named. Add an opt-in mode that emits OpenQASM 3 physical qubits (`$0`, `$1`, …) instead, controlled by a new field on `TranslateOptions`.

**How would this feature be used? Please describe.**
Workflows that have already mapped a circuit to specific hardware qubits and want the OpenQASM 3 output to reflect that mapping — rather than re-stating it at the consumer — would set the option and receive `$N`-style references. A user-supplied permutation (or the identity mapping by default) would decide which physical qubit each QIR `%Qubit*` index maps to.

**Describe alternatives you've considered**
Post-processing the emitted OpenQASM 3 to substitute `q[i]` with `$N` is straightforward today and is the reasonable workaround. The reason to do it inside qirtoqasm is to keep the output canonical and to centralize the mapping decision.

**Additional context**
Implementing this would require: a new `Options` field, an AST variant distinct from the indexed-identifier shape used everywhere else (physical qubits are bare `$N` tokens, not `name[idx]`), printer routing, and a mapping-source decision (identity, caller-supplied table, future calibration integration). It is purely additive — the default behavior would not change.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。