Skip to content

bloqade.qasm3.emit.target.QASM3Emitter

← Module overview

classQASM3Emittersource

bloqade.qasm3.emit.target.QASM3Emitter

Emit OpenQASM 3.0 strings from QASM3 dialect IR.

Signature
class QASM3Emitter(include_files: list[str] = (lambda: ['stdgates.inc'])())

Uses abstract interpretation via EmitABC with method tables, following the same pattern as the QASM2 emitter.

Parameters

NameTypeDefaultDescription
include_fileslist[str](lambda: ['stdgates.inc'])()

Attributes

NameTypeDefaultDescription
include_fileslist[str]field(default_factory=(lambda: ['stdgates.inc']))

methodemitsource

bloqade.qasm3.emit.target.QASM3Emitter.emit

def emit(entry: ir.Method) -> str

Convert an ir.Method in QASM3 dialect to an OpenQASM 3.0 string.

Parameters

NameTypeDescription
entryir.MethodThe IR method to emit. Must be in the QASM3 dialect.

Returns

strA syntactically valid OpenQASM 3.0 string.

source