qbraid_qir.squin.load
- load(module, **kwargs)[source]
Converts a PyQIR module into a squin kernel.
- Parameters:
module (str | pyqir.Module) – PyQIR code or path to the .ll or .bc file, or a PyQIR Module object.
- Keyword Arguments:
kernel_name (str) – The name of the kernel to load. Defaults to “main”.
dialects (ir.DialectGroup) – The dialects to use. Defaults to squin.kernel.
register_as_argument (bool) – Determine whether the resulting kernel function should accept a single ilist.IList[Qubit, Any] argument that is a list of qubits used within the function. This allows you to compose kernel functions generated from circuits. Defaults to False.
return_measurements (list[int] | None) – Which measured qubit results to return. Default:None
register_argument_name (str) – The name of the argument that represents the qubit register. Only used when register_as_argument=True. Defaults to “q”.
globals (dict[str, Any] | None) – The global variables to use. Defaults to None.
file (str | None) – The file name for error reporting. Defaults to None.
lineno_offset (int) – The line number offset for error reporting. Defaults to 0.
col_offset (int) – The column number offset for error reporting. Defaults to 0.
compactify (bool) – Whether to compactify the output. Defaults to True.