Target
QASM3 target emitter.
Uses the EmitABC abstract-interpretation pattern (like the QASM2 emitter) with dialect-registered method tables for dispatch.
QASM3Emitter
dataclass
QASM3Emitter(
include_files: list[str] = (lambda: ["stdgates.inc"])(),
)
Emit OpenQASM 3.0 strings from QASM3 dialect IR.
Uses abstract interpretation via EmitABC with method tables, following the same pattern as the QASM2 emitter.
emit
emit(entry: Method) -> str
Convert an ir.Method in QASM3 dialect to an OpenQASM 3.0 string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Method
|
The IR method to emit. Must be in the QASM3 dialect. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A syntactically valid OpenQASM 3.0 string. |
Source code in .venv/lib/python3.12/site-packages/bloqade/qasm3/emit/target.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |