openqasm3
Reference OpenQASM AST in Python
Decision gist · record as of 2026-08-14
Yes, if you are working with OpenQASM 3 quantum programs and need to parse or manipulate them programmatically. The low install friction and active maintenance make it a practical choice. However, be aware that the API is explicitly unstable and subject to breaking changes as the OpenQASM 3 language itself evolves—pin your version carefully in production code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Parser functionality requires the optional 'parser' extra; install with `pip install openqasm3[parser]` to use parsing features.
- Low install friction with no runtime dependencies for basic AST consumption.
- Actively maintained with recent releases; note that the API is explicitly in early development and not yet stable.
License · maintenance · safety
Apache 2.0 Software License (permissive) — Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions.
last release 2025-02-19 (541 days) · last repo commit 2026-08-13 · 1,497 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 483,280 downloads/mo, #6,415 on PyPI
Alternatives
Verify before relying
pip install openqasm3
import openqasm3
# Parse OpenQASM 3 text into AST
ast = openqasm3.parser.parse_file('program.qasm')- Whether the AST API stability improves in future releases or remains subject to breaking changes
- Performance characteristics when working with large or complex quantum programs
What it is and what it does
openqasm3 is a reference implementation of the OpenQASM 3 abstract syntax tree in Python, designed to help developers write compiler passes and tools for quantum programs. It provides three main components: the AST node definitions, a parser that converts OpenQASM 3 text into the tree structure, and a visitor/transformer base for traversing and modifying the AST.
The package deliberately minimizes dependencies for users who only consume the AST structure itself, with optional dependencies available for parsing functionality. It is maintained as part of the main OpenQASM project and actively developed alongside the OpenQASM 3 language specification itself, though the API is currently in early stages and not considered stable.
Use it for
- Build compiler optimization passes that analyze and transform OpenQASM 3 quantum circuits
- Parse OpenQASM 3 source files into an in-memory representation for analysis or code generation
- Traverse and modify quantum program ASTs using visitor and transformer patterns
- Develop quantum software tools that need to understand OpenQASM 3 program structure
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are working with OpenQASM 3 quantum programs and need to parse or manipulate them programmatically.
The low install friction and active maintenance make it a practical choice. However, be aware that the API is explicitly unstable and subject to breaking changes as the OpenQASM 3 language itself evolves—pin your version carefully in production code.
Install
openqasm3 on PyPI
Before you install
Low install friction with no runtime dependencies for basic AST consumption. Actively maintained with recent releases; note that the API is explicitly in early development and not yet stable.
Parser functionality requires the optional 'parser' extra; install with `pip install openqasm3[parser]` to use parsing features.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install openqasm3
import openqasm3
# Parse OpenQASM 3 text into AST
ast = openqasm3.parser.parse_file('program.qasm')
Verify before relying
- Whether the AST API stability improves in future releases or remains subject to breaking changes
- Performance characteristics when working with large or complex quantum programs
Package facts
| License | Apache 2.0 Software License permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 541 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 483,280 / month, #6,415 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering |
Evidence: openqasm3-1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “openqasm 3 ast parser”
- openqasm3Provides a reference abstract syntax tree (AST) for OpenQASM 3…
- openpulseOpenPulse parses and represents pulse grammar for quantum computing…
- qiskit-qasm3-importConverts OpenQASM 3 programs (as strings) into Qiskit QuantumCircuit…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also openpulse · qiskit-qasm3-import · oqpy · astroid · amazon-braket-schemas · qualname · luaparser · astunparse · astor · hogql-parser