openqasm

Parser for OPENQASM


Keywords
ibm, language, openqasm, parser, python, quantum
Licenses
Apache-2.0/libpng-2.0
Install
pip install openqasm==0.1.0

Documentation

openqasm

PyPI Version Build Status Dependency Status Python Version

An OPENQASM 2.0 parser for Python

Installation

pip install openqasm

Usage

from openqasm import Qasm

file_path = '/path/to/file.qasm'

# Parse the QASM file
qasm = Qasm(file_path)

# Get AST
ast = qasm.parse()

# Print the parsed QASM with precision=15
print(ast.qasm(15))

License

Apache 2.0