openqasm3.parser
,
and providing support for semantic analysis and utilities for program compilation.
cli
extra:
visualization
extra:
pyqasm
API.
A detailed overview of the supported QASM features can be found in the Usage Examples section.
load
and dump
load
and dump
functions are used to read QASM code from a file and write QASM code to a file, respectively.
load
: Reads QASM code from a file and returns a QasmModule
object.dump
: Writes QASM code from a QasmModule
object to a file.loads
and dumps
loads
and dumps
functions are used to read QASM code from a string and write QASM code to a string, respectively.
loads
: Reads QASM code from a string and returns a QasmModule
object.dumps
: Writes QASM code from a QasmModule
object to a string.QasmModule
objectQasmModule
object is the main data structure used to represent a QASM program. The two important
methods of the QasmModule
object are validate
and unroll
-
validate
: Used to check the semantic validity of the QASM program represented by the QasmModule
object.unroll
: Used to unroll the QASM program represented by the QasmModule
object. Also performs semantic validation
while unrolling the program.external_gates
that takes in a list of gate names
considered external to the program. Only the number of parameters and qubit arguments must
be declared for validation but the body of the gate is not required in the program.
QasmModule
and its features, please refer to our
API Reference.
Currently Supported Operations for OpenQASM language
features supported, in progress, and planned for future support.
pyqasm
tag.