• Stars
    star
    452
  • Rank 96,761 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated about 1 month ago

Reviews

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

Repository Details

A high-level Python library for Quantum Natural Language Processing

lambeq

lambeq logo

Build status License PyPI version PyPI downloads arXiv

About

lambeq is a toolkit for quantum natural language processing (QNLP).


Note: Please do not try to read the documentation directly from the preview provided in the repository, since some of the pages will not be rendered properly.


Getting started

Prerequisites

  • Python 3.8+

Installation

lambeq can be installed with the command:

pip install lambeq

The default installation of lambeq includes Bobcat parser, a state-of-the-art statistical parser (see related paper) fully integrated with the toolkit.

To install lambeq with optional dependencies for extra features, run:

pip install lambeq[extras]

To enable depccg support, you will need to install depccg separately. More information can be found on the depccg homepage. Currently, only version 2.0.3.2 of depccg is supported. After installing depccg, you can download its model by using the script provided in the contrib folder of this repository:

python contrib/download_depccg_model.py

Usage

The docs/examples directory contains notebooks demonstrating usage of the various tools in lambeq.

Example - parsing a sentence into a diagram (see docs/examples/ccg2discocat.ipynb):

from lambeq import BobcatParser

parser = BobcatParser()
diagram = parser.sentence2diagram('This is a test sentence')
diagram.draw()

Testing

Run all tests with the command:

pytest

Note: if you have installed in a virtual environment, remember to install pytest in the same environment using pip.

Building documentation

To build the documentation, first install the required dependencies:

pip install -r docs/requirements.txt

then run the commands:

cd docs
make clean
make html

the docs will be under docs/_build.

License

Distributed under the Apache 2.0 license. See LICENSE for more details.

Citation

If you wish to attribute our work, please cite the accompanying paper:

@article{kartsaklis2021lambeq,
   title={lambeq: {A}n {E}fficient {H}igh-{L}evel {P}ython {L}ibrary for {Q}uantum {NLP}},
   author={Dimitri Kartsaklis and Ian Fan and Richie Yeung and Anna Pearson and Robin Lorenz and Alexis Toumi and Giovanni de Felice and Konstantinos Meichanetzidis and Stephen Clark and Bob Coecke},
   year={2021},
   journal={arXiv preprint arXiv:2110.04236},
}

More Repositories

1

pytket-docs

User manual and example notebooks for the pytket quantum computing toolkit
Shell
330
star
2

tket

Source code for the TKET quantum compiler, Python bindings and utilities
C++
254
star
3

qujax

Simulating quantum circuits with JAX
Python
37
star
4

Qermit

Python module for running error-mitigation protocols with the pytket quantum SDK
Python
34
star
5

Quanthoven

Jupyter Notebook
32
star
6

pytket-extensions

extensions for pytket quantum SDK
Shell
32
star
7

guppylang

Pythonic quantum-classical programming language
Python
31
star
8

tket2

Version 2 of the TKET quantum compiler
Rust
26
star
9

pytket-quantinuum

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

quantinuum-hardware-quantum-volume

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

qnlp_lorenz_etal_2021_resources

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

hugr

Hierarchical Unified Graph Representation for quantum and classical programs
Rust
20
star
13

quantinuum-hardware-specifications

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

cryptomite

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

diesel-tracing

Connection telemetry middleware for diesel and tracing
Rust
17
star
16

pytket-qiskit

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

tket_benchmarking

Scripts and circuits for benchmarking tket
OpenQASM
12
star
18

pytket-cutensornet

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

pytket-qujax

Python
8
star
20

portgraph

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

Quixer

Python
8
star
22

pytket-dqc

Python
7
star
23

quantinuum-ui

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

pytket-phir

pytket-phir is a circuit analyzer and translator from pytket to PHIR.
Python
6
star
25

pytket-qir

Public repo for the pytket-qir package
LLVM
6
star
26

tmp-postgrust

Rust
5
star
27

hugr-llvm

Rust
4
star
28

brat

Haskell
4
star
29

pytket-pennylane

Python
4
star
30

tierkreis

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

simplex

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

quantinuum-hardware-h2-benchmark

H2 benchmarking data
Jupyter Notebook
4
star
33

text_to_discocirc

Jupyter Notebook
4
star
34

eumen

EUMEN - Quantum Hardware Chemistry
3
star
35

pytket-circuit-renderer

Vue
3
star
36

classification-with-qttn

Python
3
star
37

random_test

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

quantinuum-publications

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

pyscf-ac0

PySCF extension implementing CAS-AC0
Fortran
3
star
40

neural_discocirc

Python
3
star
41

qalypso_2022

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

pytket-braket

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

IEEE_Quantum_Week

TKET and Qermit Tutorial
HTML
2
star
44

qvtsim

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

pytket-iqm

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

protoc-gen-pyproject

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

qnexus-demo

Jupyter Notebook
2
star
48

IronBridge.Libs.Nist_PQC_Algorithms

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

phayes

Easy and efficient Bayesian quantum phase estimation
Python
2
star
50

tket-qir

Rust
2
star
51

Constant-Scaling-Quantum-Gradient-Estimation

Jupyter Notebook
2
star
52

pytket-aqt

pytket-aqt, extensions for pytket quantum SDK
Python
2
star
53

tket-json-rs

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

pypig

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

phir

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

lambeq-docs

User manual and example notebooks for the lambeq QNLP library
TypeScript
1
star
57

tierkreis-viz

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

EQTC-TKET-TUTORIAL

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

grid_synthesis

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

IronBridge.Libs.LibOQS

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

Trieste_Hackathon_Chemistry

Jupyter Notebook
1
star
62

quantinuum-frontend-take-home

TypeScript
1
star
63

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
64

concepts-vae

Concepts VAE
Python
1
star
65

Qermit_Trieste_Hackathon_2023

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