pytket
Quantum computing toolkit and interface to the TKET compiler
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 on this page — 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
pytket on PyPI
pip
pip install pytketuv
uv add pytketpoetry
poetry add pytketInstalling 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 the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 9 — sympy, numpy, lark, scipy, networkx, graphviz, jinja2, typing-extensions, qwasm |
| Maintenance | actively maintained — 39 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 156,510/month — #10,782 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytket-2.18.1-cp310-cp310-macosx_14_0_arm64.whl; pytket-2.18.1-cp310-cp310-macosx_15_0_x86_64.whl; pytket-2.18.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pytket-2.18.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pytket-2.18.1-cp310-cp310-win_amd64.whl; pytket-2.18.1-cp311-cp311-macosx_14_0_arm64.whl; pytket-2.18.1-cp311-cp311-macosx_15_0_x86_64.whl; pytket-2.18.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pytket-2.18.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pytket-2.18.1-cp311-cp311-win_amd64.whl; pytket-2.18.1-cp312-abi3-macosx_14_0_arm64.whl; pytket-2.18.1-cp312-abi3-macosx_15_0_x86_64.whl; pytket-2.18.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pytket-2.18.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pytket-2.18.1-cp312-abi3-win_amd64.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
cirq-coreCirq-core provides the foundational framework…
permissive · top 15,000 on PyPI
qiskitQiskit is an open-source SDK for building and…
permissive · top 5,000 on PyPI
cirqCirq is a Python framework for writing,…
permissive · top 15,000 on PyPI
PyMatchingPyMatching is a fast Python/C++ library for…
permissive · top 15,000 on PyPI
qiskit-terraQiskit Terra provides the core SDK for building…
permissive · top 15,000 on PyPI
pennylanePennyLane is a quantum computing framework that…
permissive · top 15,000 on PyPI
cirq-aqtCirq-AQT provides a Cirq integration that lets…
permissive · top 15,000 on PyPI
qiskit-ibm-runtimeProvides a Python client to access IBM Quantum…
permissive · top 15,000 on PyPI
qiskit-experimentsQiskit Experiments provides tools for building,…
permissive · top 15,000 on PyPI
pyqirPyQIR generates, parses, and analyzes QIR…
permissive · top 15,000 on PyPI