oqpy
Generating OpenQASM 3 + OpenPulse in Python
What it is and what it does
OQpy is a Python library for programmatically generating OpenQASM 3 quantum programs with OpenPulse calibration support. It wraps the abstract syntax trees of both OpenQASM 3 and OpenPulse, allowing developers to write quantum circuits and pulse-level control definitions in Python rather than directly in OpenQASM text. The library depends on openpulse, numpy, and mypy-extensions, and is designed for quantum researchers and hardware engineers who need to specify both high-level quantum gates and low-level pulse implementations for near-term quantum processors.
The package targets the intersection of quantum software development and hardware control, where users need to define not just what quantum operations to perform but exactly how those operations are implemented at the pulse level on specific hardware architectures. It supports explicit timing, classical logic, and hardware-specific calibration blocks, making it suitable for characterization experiments, pulse optimization, and hardware-aware quantum algorithm development.
Use it for:
- Define Ramsey interferometry and other qubit characterization experiments with precise pulse-level control.
- Generate calibration definitions (defcal blocks) for quantum gates on specific hardware architectures.
- Build quantum circuits that mix high-level gate definitions with low-level pulse waveform specifications.
- Programmatically create OpenQASM 3 programs with classical control flow and variable delays.
- Develop pulse-based quantum algorithms for superconducting qubit systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OQpy generates OpenQASM 3 and OpenPulse programs in Python, providing a high-level interface to build quantum circuits with pulse-level control and calibration definitions.
Yes. OQpy is actively maintained, has no known vulnerabilities, and fills a specific niche for developers working with OpenQASM 3 and pulse-level quantum control. The low install friction and permissive license make adoption straightforward. Install it if you need to generate OpenQASM 3 programs with pulse calibrations from Python; skip it if you only work with high-level quantum circuit abstractions.
Install
oqpy on PyPI
pip
pip install oqpyuv
uv add oqpypoetry
poetry add oqpyInstalling oqpy
Before you install
Low friction install with a pure-wheel distribution. Actively maintained with a recent release and no known vulnerabilities. Supports Python 3.8 through 3.14.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, typical for open-source scientific software.
Quickstart
pip install oqpy
import oqpy
prog = oqpy.Program()
qubit = oqpy.PhysicalQubits[0]
prog.reset(qubit).gate(qubit, "x90").measure(qubit)
print(prog.to_qasm())
Requires Python 3.8 or greater; openpulse and numpy must be available at runtime.
Verify before relying
- Whether the package includes comprehensive documentation or tutorials beyond the example in the README.
- Performance characteristics when generating large or complex quantum programs.
- Stability of the API across minor versions (currently at 0.3.10).
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — openpulse, numpy, mypy-extensions |
| Maintenance | actively maintained — 170 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 163,731/month — #10,563 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oqpy-0.3.10-py3-none-any.whl
Keywords: openqasm, quantum
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
openpulseOpenPulse parses and represents pulse grammar…
permissive · top 15,000 on PyPI
qiskit-qasm3-importConverts OpenQASM 3 programs (as strings) into…
permissive · top 15,000 on PyPI
broadbeanBroadbean composes and manipulates pulse…
permissive · top 15,000 on PyPI
openqasm3Provides a reference abstract syntax tree (AST)…
permissive · top 15,000 on PyPI
qm-quaQM-QUA is a Python SDK that implements QUA, a…
permissive · top 15,000 on PyPI
cirqCirq is a Python framework for writing,…
permissive · top 15,000 on PyPI
qiskitQiskit is an open-source SDK for building and…
permissive · top 5,000 on PyPI
pytketPytket is a Python interface to TKET, a quantum…
permissive · top 15,000 on PyPI
cirq-googleProvides access to Google's Quantum Computing…
permissive · top 15,000 on PyPI
openfermionOpenFermion compiles and analyzes quantum…
permissive · top 15,000 on PyPI