skillfed

oqpy

Generating OpenQASM 3 + OpenPulse in Python

oqpy v0.3.10 163.7K downloads/30d#10,563 on PyPI31
Permissive license Apache-2.0 Active released

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 oqpy

uv

uv add oqpy

poetry

poetry add oqpy

Installing 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

Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Tags

openqasm 3 python generatorquantum circuit pulse controlopenpulse programming libraryquantum calibration definitionsopenqasm dsl pythonquantum hardware controlpulse-level quantum programming
quantum-computingopenqasmpulse-control

More Scientific/Engineering packages