pyqir
What it is and what it does
PyQIR is a low-level toolkit for generating and analyzing QIR, a standardized intermediate representation for quantum programs. It is designed as a bridge for code automation and translation tools—not as a framework for direct quantum algorithm development. The package provides builders like BasicQisBuilder and SimpleModule to construct quantum operations (gates, measurements) and emit them as QIR, which can then be parsed, analyzed, or passed to downstream quantum compilers and execution platforms.
The package supports modern Python versions (3.9–3.13) and is distributed as compiled wheels for macOS, Linux, and Windows on both x86_64 and ARM64 architectures. As of version 0.12, it defaults to LLVM opaque pointers and QIR major version 2, though earlier versions are available for typed pointer compatibility. It has no runtime dependencies beyond the Python standard library.
Use it for:
- Translate quantum programs from domain-specific languages or frameworks into standardized QIR for cross-platform compilation
- Build QIR generation backends for quantum programming tools and compilers
- Parse and analyze existing QIR code for optimization, validation, or transformation
- Integrate quantum code generation into classical Python automation pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyQIR generates, parses, and analyzes QIR (Quantum Intermediate Representation) code, serving as a low-level bridge for translating quantum programs into QIR format rather than as a user-facing quantum development framework.
Yes, if you are building quantum compiler infrastructure or translation tools that need to emit or consume QIR. No, if you are writing quantum algorithms directly—use a higher-level quantum framework instead. The package is actively maintained, has no known vulnerabilities, and carries permissive licensing, but it is explicitly designed for tool developers, not end users.
Install
pyqir on PyPI
pip
pip install pyqiruv
uv add pyqirpoetry
poetry add pyqirInstalling pyqir
Before you install
Medium install friction due to compiled wheels for multiple platforms (macOS, Linux, Windows on x86_64 and ARM64); actively maintained with recent releases and no known vulnerabilities.
License in practice
Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install pyqir
from pyqir import BasicQisBuilder, SimpleModule
module = SimpleModule("Bell", num_qubits=2, num_results=2)
qis = BasicQisBuilder(module.builder)
qis.h(module.qubits[0])
qis.cx(module.qubits[0], module.qubits[1])
print(module.ir())
Requires Python 3.9 or later; PyQIR 0.12 produces QIR with opaque pointers (LLVM 18+) and major version 2 by default—use 0.11 or earlier for typed pointer output.
Verify before relying
- Whether the package is suitable for frameworks other than those explicitly mentioned in the description
- Performance characteristics when parsing or generating large QIR programs
- Specific quantum computing platforms or backends that integrate with PyQIR
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 94 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 92,693/month — #13,433 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyqir-0.12.5-cp39-abi3-macosx_10_12_x86_64.whl; pyqir-0.12.5-cp39-abi3-macosx_11_0_arm64.whl; pyqir-0.12.5-cp39-abi3-manylinux_2_34_x86_64.whl; pyqir-0.12.5-cp39-abi3-manylinux_2_38_aarch64.whl; pyqir-0.12.5-cp39-abi3-win_amd64.whl; pyqir-0.12.5-cp39-abi3-win_arm64.whl
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
qiskit-aerAer is a high-performance quantum circuit…
permissive · top 5,000 on PyPI
pypcodepypcode provides machine code disassembly and…
permissive · top 15,000 on PyPI
bfiA pure-Python interpreter for Brainfuck that…
permissive · top 15,000 on PyPI
cirqCirq is a Python framework for writing,…
permissive · top 15,000 on PyPI
pyvexPyVEX provides Python bindings to libVEX,…
copyleft · top 15,000 on PyPI
pytketPytket is a Python interface to TKET, a quantum…
permissive · top 15,000 on PyPI
amazon-braket-default-simulatorProvides a local quantum circuit simulator for…
permissive · top 15,000 on PyPI
hugrhugr provides a pure-Python implementation of…
permissive · top 15,000 on PyPI
amazon-braket-sdkProvides a Python framework to design,…
permissive · top 15,000 on PyPI
oqpyOQpy generates OpenQASM 3 and OpenPulse…
permissive · top 15,000 on PyPI