File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,20 @@ def loads(
3131 lineno_offset (int): The line number offset for error reporting. Defaults to 0.
3232 col_offset (int): The column number offset for error reporting. Defaults to 0.
3333 compactify (bool): Whether to compactify the output. Defaults to True.
34+
35+ Example:
36+
37+ ```python
38+ from bloqade import qasm2
39+ method = qasm2.loads('''
40+ OPENQASM 2.0;
41+ qreg q[2];
42+ creg c[2];
43+ h q[0];
44+ cx q[0], q[1];
45+ measure q[0] -> c[0];
46+ ''')
47+ ```
3448 """
3549 return QASM2 (dialects or main ).loads (
3650 qasm ,
@@ -54,7 +68,7 @@ def loadfile(
5468 col_offset : int = 0 ,
5569 compactify : bool = True ,
5670) -> ir .Method [[], None ]:
57- """Loads a QASM2 file and returns the corresponding kernel object.
71+ """Loads a QASM2 file and returns the corresponding kernel object. See also `loads`.
5872
5973 Args:
6074 qasm_file (str): The QASM2 file to load.
You can’t perform that action at this time.
0 commit comments