--- id: pyqir version: "0.12.5" license: unclear license_treatment: permissive maintenance: active --- # pyqir License: permissive · Maintenance: active · Downloads: 92.7K/mo ## 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 above — 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 pip install pyqir uv add pyqir poetry add pyqir ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 92.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags quantum intermediate representation generation, QIR parsing and analysis, quantum code translation to QIR, LLVM quantum IR tools, quantum compiler backend, quantum-computing, compiler-infrastructure, intermediate-representation [View on SkillFed](https://skillfed.io/packages/pyqir) · [View on PyPI](https://pypi.org/project/pyqir/)