{"id":13536126,"url":"https://github.com/CQCL/tket","last_synced_at":"2025-04-02T02:32:24.025Z","repository":{"id":36956794,"uuid":"405970114","full_name":"CQCL/tket","owner":"CQCL","description":"Source code for the TKET quantum compiler, Python bindings and utilities","archived":false,"fork":false,"pushed_at":"2025-03-07T16:46:18.000Z","size":982854,"stargazers_count":273,"open_issues_count":85,"forks_count":49,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-03-07T19:37:31.968Z","etag":null,"topics":["compiler","quantum-computing"],"latest_commit_sha":null,"homepage":"https://docs.quantinuum.com/tket/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CQCL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T12:46:23.000Z","updated_at":"2025-03-05T16:53:39.000Z","dependencies_parsed_at":"2024-03-25T11:53:58.872Z","dependency_job_id":"deb9455f-fdb5-4f40-ac01-3466ed1ea934","html_url":"https://github.com/CQCL/tket","commit_stats":{"total_commits":585,"total_committers":28,"mean_commits":"20.892857142857142","dds":0.535042735042735,"last_synced_commit":"018e2f2604a19a5d31d5d4c780685115c554f88e"},"previous_names":[],"tags_count":186,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Ftket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Ftket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Ftket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Ftket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CQCL","download_url":"https://codeload.github.com/CQCL/tket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246342903,"owners_count":20761944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","quantum-computing"],"created_at":"2024-08-01T09:00:35.031Z","updated_at":"2025-04-02T02:32:22.855Z","avatar_url":"https://github.com/CQCL.png","language":"C++","funding_links":[],"categories":["Quantum SDKs","Quantum compilers"],"sub_categories":[],"readme":"# tket\n\n[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge\u0026logo=slack\u0026logoColor=white)](https://tketusers.slack.com/join/shared_invite/zt-18qmsamj9-UqQFVdkRzxnXCcKtcarLRA#)\n[![Stack Exchange](https://img.shields.io/badge/StackExchange-%23ffffff.svg?style=for-the-badge\u0026logo=StackExchange)](https://quantumcomputing.stackexchange.com/tags/pytket)\n[![PyPI version](https://badge.fury.io/py/pytket.svg)](https://badge.fury.io/py/pytket)\n\n## Introduction\n\nTKET (pronounced \"ticket\") is a high-performance quantum compiler that can optimise circuits for a wide range of quantum computing architectures.\n\nThis repository contains the full source code for TKET and its python bindings.\n\nThe standard way of using TKET is via its pytket python API.\n\nIf you just want to use TKET via Python, the easiest way is to install pytket with\n`pip`:\n\n```shell\npip install pytket\n```\n\nAs 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.\n\n## Documentation\n\nThe `tket` (C++) API documentation (generated with `doxygen`, and still rather\npatchy) is available\n[here](https://cqcl.github.io/tket/tket/api/index.html).\n\nThe `pytket` (Python) API documentation is available\n[here](https://docs.quantinuum.com/tket/api-docs).\n\nFor getting started using pytket, check out the [user manual and notebook examples](https://docs.quantinuum.com/tket/user-guide/).\n\n\nThe source content for the manual and notebook examples can be found in the [pytket-docs repository](https://github.com/CQCL/pytket-docs).\n\n## Extensions\n\nIn 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.\n\nFor a list of available pytket extensions see the [extensions index page](https://docs.quantinuum.com/tket/api-docs/extensions).\n\nThese extensions are installed as separate python packages and the source code for each extension lives in its own github repository.\n\n## How to build TKET and pytket\n\nIf you would like to build TKET yourself and help to improve it, read on!\n\nThe codebase is split into two main projects:\n - [tket](tket): the core functionality of tket, optimised for execution speed\n   and implemented in C++.\n - [pytket](pytket): the Python interface of tket. This consists of\n   binder modules to tket (written in C++ and making use of `pybind11` to link to the tket\n   shared library) and pure Python code that defines abstract interfaces \n   used by the extension modules such as the `Backend` and `BackendResult` classes,\n   as well as various other utilities.\n\n### Prerequisites\n\n#### Build tools\n\nThe following compiler toolchains are used to build tket on the CI and are\ntherefore known to work:\n\n* Linux: gcc-13\n* MacOS: apple-clang 15\n* Windows: MSVC 19\n\nIt is recommended that you use these versions to build locally, as code may\ndepend on the features they support. The compiler version can be controlled by\nsetting `CC` and `CXX` in your environment (e.g. `CC=gcc-11` and `CXX=g++-11`),\nor on Debian-based Linux systems using `update-alternatives`.\n\nYou should also have Python (3.10, 3.11, 3.12 or 3.13) and `pip` installed. We\nuse `cmake` and the package manager `conan` to build tket and pytket. The latter\ncan be installed with `pip`:\n\n```shell\npip install conan\n```\n\nYou will need at least cmake version 3.26, and conan version 2.\n\n\n#### Set up `conan` profile\n\nGenerate a profile that matches your current machine, and add the required\nremote where some dependencies are stored:\n\n```shell\nconan profile detect\nconan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0\n```\n\n#### Optional: use `ninja` and `ccache`\n\nIt is recommended that you also install `ninja` and `ccache` to speed up the\nbuild process. For example with `apt` on Debian/Ubuntu:\n```shell\napt install ninja-build ccache\n```\nHomebrew on MacOS/Linux:\n```shell\nbrew install ninja ccache\n```\nChocolatey on Windows:\n```shell\nchoco install ninja ccache\n```\n\nOn MacOS/Linux:\n\n- If installed, `ccache` is used automatically\n- `ninja` must either be set as the default Cmake generator using the following command:\n  ```shell\n  echo \"tools.cmake.cmaketoolchain:generator = Ninja\" \u003e\u003e $(conan config home)/global.conf\n  ```\n  or be specified on a command-by-command basis by providing the argument\n  `-c tools.cmake.cmaketoolchain:generator=Ninja` to conan\n\nOn Windows:\n- Set `ninja` as generator as described above (less reliable than the default `Visual Studio` generator)\n- `ccache` will be used automatically *only* when using `Ninja` or `Makefile` as the Cmake generator. It can\n  also be used with `Visual Studio` generators by setting the environment\n  variable `TKET_VSGEN_CCACHE_EXE` to the path of the `ccache` executable. **Note: this\n  must be the path to the actual binary, not a symlink or shim (as used by Chocolatey)**. If using Chocolatey\n  to install `ccache`, you can find the path to the binary using `ccache --shimgen-help`\n\n\n### Building and testing the utility libraries\n\nSee the [README](libs/README.md) in the `libs` directory for instructions on\nbuilding and testing the utility libraries used by tket (for logging,\nrandom-number generation and so on). This is not necessary if you just want to\nbuild tket or pytket since the recipes or binaries will be automatically\ndownloaded from the above conan remote.\n\n### Building and testing the tket library\n\nSee the [README](tket/README.md) in the `tket` directory for instructions on\nbuilding and testing tket as a standalone C++ library.\n\n### Building and testing pytket\n\nSee the [README](pytket/README.md) in the `pytket` directory for instructions on\nbuilding and testing pytket.\n\n### Nix Support\n\nTket and pytket are available as a Nix flake, with support for Linux and Apple Silicon systems.\nSee the [README](nix-support/README.md) in the `nix-support` directory for instructions\non building and testing tket and pytket through Nix, and on how to use it within a Nix project.\n\nTo launch into a tket environment, you can use\n\n```\nnix develop github:CQCL/tket\n```\n\nWe use Cachix to cache pre-built artifacts, which provides a faster install time for nix users.\nTo make use of this cache, enable our cachix substituter with `cachix use tket`, or enter a\ntket nix environment from a trusted user and confirm the use of the tket.cachix.org substituter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCQCL%2Ftket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCQCL%2Ftket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCQCL%2Ftket/lists"}