skillfed

pytket

Quantum computing toolkit and interface to the TKET compiler

pytket v2.18.1 156.5K downloads/30d#10,782 on PyPI315
Permissive license Apache 2 Active released

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 pytket

uv

uv add pytket

poetry

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 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

Environment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering

Tags

quantum circuit compilerquantum computing toolkitquantum circuit optimizationquantum hardware interfacetket compiler pythonquantum circuit builderquantum software framework
quantum-computingcompilercircuit-optimization

More Scientific/Engineering packages