Skip to content

bloqade.qasm3.loadfile

← Module overview

functionloadfilesource

bloqade.qasm3.loadfile

Signature
def loadfile(qasm_file: str | pathlib.Path, *, kernel_name: str | None = 'main', dialects: ir.DialectGroup | None = None, file: str | None = None, lineno_offset: int = 0, col_offset: int = 0, compactify: bool = True) -> ir.Method

Load an OpenQASM 3.0 file and return an ir.Method. See also loads.

Parameters

NameTypeDefaultDescription
qasm_filestr | pathlib.PathrequiredPath to the OpenQASM 3.0 file.
kernel_namestr | None'main'
dialectsir.DialectGroup | NoneNone
filestr | NoneNone
lineno_offsetint0
col_offsetint0
compactifyboolTrue

Other Parameters

NameTypeDescription
kernel_namestr | NoneThe name of the kernel. Defaults to "main".
dialectsir.DialectGroup | NoneThe dialect group to use. Defaults to `qasm3.main`.
filestr | NoneThe file name for error reporting. Defaults to None.
lineno_offsetintThe line number offset for error reporting. Defaults to 0.
col_offsetintThe column number offset for error reporting. Defaults to 0.
compactifyboolWhether to compactify the output. Defaults to True.

Returns

ir.Method

source