--- id: hugr version: "0.18.4" license: unclear license_treatment: permissive maintenance: active --- # hugr — Quantinuum's common representation for quantum programs License: permissive · Maintenance: active · Downloads: 92.8K/mo ## What it is and what it does hugr is a Python library that implements the Hierarchical Unified Graph Representation, a common intermediate representation for quantum programs used across the Quantinuum ecosystem. It provides a pure-Python data model and low-level API for constructing and manipulating HUGR objects, which represent quantum operations and programs as hierarchical graphs. The library is designed as a foundational dependency for higher-level quantum tools like guppylang and tket, rather than as a direct end-user tool. It depends on pydantic for data validation, graphviz for visualization, semver for version handling, and typing-extensions for type support. The package is actively maintained and supports Python 3.10 through 3.14 with prebuilt wheels for most common platforms. Use it for: - Building intermediate representations of quantum programs for compilation and optimization pipelines - Implementing quantum language frontends that need a common graph-based representation - Analyzing and transforming quantum operations within the Quantinuum ecosystem - Constructing quantum circuit graphs programmatically with type-safe validation ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. hugr provides a pure-Python implementation of the Hierarchical Unified Graph Representation (HUGR) data model for constructing and manipulating quantum programs and operations in the Quantinuum ecosystem. Yes, if you are building quantum tools or languages within the Quantinuum ecosystem or need a low-level quantum program representation. The library is actively maintained, has no known vulnerabilities, and uses a permissive license. Install friction is moderate due to compiled dependencies, but prebuilt wheels are available for most platforms. Not relevant for general-purpose Python development. ## Install pip install hugr uv add hugr poetry add hugr ## Installing hugr Before you install: Medium install friction due to compiled wheels for multiple platforms and Python versions (cp310-abi3 through cp314). Active maintenance with a release 2 days old and recent commits. Requires Python 3.10 or later. License in practice: Licensed under Apache Software License (permissive), which allows commercial and private use with minimal restrictions. Quickstart: pip install hugr from hugr import Hugr # Create a HUGR object for quantum program representation hugr_obj = Hugr() Requires Python 3.10 or later; prebuilt wheels available for common platforms but may require compilation on less common architectures. Verify before relying: - Whether graphviz dependency requires system graphviz installation or is bundled - Specific use cases and API patterns beyond 'low-level construction' mentioned in description - Performance characteristics or scalability limits for large quantum programs ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 92.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags quantum program representation, HUGR data model, quantum graph construction, quantum operation representation, quantum program intermediate representation, Quantinuum quantum tools, quantum circuit graph, quantum-computing, intermediate-representation [View on SkillFed](https://skillfed.io/packages/hugr) · [View on PyPI](https://pypi.org/project/hugr/)