--- id: pytket version: "2.18.1" license: Apache 2 license_treatment: permissive maintenance: active --- # pytket — Quantum computing toolkit and interface to the TKET compiler License: permissive · Maintenance: active · Downloads: 156.5K/mo ## What it is and what it does Pytket is a Python module that wraps TKET, Quantinuum's quantum computing toolkit and compiler. It provides a high-level interface for constructing quantum circuits, applying optimizations, and preparing them for execution on quantum hardware or classical simulators. The package integrates with several popular quantum software frameworks—including Qiskit, Cirq, and PennyLane—allowing circuit conversion between tools. The core use case is circuit design and optimization: you build a quantum circuit using pytket's API, apply compiler passes to reduce gate count or improve fidelity, and then export or execute the result. Pytket's runtime dependencies (numpy, scipy, networkx, sympy, lark, graphviz, jinja2, typing-extensions, and qwasm) support numerical computation, graph algorithms, and circuit serialization. Extension modules provide access to specific quantum hardware providers and simulators. Use it for: - Design and optimize quantum circuits for execution on Quantinuum quantum processors or other supported hardware. - Convert quantum circuits between Qiskit, Cirq, and PennyLane representations for interoperability. - Apply automated compilation passes (qubit routing, gate decomposition, phase gadget synthesis) to reduce circuit depth. - Prototype quantum algorithms and test them on classical simulators before hardware deployment. - Integrate quantum circuit compilation into larger quantum software pipelines or research workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pytket is a Python interface to TKET, a quantum computing toolkit and optimizing compiler that lets you build, manipulate, and compile quantum circuits for execution on quantum hardware and simulators. Yes, if you are working with quantum circuits and need a robust, actively maintained compiler and circuit manipulation framework. Pytket is well-suited for quantum algorithm development, hardware integration, and interoperability with other quantum software tools. The permissive Apache 2 license and broad platform support (Linux, macOS, Windows) lower barriers to adoption. Install friction is moderate due to multiple dependencies, but precompiled wheels are available. Avoid on macOS with conda; use an official Python distribution instead. ## Install pip install pytket uv add pytket poetry add pytket ## Installing pytket Before you install: Medium install friction: precompiled wheels available for Python 3.10–3.14 on Linux, macOS (arm64 and x86_64), and Windows, but the package carries 9 runtime dependencies including numpy, scipy, and networkx. Maintenance is active with recent releases; however, a known conda environment issue on macOS may prevent installation of recent versions. License in practice: Licensed under Apache 2 (permissive), which allows commercial and private use with minimal restrictions—suitable for most development and research contexts. Quickstart: pip install pytket import pytket from pytket import Circuit # Create a simple quantum circuit circ = Circuit(2) circ.H(0) circ.CX(0, 1) Requires Python 3.10 or later. On macOS with conda, versions more recent than 1.11.0 may fail to install; using an official Python distribution is recommended as a workaround. Verify before relying: - Whether pytket's circuit optimization capabilities are suitable for your specific quantum hardware targets or simulation needs. - Performance characteristics and scalability limits for large circuits or complex optimization passes. - Availability and maturity of pytket extension modules for your target quantum hardware or simulator. ## Package facts - License: Apache 2 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 156.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags quantum circuit compiler, quantum computing toolkit, quantum circuit optimization, quantum hardware interface, tket compiler python, quantum circuit builder, quantum software framework, quantum-computing, compiler, circuit-optimization [View on SkillFed](https://skillfed.io/packages/pytket) · [View on PyPI](https://pypi.org/project/pytket/)