• Stars
    star
    242
  • Rank 166,032 (Top 4 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Source code for the TKET quantum compiler, Python bindings and utilities

tket

Introduction

This repository contains the full source code for tket, a quantum SDK.

If you just want to use tket via Python, the easiest way is to install it with pip:

pip install pytket

For full API documentation, as well as a comprehensive user manual and a selection of example notebooks, please follow the links from the pytket main page.

Note that the various pytket extensions (which allow pytket to interface with other software packages and with quantum devices) live in the separate pytket-extensions repository.

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.

How to build tket and pytket

Prerequisites

Build tools

The following compiler toolchains are used to build tket on the CI and are therefore known to work:

  • Linux: gcc-11
  • MacOS: apple-clang 14
  • 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.9, 3.10 or 3.11) and pip installed. We use cmake and the package manager conan to build tket and pytket. The latter can be installed with pip:

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:

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:

apt install ninja-build ccache

Homebrew on MacOS/Linux:

brew install ninja ccache

Chocolatey on Windows:

choco install ninja ccache

If installed, ccache is used automatically. ninja can be set as the default generator using the following command:

echo "tools.cmake.cmaketoolchain:generator = Ninja" >> $(conan config home)/global.conf

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.

API documentation

The tket (C++) API documentation (generated with doxygen, and still rather patchy) is available here.

The pytket (Python) API documentation is available here.

More Repositories

1

lambeq

A high-level Python library for Quantum Natural Language Processing
Python
447
star
2

pytket-docs

User manual and example notebooks for the pytket quantum SDK
Jupyter Notebook
328
star
3

qujax

Simulating quantum circuits with JAX
Python
37
star
4

Quanthoven

Jupyter Notebook
32
star
5

pytket-extensions

extensions for pytket quantum SDK
Shell
31
star
6

Qermit

Python module for running error-mitigation protocols with the pytket quantum SDK
Python
30
star
7

quantinuum-hardware-quantum-volume

Repository for sharing Quantinuum's Quantum Volume data
Jupyter Notebook
24
star
8

qnlp_lorenz_etal_2021_resources

Code and resources for the Lorenz et al. (2021) QNLP paper
Jupyter Notebook
21
star
9

pytket-quantinuum

pytket-quantinuum, extensions for pytket quantum SDK
Python
21
star
10

quantinuum-hardware-specifications

Repository for sharing Quantinuum's hardware specifications data
Jupyter Notebook
20
star
11

cryptomite

Python library of efficient and numerically-precise randomness extractors
C++
20
star
12

tket2

Version 2 of the TKET quantum compiler
Rust
20
star
13

guppylang

Pythonic quantum-classical programming language
Python
18
star
14

diesel-tracing

Connection telemetry middleware for diesel and tracing
Rust
16
star
15

hugr

Hierarchical Unified Graph Representation for quantum and classical programs
Rust
15
star
16

pytket-qiskit

pytket-qiskit, extensions for pytket quantum SDK
Python
14
star
17

tket_benchmarking

Scripts and circuits for benchmarking tket
OpenQASM
11
star
18

pytket-cutensornet

cuTensorNet Python API extensions for pytket quantum SDK
Python
8
star
19

portgraph

Directed graph with first-level ports in Rust.
Rust
8
star
20

Quixer

Python
8
star
21

pytket-qujax

Python
7
star
22

quantinuum-ui

Design tokens and React components for Quantinuum.
TypeScript
7
star
23

pytket-phir

pytket-phir is a circuit analyzer and translator from pytket to PHIR.
Python
5
star
24

tmp-postgrust

Rust
5
star
25

pytket-dqc

Python
5
star
26

pytket-qir

Public repo for the pytket-qir package
LLVM
5
star
27

hugr-llvm

Rust
4
star
28

pytket-pennylane

Python
4
star
29

tierkreis

Tierkreis python package with client, runtime and worker helpers
Python
4
star
30

simplex

A fast simulator for Clifford circuits
C++
4
star
31

quantinuum-hardware-h2-benchmark

H2 benchmarking data
Jupyter Notebook
4
star
32

text_to_discocirc

Jupyter Notebook
4
star
33

eumen

EUMEN - Quantum Hardware Chemistry
3
star
34

pytket-circuit-renderer

Vue
3
star
35

classification-with-qttn

Python
3
star
36

random_test

This repository contains some scripts to help you install and run statistical tests of randomness.
Shell
3
star
37

quantinuum-publications

A repository for holding a list of all Quantinuum publications.
TeX
3
star
38

pyscf-ac0

PySCF extension implementing CAS-AC0
Fortran
3
star
39

qalypso_2022

Repository for presentations, notebooks and hackathon exercises from the Qalyspo summer school 2022
Jupyter Notebook
3
star
40

pytket-braket

pytket-braket, extensions for pytket quantum SDK
Python
2
star
41

IEEE_Quantum_Week

TKET and Qermit Tutorial
HTML
2
star
42

qvtsim

Methods for simulating quantum volume tests and comparing confidence interval constructions.
Python
2
star
43

pytket-iqm

pytket-iqm, extensions for pytket quantum SDK
Python
2
star
44

protoc-gen-pyproject

A simple protoc plugin to copy and expand python project files.
Python
2
star
45

qnexus-demo

Jupyter Notebook
2
star
46

IronBridge.Libs.Nist_PQC_Algorithms

Nist Post-Quantum Cryptography (PQC) Algorithms used by RestServerCpp
C
2
star
47

phayes

Easy and efficient Bayesian quantum phase estimation
Python
2
star
48

tket-qir

Rust
2
star
49

Constant-Scaling-Quantum-Gradient-Estimation

Jupyter Notebook
2
star
50

tket-json-rs

Rust data structure for serialising/deserialising TKET Circuit JSON v1
Rust
2
star
51

pypig

Simple command line tool for managing private pypiserver
Python
2
star
52

phir

PHIR (PECOS High-level Intermediate Representation) Spec and data model
Python
2
star
53

neural_discocirc

Python
2
star
54

tierkreis-viz

Interactive Tierkreis graph vizualizer that runs in your browser.
JavaScript
1
star
55

EQTC-TKET-TUTORIAL

Jupyter notebooks from EQTC 2021 TKET tutorial.
HTML
1
star
56

grid_synthesis

Implementing Ross/Selinger's z-rotation synthesis (1403.2975v3) in Rust for real-time profiling purposes.
Rust
1
star
57

IronBridge.Libs.LibOQS

open-quantum-safe/liboqs - Open source C library for quantum-safe cryptographic algorithms
Makefile
1
star
58

Trieste_Hackathon_Chemistry

Jupyter Notebook
1
star
59

pytket-aqt

pytket-aqt, extensions for pytket quantum SDK
Python
1
star
60

quantinuum-frontend-take-home

TypeScript
1
star
61

architecture-aware-phasepoly-synth

This repository contains the source code to replicate the results from the paper "Architecture-aware phase polynomial synthesis for NISQ devices" by Arianne Meijer - van de Griend and Ross Duncan.
OpenQASM
1
star
62

concepts-vae

Concepts VAE
Python
1
star
63

Qermit_Trieste_Hackathon_2023

Notebooks and slides related to the Qermit presentation.
Jupyter Notebook
1
star