pyqasm

Top level module containing the main PyQASM functionality.

Functions

load(filename)

Loads an OpenQASM program into a QasmModule object.

loads(program)

Loads an OpenQASM program into a QasmModule object.

dump(module[, filename])

Dumps the QasmModule object to a file.

dumps(module)

Dumps the QasmModule object to a string.

Classes

Qasm3Module(name, program)

A module representing an openqasm3 quantum program.

Qasm2Module(name, program)

A module representing an openqasm2 quantum program.

QasmModule(name, program)

Abstract class for a Qasm module

Exceptions

PyQasmError

Base exception for all PyQASM exceptions.

ValidationError

Exception raised when a OpenQASM program fails validation.

QasmParsingError

An error raised by the AST visitor during the AST-generation phase.