# The Mathematics of Text Structure

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

## Key facts

- Cited by 24 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 6 Apr 2019.

## Built on by (most cited first, 24 of 24)

- [lambeq: An Efficient High-Level Python Library for Quantum NLP](https://mlsanity.com/paper/2110.04236/) (2021)
- [Compositionality as we see it, everywhere around us](https://mlsanity.com/paper/2110.05327/) (2021)
- [Quantum Natural Language Generation on Near-Term Devices](https://mlsanity.com/paper/2211.00727/) (2022)
- [Conversational Negation using Worldly Context in Compositional Distributional Semantics](https://mlsanity.com/paper/2105.05748/) (2021)
- [Grammar Equations](https://mlsanity.com/paper/2106.07485/) (2021)
- [Composing Conversational Negation](https://mlsanity.com/paper/2107.06820/) (2021)
- [Distilling Text into Circuits](https://mlsanity.com/paper/2301.10595/) (2023)
- [Quantum computing and artificial intelligence: status and perspectives](https://mlsanity.com/paper/2505.23860/) (2025)
- [How to make qubits speak](https://mlsanity.com/paper/2107.06776/) (2021)
- [Language-independence of DisCoCirc's Text Circuits: English and Urdu](https://mlsanity.com/paper/2208.10281/) (2022)
- [Talking Space: inference from spatial linguistic meanings](https://mlsanity.com/paper/2109.06554/) (2021)
- [A Categorical Semantics of Fuzzy Concepts in Conceptual Spaces](https://mlsanity.com/paper/2110.05985/) (2021)
- [Quantum Natural Language Processing: A Comprehensive Review of Models, Methods, and Applications](https://mlsanity.com/paper/2504.09909/) (2025)
- [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)
- [Grover's Algorithm for Question Answering](https://mlsanity.com/paper/2106.05299/) (2021)
- [Higher-Order DisCoCat (Peirce-Lambek-Montague semantics)](https://mlsanity.com/paper/2311.17813/) (2023)
- [A Rose by Any Other Name Would Smell as Sweet: Categorical Homotopy Theory for Large Language Models](https://mlsanity.com/paper/2508.10018/) (2025)
- [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)
- [Density Matrices for Metaphor Understanding](https://mlsanity.com/paper/2408.11846/) (2024)
- [Quantum Methods for Managing Ambiguity in Natural Language Processing](https://mlsanity.com/paper/2504.00040/) (2025)
- [Efficient Generation of Parameterised Quantum Circuits from Large Texts](https://mlsanity.com/paper/2505.13208/) (2025)
- [CLAQS: Compact Learnable All-Quantum Token Mixer with Shared-ansatz for Text Classification](https://mlsanity.com/paper/2510.06532/) (2025)

## Abstract (arXiv)

In previous work we gave a mathematical foundation, referred to as DisCoCat, for how words interact in a sentence in order to produce the meaning of that sentence. To do so, we exploited the perfect structural match of grammar and categories of meaning spaces. Here, we give a mathematical foundation, referred to as DisCoCirc, for how sentences interact in texts in order to produce the meaning of that text. First we revisit DisCoCat. While in DisCoCat all meanings are fixed as states (i.e. have no input), in DisCoCirc word meanings correspond to a type, or system, and the states of this system can evolve. Sentences are gates within a circuit which update the variable meanings of those words. Like in DisCoCat, word meanings can live in a variety of spaces e.g. propositional, vectorial, or cognitive. The compositional structure are string diagrams representing information flows, and an entire text yields a single string diagram in which word meanings lift to the meaning of an entire text. While the developments in this paper are independent of a physical embodiment (cf. classical vs. quantum computing), both the compositional formalism and suggested meaning model are highly quantum-inspired, and implementation on a quantum computer would come with a range of benefits. We also praise Jim Lambek for his role in mathematical linguistics in general, and the development of the DisCo program more specifically.
