pytket
Source code for the TKET quantum compiler, Python bindings and utilities
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Source code for the TKET quantum compiler, Python bindings and utilities
Basic Info
- Host: GitHub
- Owner: CQCL
- License: apache-2.0
- Language: C++
- Default Branch: main
- Homepage: https://docs.quantinuum.com/tket/
- Size: 324 MB
Statistics
- Stars: 284
- Watchers: 21
- Forks: 50
- Open Issues: 83
- Releases: 202
Topics
Metadata Files
README.md
tket
Introduction
TKET (pronounced "ticket") is a high-performance quantum compiler that can optimise circuits for a wide range of quantum computing architectures.
This repository contains the full source code for TKET and its python bindings.
The standard way of using TKET is via its pytket python API.
If you just want to use TKET via Python, the easiest way is to install pytket with
pip:
shell
pip install pytket
As well as being an interface to the TKET compiler, pytket also provides an extensive API for other quantum computing tasks. These include constructing quantum circuits and handling the execution of experiments on devices and simulators.
Documentation
The tket (C++) API documentation (generated with doxygen, and still rather
patchy) is available
here.
The pytket (Python) API documentation is available
here.
For getting started using pytket, check out the user manual and notebook examples.
The source content for the manual and notebook examples can be found in the pytket-docs repository.
Extensions
In addition to the core pytket package there are pytket extension modules which allow pytket to interface with quantum devices and simulators. Some extensions also provide interoperability with other software libraries such as qiskit, cirq and pennylane.
For a list of available pytket extensions see the extensions index page.
These extensions are installed as separate python packages and the source code for each extension lives in its own github repository.
How to build TKET and pytket
If you would like to build TKET yourself and help to improve it, read on!
The codebase is split into two main projects:
- tket: the core functionality of tket, optimised for execution speed
and implemented in C++.
- pytket: the Python interface of tket. This consists of
binder modules to tket (written in C++ and making use of pybind11 to link to the tket
shared library) and pure Python code that defines abstract interfaces
used by the extension modules such as the Backend and BackendResult classes,
as well as various other utilities.
There is further a limited subset of the C++ functionality that is exposed through
a C API in the tket-c-api directory. This project is experimental, and
we make no guarantees about its stability or future compatibility.
Prerequisites
Build tools
The following compiler toolchains are used to build tket on the CI and are therefore known to work:
- Linux: gcc-13
- MacOS: apple-clang 15
- Windows: MSVC 19
It is recommended that you use these versions to build locally, as code may
depend on the features they support. The compiler version can be controlled by
setting CC and CXX in your environment (e.g. CC=gcc-11 and CXX=g++-11),
or on Debian-based Linux systems using update-alternatives.
You should also have Python (3.10, 3.11, 3.12 or 3.13) and pip installed. We
use cmake and the package manager conan to build tket and pytket. The latter
can be installed with pip:
shell
pip install conan
You will need at least cmake version 3.26, and conan version 2.
Set up conan profile
Generate a profile that matches your current machine, and add the required remote where some dependencies are stored:
shell
conan profile detect
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
Optional: use ninja and ccache
It is recommended that you also install ninja and ccache to speed up the
build process. For example with apt on Debian/Ubuntu:
shell
apt install ninja-build ccache
Homebrew on MacOS/Linux:
shell
brew install ninja ccache
Chocolatey on Windows:
shell
choco install ninja ccache
On MacOS/Linux:
- If installed,
ccacheis used automatically ninjamust either be set as the default Cmake generator using the following command:shell echo "tools.cmake.cmaketoolchain:generator = Ninja" >> $(conan config home)/global.confor be specified on a command-by-command basis by providing the argument-c tools.cmake.cmaketoolchain:generator=Ninjato conan
On Windows:
- Set ninja as generator as described above (less reliable than the default Visual Studio generator)
- ccache will be used automatically only when using Ninja or Makefile as the Cmake generator. It can
also be used with Visual Studio generators by setting the environment
variable TKET_VSGEN_CCACHE_EXE to the path of the ccache executable. Note: this
must be the path to the actual binary, not a symlink or shim (as used by Chocolatey). If using Chocolatey
to install ccache, you can find the path to the binary using ccache --shimgen-help
Building and testing the utility libraries
See the README in the libs directory for instructions on
building and testing the utility libraries used by tket (for logging,
random-number generation and so on). This is not necessary if you just want to
build tket or pytket since the recipes or binaries will be automatically
downloaded from the above conan remote.
Building and testing the tket library
See the README in the tket directory for instructions on
building and testing tket as a standalone C++ library.
Building and testing pytket
See the README in the pytket directory for instructions on
building and testing pytket.
Owner
- Name: Cambridge Quantum
- Login: CQCL
- Kind: organization
- Location: Cambridge, UK
- Website: http://www.cambridgequantum.com
- Repositories: 48
- Profile: https://github.com/CQCL
Quantum Software and Technologies
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Alec Edgington | 5****c | 729 |
| yao-cqc | 7****c | 97 |
| Silas Dilkes | 3****s | 73 |
| cqc-melf | 7****f | 71 |
| CalMacCQ | 9****Q | 61 |
| dependabot[bot] | 4****] | 37 |
| Luca Mondada | 7****a | 31 |
| Will Simmons | w****s@c****m | 28 |
| Travis Thompson | 1****o | 23 |
| Agustin Borgna | a****a@q****m | 20 |
| seyon | s****h@c****m | 17 |
| Tiffany Duneau | 3****6 | 16 |
| Jake Arkinstall | 6****l | 11 |
| Roland-djee | 9****e | 8 |
| Fernando Betanzo Sanchez | f****z@c****m | 6 |
| Roland Guichard | r****d@c****m | 6 |
| Dan Mills | 5****c | 4 |
| John Children | 3****n | 4 |
| Aidan | 1****Q | 4 |
| jpacold | j****d@g****m | 4 |
| drzenharper | 7****r | 4 |
| Alexander Cowtan | 4****n | 2 |
| David Yonge-Mallo | d****o | 2 |
| Pablo Andres-Martinez | 1****Q | 2 |
| Kartik Singhal | k****l@q****m | 2 |
| Dominik Schmid | d****3@g****m | 1 |
| Israel Reichental | 3****e | 1 |
| Monit Sharma | 6****a | 1 |
| Richard Morrison | 1****n | 1 |
| Thien Nguyen | 5****n | 1 |
| and 5 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 390
- Total pull requests: 1,229
- Average time to close issues: 3 months
- Average time to close pull requests: 5 days
- Total issue authors: 51
- Total pull request authors: 29
- Average comments per issue: 1.02
- Average comments per pull request: 0.57
- Merged pull requests: 980
- Bot issues: 0
- Bot pull requests: 54
Past Year
- Issues: 144
- Pull requests: 488
- Average time to close issues: 18 days
- Average time to close pull requests: 1 day
- Issue authors: 29
- Pull request authors: 14
- Average comments per issue: 0.67
- Average comments per pull request: 0.27
- Merged pull requests: 402
- Bot issues: 0
- Bot pull requests: 23
Top Authors
Issue Authors
- cqc-alec (192)
- CalMacCQ (32)
- yao-cqc (31)
- cqc-melf (22)
- daniel-mills-cqc (16)
- sjdilkes (11)
- MattePalte (9)
- IlanIwumbwe (6)
- p51lee (6)
- lmondada (3)
- Bennybenassius (3)
- willsimmons1465 (3)
- andrew-tranter (3)
- nquetschlich (3)
- yoshi-qc (3)
Pull Request Authors
- cqc-alec (649)
- CalMacCQ (131)
- cqc-melf (89)
- yao-cqc (71)
- sjdilkes (69)
- dependabot[bot] (54)
- willsimmons1465 (36)
- jake-arkinstall (18)
- trvto (18)
- daniel-mills-cqc (14)
- wintertimem (12)
- DNA386 (12)
- jpacold (8)
- PabloAndresCQ (7)
- lmondada (6)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 72,909 last-month
- Total docker downloads: 50
-
Total dependent packages: 40
(may contain duplicates) -
Total dependent repositories: 48
(may contain duplicates) - Total versions: 400
- Total maintainers: 6
pypi.org: pytket
Quantum computing toolkit and interface to the TKET compiler
- Documentation: https://docs.quantinuum.com/tket/api-docs/
- License: Apache 2
-
Latest release: 2.9.3
published 6 months ago
Rankings
Maintainers (5)
proxy.golang.org: github.com/cqcl/tket
- Documentation: https://pkg.go.dev/github.com/cqcl/tket#section-documentation
- License: apache-2.0
-
Latest release: v2.9.1+incompatible
published 7 months ago
Rankings
proxy.golang.org: github.com/CQCL/tket
- Documentation: https://pkg.go.dev/github.com/CQCL/tket#section-documentation
- License: apache-2.0
-
Latest release: v2.9.1+incompatible
published 7 months ago
Rankings
pypi.org: pytket-offline-display
Python module for displaying pytket circuits when offline.
- Documentation: https://cqcl.github.io/tket/pytket/api/index.html
- License: Apache 2
-
Latest release: 0.0.9
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- dorny/paths-filter v2.11.1 composite
- hendrikmuhs/ccache-action v1.2.8 composite
- josStorer/get-current-time v2.0.2 composite
- turtlebrowser/get-conan v1.1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- dorny/paths-filter v2.11.1 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- dorny/paths-filter v2.11.1 composite
- hendrikmuhs/ccache-action v1.2.8 composite
- josStorer/get-current-time v2.0.2 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- atlassian/gajira-create v3.0.1 composite
- atlassian/gajira-login v3.0.1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- turtlebrowser/get-conan v1.1 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- turtlebrowser/get-conan v1.1 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- dorny/paths-filter v2.11.1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- dorny/paths-filter v2.11.1 composite
- hendrikmuhs/ccache-action v1.2.8 composite
- josStorer/get-current-time v2.0.2 composite
- turtlebrowser/get-conan v1.1 composite
- sphinx >=4.5
- sphinx_autodoc_annotation >=1.0
- sphinx_book_theme >=0.3
- graphviz *
- jinja2 *
- lark-parser *
- networkx *
- numpy *
- qwasm *
- scipy *
- sympy *
- types-pkg_resources *
- typing-extensions *
- autoray * test
- docker * test
- hypothesis * test
- jsonschema * test
- opt_einsum * test
- py * test
- pytest * test
- pytest-benchmark * test
- pytest-cov * test
- quimb * test
- actions/checkout v4 composite
- actions/setup-python v4 composite
- hendrikmuhs/ccache-action v1.2 composite
- actions/checkout v4 composite
- cachix/install-nix-action v24 composite
- pytket *