# lambeq: An Efficient High-Level Python Library for Quantum NLP

arXiv: https://arxiv.org/abs/2110.04236 · HTML: https://mlsanity.com/paper/2110.04236/

## Key facts

- Cited by 44 papers in the map (data through 14 Oct 2026).
- Builds on 15 of its 41 references that are in the map.
- First posted on arXiv 8 Oct 2021.

## Builds on (most cited first, 15 of 15)

- [Supervised learning with quantum enhanced feature spaces](https://mlsanity.com/paper/1804.11326/) (2018)
- [Efficient Learning for Deep Quantum Neural Networks](https://mlsanity.com/paper/1902.10445/) (2019)
- [QNLP in Practice: Running Compositional Models of Meaning on a Quantum Computer](https://mlsanity.com/paper/2102.12846/) (2021)
- [Quantum Natural Language Processing on Near-Term Quantum Computers](https://mlsanity.com/paper/2005.04147/) (2020)
- [Quantum Algorithms for Compositional Natural Language Processing](https://mlsanity.com/paper/1608.01406/) (2016)
- [The Mathematics of Text Structure](https://mlsanity.com/paper/1904.03478/) (2019)
- [A* CCG Parsing with a Supertag and Dependency Factored Model](https://mlsanity.com/paper/1704.06936/) (2017)
- [Quantum Language Model with Entanglement Embedding for Question Answering](https://mlsanity.com/paper/2008.09943/) (2020)
- [A CCG-Based Version of the DisCoCat Framework](https://mlsanity.com/paper/2105.07720/) (2021)
- [Tensor network language model](https://mlsanity.com/paper/1710.10248/) (2017)
- [Reasoning about Meaning in Natural Language with Compact Closed Categories and Frobenius Algebras](https://mlsanity.com/paper/1401.5980/) (2014)
- [Language Design as Information Renormalization](https://mlsanity.com/paper/1708.01525/) (2017)
- [Something Old, Something New: Grammar-based CCG Parsing with Transformer Models](https://mlsanity.com/paper/2109.10044/) (2021)
- [A Quantum Search Decoder for Natural Language Processing](https://mlsanity.com/paper/1909.05023/) (2019)
- [Diagrammatic Differentiation for Quantum Machine Learning](https://mlsanity.com/paper/2103.07960/) (2021)

## Built on by (most cited first, 30 of 44)

- [Tensor Networks Meet Neural Networks: A Survey and Future Perspectives](https://mlsanity.com/paper/2302.09019/) (2023)
- [Applying QNLP to sentiment analysis in finance](https://mlsanity.com/paper/2307.11788/) (2023)
- [Quantum-Inspired Machine Learning: a Survey](https://mlsanity.com/paper/2308.11269/) (2023)
- [Towards Compositional Interpretability for XAI](https://mlsanity.com/paper/2406.17583/) (2024)
- [Compositionality as we see it, everywhere around us](https://mlsanity.com/paper/2110.05327/) (2021)
- [A Quantum Natural Language Processing Approach to Musical Intelligence](https://mlsanity.com/paper/2111.06741/) (2021)
- [Quantum Natural Language Generation on Near-Term Devices](https://mlsanity.com/paper/2211.00727/) (2022)
- [Distilling Text into Circuits](https://mlsanity.com/paper/2301.10595/) (2023)
- [Near-Term Advances in Quantum Natural Language Processing](https://mlsanity.com/paper/2206.02171/) (2022)
- [Quantum Natural Language Processing](https://mlsanity.com/paper/2403.19758/) (2024)
- [Toward Quantum Machine Translation of Syntactically Distinct Languages](https://mlsanity.com/paper/2307.16576/) (2023)
- [Quantum Natural Language Processing: A Comprehensive Review of Models, Methods, and Applications](https://mlsanity.com/paper/2504.09909/) (2025)
- [Quantum Natural Language Processing based Sentiment Analysis using lambeq Toolkit](https://mlsanity.com/paper/2305.19383/) (2023)
- [A Pipeline For Discourse Circuits From CCG](https://mlsanity.com/paper/2311.17892/) (2023)
- [Quantum Algorithms for Compositional Text Processing](https://mlsanity.com/paper/2408.06061/) (2024)
- [Compositional Concept Generalization with Variational Quantum Circuits](https://mlsanity.com/paper/2509.09541/) (2025)
- [DisCoCLIP: A Distributional Compositional Tensor Network Encoder for Vision-Language Understanding](https://mlsanity.com/paper/2509.21287/) (2025)
- [A gentle introduction to Quantum Natural Language Processing](https://mlsanity.com/paper/2202.11766/) (2022)
- [A Quantum Natural Language Processing Approach to Pronoun Resolution](https://mlsanity.com/paper/2208.05393/) (2022)
- [Adapting Pre-trained Language Models for Quantum Natural Language Processing](https://mlsanity.com/paper/2302.13812/) (2023)
- [Enabling Quantum Natural Language Processing for Hindi Language](https://mlsanity.com/paper/2312.01221/) (2023)
- [Differentiating and Integrating ZX Diagrams with Applications to Quantum Machine Learning](https://mlsanity.com/paper/2201.13250/) (2022)
- [Towards Transparency in Coreference Resolution: A Quantum-Inspired Approach](https://mlsanity.com/paper/2312.00688/) (2023)
- [Property-guided Inverse Design of Metal-Organic Frameworks Using Quantum Natural Language Processing](https://mlsanity.com/paper/2405.11783/) (2024)
- [Multimodal Quantum Natural Language Processing: A Novel Framework for using Quantum Methods to Analyse Real Data](https://mlsanity.com/paper/2411.05023/) (2024)
- [A Rose by Any Other Name Would Smell as Sweet: Categorical Homotopy Theory for Large Language Models](https://mlsanity.com/paper/2508.10018/) (2025)
- [Entanglement as Memory: Mechanistic Interpretability of Quantum Language Models](https://mlsanity.com/paper/2603.26494/) (2026)
- [Quantum Models with Multi-Stage Training for Compositional Concept Generalization](https://mlsanity.com/paper/2608.15601/) (2026)
- [Design and Implementation of a Quantum Kernel for Natural Language Processing](https://mlsanity.com/paper/2205.06409/) (2022)
- [Variational Quantum Classifiers for Natural-Language Text](https://mlsanity.com/paper/2303.02469/) (2023)

## Abstract (arXiv)

We present lambeq, the first high-level Python library for Quantum Natural Language Processing (QNLP). The open-source toolkit offers a detailed hierarchy of modules and classes implementing all stages of a pipeline for converting sentences to string diagrams, tensor networks, and quantum circuits ready to be used on a quantum computer. lambeq supports syntactic parsing, rewriting and simplification of string diagrams, ansatz creation and manipulation, as well as a number of compositional models for preparing quantum-friendly representations of sentences, employing various degrees of syntax sensitivity. We present the generic architecture and describe the most important modules in detail, demonstrating the usage with illustrative examples. Further, we test the toolkit in practice by using it to perform a number of experiments on simple NLP tasks, implementing both classical and quantum pipelines.
