From 30a1e37748512ff761dba4a306c6ec1ed1e80be3 Mon Sep 17 00:00:00 2001 From: Sean Burton Date: Mon, 1 Jun 2026 17:48:29 +0100 Subject: [PATCH 1/4] Remove various superlatives, forward-looking statements, typos, etc --- README.md | 2 +- docs/CONTRIBUTING.rst | 2 +- docs/_templates/lambeq_landing_page.html | 4 ++-- docs/cite.rst | 4 ++-- docs/glossary.rst | 4 ++-- docs/guide/lambeq-basic.rst | 12 ++++++------ docs/guide/ml_basic.rst | 4 ++-- docs/guide/ml_models.rst | 4 ++-- docs/guide/ml_use-cases.rst | 4 ++-- docs/guide/parsing.rst | 4 ++-- docs/guide/pipeline.rst | 2 +- docs/guide/string-diagrams.rst | 4 ++-- docs/index.rst | 2 -- docs/installation.rst | 2 +- docs/release-notes.rst | 20 ++++++++++---------- docs/support.rst | 4 ++-- docs/tutorials/discocirc-basics.ipynb | 2 +- docs/tutorials/discocirc-mc-task.ipynb | 2 +- docs/tutorials/quickstart.ipynb | 2 +- landing/src/app/page.tsx | 4 ++-- 20 files changed, 43 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 8182e67..694d435 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ 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](https://arxiv.org/abs/2109.10044)) fully integrated with the toolkit. +The default installation of lambeq includes Bobcat parser, a statistical parser (see [related paper](https://arxiv.org/abs/2109.10044)) fully integrated with the toolkit. To install lambeq with optional dependencies for extra features, run: diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index e66f97c..ed220b2 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -11,7 +11,7 @@ Contributions to ``lambeq`` are welcome, especially with regard to adding: - Tensor and circuit :term:`ansätze ` (extensions of the :py:class:`.TensorAnsatz` and :py:class:`.CircuitAnsatz` classes) - New :term:`trainers `, :term:`models `, and optimizers for the :py:mod:`.training` package. -All accepted contributions will be included in the next official release and contributors will be properly attributed in the corresponding release notes. +Accepted contributions are typically included in a subsequent official release, subject to release planning, and contributors are properly attributed in the corresponding release notes. Opening a pull request ---------------------- diff --git a/docs/_templates/lambeq_landing_page.html b/docs/_templates/lambeq_landing_page.html index eab13b9..dde10e2 100644 --- a/docs/_templates/lambeq_landing_page.html +++ b/docs/_templates/lambeq_landing_page.html @@ -157,7 +157,7 @@

Tutorials

-

Learn how to use the provided state-of-the-art trainers to train your models for language processing tasks.

+

Learn how to use the provided trainers to train your models for language processing tasks.

@@ -178,7 +178,7 @@

Advanced

-

Learn how to take advantage of the extensible nature of lambeq and how to add new features tailored to you work.

+

Learn how to take advantage of the extensible nature of lambeq and how to add new features tailored to your work.

diff --git a/docs/cite.rst b/docs/cite.rst index b9691b4..45d6db8 100644 --- a/docs/cite.rst +++ b/docs/cite.rst @@ -28,11 +28,11 @@ The :py:term:`DisCoCirc` extension introduced in Release :ref:`rel-0.5.0` is des .. code-block:: bash @article{krawchuk2025, - title={Efficient {G}eneration of {P}arameterised {Q}uantum {C}ircuits from {L}arge {T}exts, + title={Efficient {G}eneration of {P}arameterised {Q}uantum {C}ircuits from {L}arge {T}exts}, author={Colin Krawchuk and Nikhil Khatri and Neil John Ortega - and Dimitri Kartsaklis + and Dimitri Kartsaklis}, year={2025}, journal={arXiv preprint arXiv:2505.13208}, } diff --git a/docs/glossary.rst b/docs/glossary.rst index 614fb3c..03e2347 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -15,7 +15,7 @@ Glossary A :term:`compositional model` of meaning which represents a sentence as a multiset of words; that is, it does not take into account the order of words or any other syntactic relationship between them. Bobcat - A state-of-the-art statistical :term:`CCG ` parser based on :cite:p:`clark_2021`. Bobcat is ``lambeq``'s default parser. + A statistical :term:`CCG ` parser based on :cite:p:`clark_2021`. Bobcat is ``lambeq``'s default parser. cap A special morphism in a :term:`rigid category`, which, together with a :term:`cup` morphism, obey certain conditions called :term:`snake equations`. In diagrammatic form, a cap is depicted as a wire with downward concavity (:math:`\cap`). In the context of :term:`DisCoCat`, a cap is mostly used to "bridge" disconnected wires in order to alter the normal "flow" of information from one word to another, for example in cases such as *type-raising*. @@ -51,7 +51,7 @@ Glossary The DIStributional COmpositional CATegorical model of natural language meaning developed by Bob Coecke, Mehrnoosh Sadrzadeh and Steve Clark :cite:p:`coecke_2010`. The model applies a :term:`functor` :math:`F: \textrm{Grammar} \to \textrm{Meaning}` whose left-hand side is a free pregroup over a partially ordered set of basic grammar types, and the right-hand side is the category whose morphisms describe a sequence of operations that can be evaluated on a classical or quantum computer. DisCoCirc - DIStributional COmpositional CIRCuit. A framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or even documents into a quantum circuit, based on :cite:p:`coecke_2021a`. The generated quantum circuits capture the core semantic information of the provided text, and can be trained as a regular machine learning model. + DIStributional COmpositional CIRCuit. A framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or even documents into a quantum circuit, based on :cite:p:`coecke_2021a`. The generated quantum circuits are intended to represent selected semantic relationships in the provided text, and can be trained as a regular machine learning model. DisCoPy DIStributional COmpositional PYthon. A Python library for working with :term:`monoidal categories ` :cite:p:`de_felice_2021`. It includes abstractions for creating all standard :term:`quantum gates ` and building :term:`quantum circuits `. Additionally, it is equipped with many language-related features, such as support for :term:`pregroup grammars ` and :term:`functors ` for implementing :term:`compositional models `. diff --git a/docs/guide/lambeq-basic.rst b/docs/guide/lambeq-basic.rst index d0abfbd..445d9e2 100644 --- a/docs/guide/lambeq-basic.rst +++ b/docs/guide/lambeq-basic.rst @@ -3,20 +3,20 @@ lambeq and compositionality =========================== -``lambeq`` is a state-of-the-art software toolkit designed for implementing compositional :term:`natural language processing (NLP)` models using :term:`string diagrams ` on a quantum computer. Language is `compositional` in nature :cite:p:`tull_2024`; this is expressed through the `principle of compositionality` which states that the meaning of a complex expression is determined by the meanings of its parts and the rules used to combine them. This concept, rooted in formal linguistics and philosophy, aligns with how humans intuitively process language. +``lambeq`` is a software toolkit designed for implementing compositional :term:`natural language processing (NLP)` models using :term:`string diagrams ` on a quantum computer. Language is `compositional` in nature :cite:p:`tull_2024`; this is expressed through the `principle of compositionality` which states that the meaning of a complex expression is determined by the meanings of its parts and the rules used to combine them. This concept, rooted in formal linguistics and philosophy, aligns with how humans intuitively process language. ``lambeq`` is particularly well-suited for tasks involving natural language processing on quantum computers, although it is also applicable to classical computational environments. It provides tools for: - Parsing sentences into syntactic structures (:term:`CCG `, :term:`pregroup grammars `, dependency graphs). - Converting syntactic structures into compositional semantic representations (:term:`string diagrams `, :term:`tensor networks `). -- Encoding and parameterising syntacic structures into :term:`quantum circuits `. +- Encoding and parameterising syntactic structures into :term:`quantum circuits `. - Training and evaluating NLP models using either classical or quantum :ref:`machine learning `. -- Integration with state-of-the-art ML and QML tools, such as :term:`PyTorch` and :term:`PennyLane`. +- Integration with widely used ML and QML tools, such as :term:`PyTorch` and :term:`PennyLane`. -``lambeq`` is rooted in the formalism of :term:`monoidal categories ` :cite:p:`coecke_2010`, a branch of `category theory` that provides a robust algebraic framework for structuring and reasoning about compositionality. This foundation enables us to model linguistic structures and semantic compositions in a mathematically rigorous yet computationally efficient manner. For this reason, ``lambeq``'s models have some unique advantages over other traditional statistical approaches. +``lambeq`` is rooted in the formalism of :term:`monoidal categories ` :cite:p:`coecke_2010`, a branch of `category theory` that provides a robust algebraic framework for structuring and reasoning about compositionality. This foundation enables us to model linguistic structures and semantic compositions in a mathematically rigorous yet computationally efficient manner. For this reason, ``lambeq``'s models have some characteristics that differ from traditional statistical approaches. -1. **Scalability to Quantum Computing:** ``lambeq``'s mathematical foundations make it uniquely compatible with quantum algorithms, where transformations in quantum states can represent semantic composition. In fact, ``lambeq`` is able to uniquely encode entire linguistic structures directly into :term:`quantum circuits `, enabling training without reliance on neural networks or other "classical" components. -2. **Interpretability:** The mathematical operations used to combine meanings are transparent and tied directly to linguistic principles. This enables trust in decision making and allows for accountability, while it also makes debugging and error analysis easier and more effective. +1. **Scalability to Quantum Computing:** ``lambeq``'s mathematical foundations are compatible with quantum algorithms, where transformations in quantum states can represent semantic composition. ``lambeq`` can be used to encode linguistic structures directly into :term:`quantum circuits `, enabling training without reliance on neural networks or other "classical" components. +2. **Interpretability:** The mathematical operations used to combine meanings are transparent and tied directly to linguistic principles. This can support clearer reasoning about model behaviour and accountability, while also helping with debugging and error analysis. 3. **Generalisation and flexibility:** The framework is highly abstract, allowing generalization across different types of related data representations (:term:`syntax trees `, string diagrams, tensor networks, quantum circuits). 4. **Theoretical depth for linguistic analysis:** The compositional nature of ``lambeq``'s models allows for deeper theoretical insights into linguistic phenomena, bridging gaps between computational linguistics and formal linguistics. 5. **Interdisciplinary applications:** Since compositionality is a fundamental aspect in many other fields (e.g. systems theory, programming languages, bioinformatics, or even human cognition), ``lambeq`` can facilitate interdisciplinary research. diff --git a/docs/guide/ml_basic.rst b/docs/guide/ml_basic.rst index 1879ee4..ab7db3f 100644 --- a/docs/guide/ml_basic.rst +++ b/docs/guide/ml_basic.rst @@ -1,11 +1,11 @@ Basic concepts ============== -In ``lambeq``, all low-level processing that takes place in machine learning training is hidden in the :py:mod:`.training` package, which provides convenient high-level abstractions for all important supervised learning scenarios with the toolkit, classical and quantum. More specifically, the :py:mod:`.training` package contains the following high-level/abstract classes and several concrete implementations for them: +In ``lambeq``, all low-level processing that takes place in machine learning training is hidden in the :py:mod:`.training` package, which provides convenient high-level abstractions for many supervised learning scenarios with the toolkit, classical and quantum. More specifically, the :py:mod:`.training` package contains the following high-level/abstract classes and several concrete implementations for them: - :py:class:`.Dataset`: A class that provides functionality for easy management and manipulation of datasets, including batching, shuffling, and preparation based on the selected backend (:term:`tket`, NumPy, :term:`PyTorch`). - :py:class:`.Model`: The abstract interface for ``lambeq`` :term:`models `. A :term:`model` bundles the basic attributes and methods used for training, given a specific backend. It stores the :term:`symbols ` and the corresponding weights, and implements the forward pass of the model. Concrete implementations are the :py:class:`.PytorchModel`, :py:class:`.TketModel`, :py:class:`.NumpyModel`, and :py:class:`.PennyLaneModel` classes (for more details see Section :ref:`sec-models` below). -- :py:class:`.LossFunction`: Implementations of this class compute the distance between the predicted values of the :term:`model` and the true values in the dataset. This is used to adjust the model weights so that the average loss accross all data instances can be minimised. ``lambeq`` supports a number of loss functions, such as :py:class:`.CrossEntropyLoss`, :py:class:`.BinaryCrossEntropyLoss`, and :py:class:`.MSELoss`. +- :py:class:`.LossFunction`: Implementations of this class compute the distance between the predicted values of the :term:`model` and the true values in the dataset. This is used to adjust the model weights so that the average loss across all data instances can be minimised. ``lambeq`` supports a number of loss functions, such as :py:class:`.CrossEntropyLoss`, :py:class:`.BinaryCrossEntropyLoss`, and :py:class:`.MSELoss`. - :py:class:`.Optimizer`: a ``lambeq`` optimizer calculates the gradient of a given :term:`loss function` with respect to the parameters of a model. It contains a :py:meth:`~lambeq.Optimizer.step` method to modify the model parameters according to the optimizer's update rule. Currently, for the quantum case we support the SPSA algorithm by :cite:p:`spall_1998`, implemented in the :py:class:`.SPSAOptimizer` class, the Rotosolve algorithm :cite:p:`ostaszewski_2021` with class :py:class:`.RotosolveOptimizer`, and the Nelder-Mead algorithm :cite:p:`nelder_1965,gao_2012` with class :py:class:`~lambeq.NelderMeadOptimizer`, while for the classical and hybrid cases we support :term:`PyTorch` optimizers. - :py:class:`.Trainer`: The main interface for supervised learning in ``lambeq``. A :term:`trainer` implements the (quantum) machine learning routine given a specific backend, using a :term:`loss function` and an optimizer. Concrete implementations are the :py:class:`.PytorchTrainer` and :py:class:`.QuantumTrainer` classes. diff --git a/docs/guide/ml_models.rst b/docs/guide/ml_models.rst index 2b6e411..e8b7ec6 100644 --- a/docs/guide/ml_models.rst +++ b/docs/guide/ml_models.rst @@ -20,7 +20,7 @@ Circuits containing only :py:class:`Bra `, :py:class In the common use case of using a :py:data:`~lambeq.text2diagram.stairs_reader` or a :py:class:`.TreeReader` with discarding for binary classification, the process involves measuring (:py:class:`Measure `) one of the "open" qubits, and discarding (:py:class:`Discard `) the rest of them. -One advantage that the :py:class:`.NumpyModel` has over the :py:class:`.TketModel` is that it supports the just-in-time (jit) compilation provided by the library ``jax``. This speeds up the model's diagram evaluation by an order of magnitude. The :py:class:`.NumpyModel` with ``jit`` mode enabled can be instantiated with the following command: +One advantage that the :py:class:`.NumpyModel` has over the :py:class:`.TketModel` is that it supports the just-in-time (jit) compilation provided by the library ``jax``. This may be able to speed up the model's diagram evaluation. The :py:class:`.NumpyModel` with ``jit`` mode enabled can be instantiated with the following command: .. code-block:: python @@ -52,7 +52,7 @@ To use the :py:class:`.NumpyModel` with ``jit`` mode, you need to install ``lamb PennyLaneModel -------------- -:py:class:`.PennyLaneModel` uses :term:`PennyLane` and :term:`PyTorch` to allow classical-quantum machine learning experiments. With ``probabilities=False``, :py:class:`.PennyLaneModel` performs a state vector simulation, while with ``probabilties=True`` it performs a probability simulation. The state vector and probability simulations correspond to unitary and density matrix simulations. +:py:class:`.PennyLaneModel` uses :term:`PennyLane` and :term:`PyTorch` to allow classical-quantum machine learning experiments. With ``probabilities=False``, :py:class:`.PennyLaneModel` performs a state vector simulation, while with ``probabilities=True`` it performs a probability simulation. The state vector and probability simulations correspond to unitary and density matrix simulations. To run the model on real quantum hardware, ``probabilities=True`` must be used, so that the ``lambeq`` circuits are optimized using the parameter-shift rule to calculate the gradients. diff --git a/docs/guide/ml_use-cases.rst b/docs/guide/ml_use-cases.rst index cb39f6b..7ac9191 100644 --- a/docs/guide/ml_use-cases.rst +++ b/docs/guide/ml_use-cases.rst @@ -145,9 +145,9 @@ Evaluation of quantum circuits on a quantum computer - :py:class:`.TketModel` with :py:class:`.QuantumTrainer`. - :py:class:`.PennyLaneModel` with :py:class:`.PytorchTrainer`. :When to use: - The real thing, use it whenever possible! + Use when hardware access is available and aligns with your experimental goals. -As soon as you are satisfied with the results of the simulations, it's time for the ultimate test of your model on a real quantum machine. For this, you will need an account on a platform that provides quantum services, such as `IBM Quantum `_. +After obtaining satisfactory simulation results, an optional next step is to evaluate your model on a real quantum machine. For this, you will need an account on a platform that provides quantum services, such as `IBM Quantum `_. .. note:: diff --git a/docs/guide/parsing.rst b/docs/guide/parsing.rst index d2480cf..c81cefb 100644 --- a/docs/guide/parsing.rst +++ b/docs/guide/parsing.rst @@ -5,7 +5,7 @@ Syntactic parsing ``lambeq``'s :ref:`string diagrams ` are based on a :ref:`pregroup grammar ` to keep track of the types and the interactions between the words in a sentence. When a detailed syntactic derivation is required (as in the case of :term:`DisCoCat`), a :term:`syntax tree` needs to be provided by a statistical :term:`parser`. However, since the :term:`pregroup grammar` formalism is not particularly well-known in the :term:`NLP ` community, there is currently no wide-coverage pregroup :term:`parser` that can automatically provide the syntactic derivations. To address this problem, ``lambeq`` provides a passage from a derivation in the closest alternative grammar formalism, namely :term:`Combinatory Categorial Grammar (CCG)`, to a :term:`string diagram` which faithfully encodes the syntactic structure of the sentence in a pregroup-like form :cite:p:`yeung_2021`. Due to the availability of many robust :term:`CCG ` :term:`parsing tools `, this allows the conversion of large corpora with sentences of arbitrary length and syntactic structure into :term:`pregroup ` and :term:`DisCoCat` form. -The standard ``lambeq`` installation includes a state-of-the-art CCG parser based on :cite:p:`clark_2021`, fully integrated into the toolkit. This parser is provided under the name :term:`Bobcat`. Additionally, ``lambeq`` implements a detailed interface in the :py:mod:`.text2diagram` package that allows connection to one of the many external CCG parsing tools that are currently available. For example, ``lambeq`` is also shipped with support for :term:`depccg` [#f1]_ :cite:p:`yoshikawa_2017`, a fast parser that comes with a convenient Python interface. +The standard ``lambeq`` installation includes a CCG parser based on :cite:p:`clark_2021`, fully integrated into the toolkit. This parser is provided under the name :term:`Bobcat`. Additionally, ``lambeq`` implements a detailed interface in the :py:mod:`.text2diagram` package that allows connection to one of the many external CCG parsing tools that are currently available. For example, ``lambeq`` is also shipped with support for :term:`depccg` [#f1]_ :cite:p:`yoshikawa_2017`, a fast parser that comes with a convenient Python interface. Additional external parsers can be made available to ``lambeq`` by extending the :py:class:`.CCGParser` class in order to create a wrapper subclass that encapsulates the necessary calls and translates the respective parser's output into :py:class:`.CCGTree` format. @@ -13,7 +13,7 @@ Finally, for users who prefer to keep the installation of the toolkit light, ``l Oncilla parser -------------- -Since Release :ref:`rel-0.5.0`, ``lambeq`` provides a new end-to-end parser class, :py:class:`~lambeq.text2diagram.OncillaParser`, that simplifies the process of generating diagrams from text, minimizing or even eliminating exposure of the user to CCG representations and functionality. This parser utilises the :term:`pregroup tree` representation of diagrams, offering accuracy and coverage similar to Bobcat in much faster speeds -- up to three times faster. :term:`Oncilla` parser is currently available as an experimental feature. +Since Release :ref:`rel-0.5.0`, ``lambeq`` provides a new end-to-end parser class, :py:class:`~lambeq.text2diagram.OncillaParser`, that simplifies the process of generating diagrams from text, minimizing or even eliminating exposure of the user to CCG representations and functionality. This parser utilises the :term:`pregroup tree` representation of diagrams, with coverage and accuracy intended to be comparable to Bobcat. Depending on workload and environment, parsing speed may be faster in some settings. :term:`Oncilla` parser is currently available as an experimental feature. Reading CCGBank --------------- diff --git a/docs/guide/pipeline.rst b/docs/guide/pipeline.rst index 3c3b89c..3179dfb 100644 --- a/docs/guide/pipeline.rst +++ b/docs/guide/pipeline.rst @@ -12,7 +12,7 @@ In ``lambeq``, the conversion of a sentence into a :term:`quantum circuit` goes In more detail: -1. A :term:`syntax tree` for the sentence is obtained by calling a statistical :ref:`CCG parser `. ``lambeq`` is equipped with a detailed API that greatly simplifies this process, and ships with support for several state-of-the-art parsers. +1. A :term:`syntax tree` for the sentence is obtained by calling a statistical :ref:`CCG parser `. ``lambeq`` is equipped with a detailed API that greatly simplifies this process, and ships with support for several widely used parsers. 2. Internally, the :term:`parse tree ` is converted into a :ref:`string diagram `. This is an abstract representation of the sentence reflecting the relationships between the words as defined by the :term:`compositional model` of choice, independently of any implementation decisions that take place at a lower level. diff --git a/docs/guide/string-diagrams.rst b/docs/guide/string-diagrams.rst index 92cb51d..1fbf6ab 100644 --- a/docs/guide/string-diagrams.rst +++ b/docs/guide/string-diagrams.rst @@ -6,7 +6,7 @@ String diagrams Motivation and connection to tensor networks -------------------------------------------- -"Programming" a quantum computer requires from developers the ability to manipulate :term:`quantum gates ` (which can be seen as the "atomic" units of computation in this paradigm) in order to create :term:`quantum circuits `, which can be further grouped into higher-order constructions. Working at such a low level compares to writing assembly in a classical computer, and is extremely hard for humans -- especially on :term:`NLP ` tasks which contain many levels of abstractions. +"Programming" a quantum computer requires from developers the ability to manipulate :term:`quantum gates ` (which can be seen as the "atomic" units of computation in this paradigm) in order to create :term:`quantum circuits `, which can be further grouped into higher-order constructions. Working at such a low level compares to writing assembly in a classical computer, and can be challenging for humans -- especially on :term:`NLP ` tasks which contain many levels of abstractions. In order to simplify :term:`NLP ` design on quantum hardware, ``lambeq`` represents sentences as :term:`string diagrams ` (:numref:`fig-stringdiagram`). This choice stems from the fact that a :term:`string diagram` expresses computations in a :ref:`monoidal category `, an abstraction well-suited to model the way a quantum computer works and processes data. @@ -18,7 +18,7 @@ From a more practical point of view, a :term:`string diagram` can be seen as an String diagram (a) and corresponding tensor network (b). -:term:`String diagrams ` and :term:`tensor networks ` constitute an ideal abstract representation of the compositional relations between the words in a sentence, in the sense that they remain close to :term:`quantum circuits `, yet are independent of any low-level decisions (such as choice of :term:`quantum gates ` and construction of circuits representing words and sentences) that might vary depending on design choices and the type of quantum hardware that the experiment is running on. +:term:`String diagrams ` and :term:`tensor networks ` provide a useful abstract representation of the compositional relations between the words in a sentence, in the sense that they remain close to :term:`quantum circuits `, yet are independent of any low-level decisions (such as choice of :term:`quantum gates ` and construction of circuits representing words and sentences) that might vary depending on design choices and the type of quantum hardware that the experiment is running on. .. _sec-pregroup-grammars: diff --git a/docs/index.rst b/docs/index.rst index 9f1cf96..0128f9f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -67,6 +67,4 @@ :caption: External links :maxdepth: 1 - Resources - Web demo DisCoPy diff --git a/docs/installation.rst b/docs/installation.rst index 8ecee07..33278b8 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -9,7 +9,7 @@ Installation pip install lambeq -The default installation of ``lambeq`` includes :term:`Bobcat` parser, a state-of-the-art statistical parser fully integrated with the toolkit. +The default installation of ``lambeq`` includes :term:`Bobcat` parser, a statistical parser fully integrated with the toolkit. To install ``lambeq`` with optional dependencies for extra features, run:: diff --git a/docs/release-notes.rst b/docs/release-notes.rst index ef08b29..22392f7 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -11,7 +11,7 @@ Release notes Added: - A new experimental :py:mod:`~lambeq.experimental.discocirc` module that contains an efficient :py:class:`~lambeq.experimental.discocirc.DisCoCircReader` and all the required functionality for converting long texts and entire multi-paged documents into quantum circuits, based on the :py:term:`DisCoCirc` framework. -- A new tree representation of a pregroup diagram, termed :term:`pregroup tree`, is implemented through the :py:class:`~lambeq.text2diagram.pregroup_tree.PregroupTreeNode` class. This lays the groundwork for drastically improving the parsing and internal processing of diagrams. +- A new tree representation of a pregroup diagram, termed :term:`pregroup tree`, is implemented through the :py:class:`~lambeq.text2diagram.pregroup_tree.PregroupTreeNode` class. - A new experimental end-to-end parser class, :py:class:`~lambeq.text2diagram.OncillaParser`, that simplifies the process of generating diagrams from text, minimizing or even eliminating exposure of the user to CCG representations and functionality. This parser utilises the :term:`pregroup tree` representation of diagrams. This does not replace :py:class:`.BobcatParser` as the default parser. - A new :py:class:`~lambeq.backend.grammar.Frame` data structure that allows the recursive grouping of ``lambeq`` boxes and diagrams and can be seen as a `quantum supermap` acting on the enclosed arguments. Frames are used in :py:term:`DisCoCirc` diagrams. - A new :py:class:`~lambeq.training.PytorchQuantumModel` class that allows Pytorch autograd to be used on quantum circuits, while so far it was possible to use it only on tensor networks (credit: `Kin Ian Lo `_). @@ -96,8 +96,8 @@ Added: Changed: -- An internal refactoring of module :py:mod:`.backend.drawing` in view of planned new features. -- Updated random number generation in :py:class:`~lambeq.TketModel` by using the recommended :py:meth:`numpy.random.default_rnd` method. +- An internal refactoring of module :py:mod:`.backend.drawing`. +- Updated random number generation in :py:class:`~lambeq.TketModel` by using the recommended :py:meth:`numpy.random.default_rng` method. Fixed: @@ -111,13 +111,13 @@ Fixed: Added: -- A new integrated backend that replaces :term:`DisCoPy`, which until now was providing the low-level functionality of ``lambeq``. The new backend offers better performance, increased stability, faster training speeds, and a simplified high-level interface to the user. The new backend consists of the following sub-modules: +- A new integrated backend that replaces :term:`DisCoPy`, which until now was providing the low-level functionality of ``lambeq``. The new backend introduces architectural changes intended to improve performance and stability, and provides a simplified high-level interface to the user. The new backend consists of the following sub-modules: - :py:mod:`lambeq.backend.grammar`: Contains the building blocks for creating string diagrams. - :py:mod:`lambeq.backend.tensor`: Contains the necessary classes to create tensor diagrams. - :py:mod:`lambeq.backend.quantum`: Adds quantum-specific functionality to the backend and provides a circuit simulator based on the `TensorNetwork `_ library. - :py:mod:`lambeq.backend.pennylane`: Interface with PennyLane. - - :py:mod:`lambeq.backend.tk`: Inteface with Tket. + - :py:mod:`lambeq.backend.tk`: Interface with Tket. - :py:mod:`lambeq.backend.numerical_backend`: Common interface for numerical backends (such as Numpy, Jax, PyTorch, TensorFlow) - :py:mod:`lambeq.backend.drawing`: Contains drawing functionality for diagrams and circuits. @@ -177,7 +177,7 @@ Added: - replaced ``discopy.rigid`` with :py:mod:`discopy.grammar.pregroup` everywhere. - replaced ``discopy.biclosed`` with :py:mod:`discopy.grammar.categorial` everywhere. - - Use ``Diagram.decode`` to account for the change in contructor signature ``Diagram(inside, dom, cod)``. + - Use ``Diagram.decode`` to account for the change in constructor signature ``Diagram(inside, dom, cod)``. - updated attribute names that were previously hidden, e.g. ``._data`` becomes ``.data``. - replaced diagrammatic conjugate with transpose. - swapped left and right currying. @@ -379,9 +379,9 @@ Removed: `0.2.0 `_ ------------------------------------------------------------ -- A new state-of-the-art CCG parser based on :cite:p:`clark_2021`, fully integrated with ``lambeq``, which replaces depccg as the default parser of the toolkit. The new :term:`Bobcat` parser has better performance, simplifies installation, and provides compatibility with Windows (which was not supported due to a depccg conflict). depccg is still supported as an alternative external dependency. -- A :py:mod:`.training` package, providing a selection of trainers, models, and optimizers that greatly simplify supervised training for most of ``lambeq``'s use cases, classical and quantum. The new package adds several new features to ``lambeq``, such as the ability to save to and restore models from checkpoints. -- Furthermore, the :py:mod:`.training` package uses :term:`DisCoPy`'s tensor network capability to contract tensor diagrams efficiently. In particular, :term:`DisCoPy 0.4.1 `'s new unitary and density matrix simulators result in substantially faster training speeds compared to the previous version. +- A new CCG parser based on :cite:p:`clark_2021`, fully integrated with ``lambeq``, which replaces depccg as the default parser of the toolkit. The new :term:`Bobcat` parser simplified installation and added compatibility with Windows (which was not supported due to a depccg conflict). depccg is still supported as an alternative external dependency. +- A :py:mod:`.training` package, providing a selection of trainers, models, and optimizers for supervised training in many of ``lambeq``'s use cases, classical and quantum. The new package adds several new features to ``lambeq``, such as the ability to save to and restore models from checkpoints. +- Furthermore, the :py:mod:`.training` package uses :term:`DisCoPy`'s tensor network capability to contract tensor diagrams efficiently. In particular, :term:`DisCoPy 0.4.1 ` introduced new unitary and density matrix simulators that changed training speed characteristics compared to the previous version. - A command-line interface, which provides most of ``lambeq``'s functionality from the command line. For example, ``lambeq`` can now be used as a standard command-line pregroup parser. - A web parser class that can send parsing queries to an online API, so that local installation of a parser is not strictly necessary anymore. The web parser is particularly helpful for testing purposes, interactive usage or when a local parser is unavailable, but should not be used for serious experiments. - A new :py:mod:`~lambeq.pregroups` package that provides methods for easy creation of pregroup diagrams, removal of cups, and printing of diagrams in text form (i.e. in a terminal). @@ -391,7 +391,7 @@ Removed: - Additional generator methods and minor improvements for the :py:class:`.CCGBankParser` class. - Improved and more detailed package structure. - Most classes and functions can now be imported from :py:mod:`lambeq` directly, instead of having to import from the sub-packages. -- The :py:mod:`.circuit` and :py:mod:`.tensor` modules have been combined into an :py:mod:`lambeq.ansatz` package. (However, as mentioned above, the classes and functions they define can now be imported directly from :py:mod:`lambeq` and should continue to do so in future releases.) +- The :py:mod:`.circuit` and :py:mod:`.tensor` modules have been combined into an :py:mod:`lambeq.ansatz` package. (As noted above, the classes and functions they define can be imported directly from :py:mod:`lambeq`; refer to release notes for API changes.) - Improved documentation and additional tutorials. .. _rel-0.1.2: diff --git a/docs/support.rst b/docs/support.rst index 7e035f7..9134d3a 100644 --- a/docs/support.rst +++ b/docs/support.rst @@ -1,6 +1,6 @@ User support ============ -If you need help with ``lambeq`` or you think you have found a bug, please send an email to lambeq-support@quantinuum.com. You can also open an issue at ``lambeq``'s `GitHub repository `_. Someone from the development team will respond to you as soon as possible. Furthermore, if you want to subscribe to ``lambeq``'s mailing list (lambeq-users@quantinuum.com), send an email to lambeq-support@quantinuum.com to let us know. +If you need help with ``lambeq`` or you think you have found a bug, please send an email to lambeq-support@quantinuum.com. You can also open an issue at ``lambeq``'s `GitHub repository `_. The development team reviews support requests and aims to respond promptly. Furthermore, if you want to subscribe to ``lambeq``'s mailing list (lambeq-users@quantinuum.com), send an email to lambeq-support@quantinuum.com to let us know. -Note that the best way to get in touch with the QNLP community and learn about ``lambeq`` is to join our `QNLP discord server `_, where you can ask questions, get notified about important announcements and news, and chat with other QNLP researchers. +One way to get in touch with the QNLP community and learn about ``lambeq`` is to join our `QNLP discord server `_, where you can ask questions, get notified about important announcements and news, and chat with other QNLP researchers. diff --git a/docs/tutorials/discocirc-basics.ipynb b/docs/tutorials/discocirc-basics.ipynb index 1fd66ce..2422c8b 100644 --- a/docs/tutorials/discocirc-basics.ipynb +++ b/docs/tutorials/discocirc-basics.ipynb @@ -9,7 +9,7 @@ "\n", "# From text to circuit\n", "\n", - "Thus far, our exploration of `lambeq` has been confined to sentence-level analysis. However, many compelling NLP tasks, such as discourse analysis, summarization, and {term}`coreference resolution`, inherently operate at the discourse level, requiring models to understand and process relationships and structures spanning across multiple sentences. To make this kind of tasks possible on a quantum computer, `lambeq` supports {term}`DisCoCirc` {cite:p}`coecke_2021a`, a framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or documents into a quantum circuit. The generated quantum circuits capture the core semantic information of the provided text, and can be trained using `lambeq`'s {ref}`machine learning ` features {cite:p}`krawchuk_2025`.\n", + "Thus far, our exploration of `lambeq` has been confined to sentence-level analysis. However, many compelling NLP tasks, such as discourse analysis, summarization, and {term}`coreference resolution`, inherently operate at the discourse level, requiring models to understand and process relationships and structures spanning across multiple sentences. To make these kind of tasks possible on a quantum computer, `lambeq` supports {term}`DisCoCirc` {cite:p}`coecke_2021a`, a framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or documents into a quantum circuit. The generated quantum circuits are intended to represent selected semantic relationships in the provided text, and can be trained using `lambeq`'s {ref}`machine learning ` features {cite:p}`krawchuk_2025`.\n", "\n", "{download}`⬇️ Download code <../_code/discocirc-basics.ipynb>`\n", "\n", diff --git a/docs/tutorials/discocirc-mc-task.ipynb b/docs/tutorials/discocirc-mc-task.ipynb index 374ea4c..dce68b8 100644 --- a/docs/tutorials/discocirc-mc-task.ipynb +++ b/docs/tutorials/discocirc-mc-task.ipynb @@ -175,7 +175,7 @@ "source": [ "### Creating and parameterising diagrams\n", "\n", - "The first step is to convert the paragraphs into {term}`string diagrams `. For that, we use the experimental {py:class}`~lambeq.experimental.discocirc.DisCoCircReader` class. Also, as explained in Section {ref}`sec-sandwich`, we need to replace the higher-order DisCoCirc frames into standard boxes by passing `sandwich=True` to the {py:meth}`~lambeq.experimental.discocirc.DisCoCircReader.text2circuit` call to allow convertion to quantum circuits." + "The first step is to convert the paragraphs into {term}`string diagrams `. For that, we use the experimental {py:class}`~lambeq.experimental.discocirc.DisCoCircReader` class. Also, as explained in Section {ref}`sec-sandwich`, we need to replace the higher-order DisCoCirc frames into standard boxes by passing `sandwich=True` to the {py:meth}`~lambeq.experimental.discocirc.DisCoCircReader.text2circuit` call to allow conversion to quantum circuits." ] }, { diff --git a/docs/tutorials/quickstart.ipynb b/docs/tutorials/quickstart.ipynb index 1e86811..4593e19 100644 --- a/docs/tutorials/quickstart.ipynb +++ b/docs/tutorials/quickstart.ipynb @@ -107,7 +107,7 @@ "id": "ae16c204-15a7-4fe1-90e9-16b988466242", "metadata": {}, "source": [ - "For this example we will use an ansatz that generates an {term}`IQP circuit`. You can think ansatze as mappings from {term}`string diagrams ` to quantum circuits. For this mapping to work, we need to provide the number of actual qubits we want to use for each wire. For example, in the above diagram note that each wire is annotated with a type, `n` representing nouns and `s` the entire sentence; so, to create the ansatz, we pass a dictionary from noun and sentence types to a specified number of qubits. We also have to provide the number of IQP layers we want for the circuit, as well as the number of rotations that will represent each qubit." + "For this example we will use an ansatz that generates an {term}`IQP circuit`. You can think of ansätze as mappings from {term}`string diagrams ` to quantum circuits. For this mapping to work, we need to provide the number of actual qubits we want to use for each wire. For example, in the above diagram note that each wire is annotated with a type, `n` representing nouns and `s` the entire sentence; so, to create the ansatz, we pass a dictionary from noun and sentence types to a specified number of qubits. We also have to provide the number of IQP layers we want for the circuit, as well as the number of rotations that will represent each qubit." ] }, { diff --git a/landing/src/app/page.tsx b/landing/src/app/page.tsx index a893f0d..93ab53d 100644 --- a/landing/src/app/page.tsx +++ b/landing/src/app/page.tsx @@ -41,7 +41,7 @@ const cardConfig = [ }, { "title": "Training models", - "description": "Learn how to use the provided state-of-the-art trainers to train your models for language processing tasks.", + "description": "Learn how to use the provided trainers to train your models for language processing tasks.", "link": "training.html" } ] @@ -60,7 +60,7 @@ const cardConfig = [ }, { "title": "Extending \u03BBambeq", - "description": "Learn how to take advantage of the extensible nature of \u03BBambeq and how to add new features tailored to you work.", + "description": "Learn how to take advantage of the extensible nature of \u03BBambeq and how to add new features tailored to your work.", "link": "tutorials/extend-lambeq.html" } ] From 00698047decb909b53f904d8c704207601c38ecb Mon Sep 17 00:00:00 2001 From: Sean Burton Date: Tue, 2 Jun 2026 12:14:19 +0100 Subject: [PATCH 2/4] Additional fixes and softening of phrasing --- docs/guide/lambeq-basic.rst | 2 +- docs/guide/ml_models.rst | 16 ++++++++-------- docs/guide/ml_use-cases.rst | 11 ++++++----- docs/guide/pipeline.rst | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/guide/lambeq-basic.rst b/docs/guide/lambeq-basic.rst index 445d9e2..ff8798e 100644 --- a/docs/guide/lambeq-basic.rst +++ b/docs/guide/lambeq-basic.rst @@ -3,7 +3,7 @@ lambeq and compositionality =========================== -``lambeq`` is a software toolkit designed for implementing compositional :term:`natural language processing (NLP)` models using :term:`string diagrams ` on a quantum computer. Language is `compositional` in nature :cite:p:`tull_2024`; this is expressed through the `principle of compositionality` which states that the meaning of a complex expression is determined by the meanings of its parts and the rules used to combine them. This concept, rooted in formal linguistics and philosophy, aligns with how humans intuitively process language. +``lambeq`` is a software toolkit designed for implementing compositional :term:`natural language processing (NLP)` models using :term:`string diagrams ` on a quantum computer. Language is approximately `compositional` in nature :cite:p:`tull_2024`; this is expressed through the `principle of compositionality` which states that the meaning of a complex expression is determined by the meanings of its parts and the rules used to combine them. This concept, rooted in formal linguistics and philosophy, aligns with how humans intuitively process language. ``lambeq`` is particularly well-suited for tasks involving natural language processing on quantum computers, although it is also applicable to classical computational environments. It provides tools for: diff --git a/docs/guide/ml_models.rst b/docs/guide/ml_models.rst index e8b7ec6..dfba6b2 100644 --- a/docs/guide/ml_models.rst +++ b/docs/guide/ml_models.rst @@ -85,14 +85,14 @@ By using different backend configurations, :py:class:`.PennyLaneModel` can be us :header: "Use case", "Configurations" :widths: 25, 50 - "Exact non :term:`shot-based ` simulation with state outputs", "``{'backend': 'default.qubit', 'probabilities'=False}``" - "Exact non shot-based simulation with probability outputs", "``{'backend': 'default.qubit', 'probabilities'=True}``" - "Noiseless shot-based simulation", "``{'backend': 'default.qubit', 'shots'=1000, 'probabilities'=True}``" - "Noisy shot-based simulation on local hardware", "``{'backend': 'qiskit.aer', noise_model=my_noise_model, 'shots'=1000, 'probabilities'=True}``, where ``my_noise_model`` is an AER :py:class:`NoiseModel`." - "Noisy shot-based simulation on cloud-based emulators", "| ``{'backend': 'qiskit.ibmq', 'device'='ibmq_qasm_simulator', 'shots'=1000, 'probabilities'=True}`` - | ``{'backend': 'honeywell.hqs', device=('H1-1E' or 'H1-2E'), 'shots'=1000, 'probabilities'=True}``" - "Evaluation of quantum circuits on a quantum computer", "| ``{'backend': 'qiskit.ibmq', 'device'='ibmq_hardware_device', 'shots'=1000, 'probabilities'=True}``, where ``ibmq_hardware_device`` is one that you have access to via your IBMQ account. - | ``{'backend': 'honeywell.hqs', device=('H1' or 'H1-1' or 'H1-2'), 'shots'=1000, 'probabilities'=True}``" + "Exact non :term:`shot-based ` simulation with state outputs", "``{'backend': 'default.qubit', 'probabilities': False}``" + "Exact non shot-based simulation with probability outputs", "``{'backend': 'default.qubit', 'probabilities': True}``" + "Noiseless shot-based simulation", "``{'backend': 'default.qubit', 'shots': 1000, 'probabilities': True}``" + "Noisy shot-based simulation on local hardware", "``{'backend': 'qiskit.aer', 'noise_model': my_noise_model, 'shots': 1000, 'probabilities': True}``, where ``my_noise_model`` is an AER :py:class:`NoiseModel`." + "Noisy shot-based simulation on cloud-based emulators", "| ``{'backend': 'qiskit.ibmq', 'device': 'ibmq_qasm_simulator', 'shots': 1000, 'probabilities': True}`` + | ``{'backend': 'honeywell.hqs', 'device': 'H1-1E', 'shots': 1000, 'probabilities': True}`` (or with ``'device': 'H1-2E'``)" + "Evaluation of quantum circuits on a quantum computer", "| ``{'backend': 'qiskit.ibmq', 'device': 'ibmq_hardware_device', 'shots': 1000, 'probabilities': True}``, where ``ibmq_hardware_device`` is one that you have access to via your IBMQ account. + | ``{'backend': 'honeywell.hqs', 'device': 'H1', 'shots': 1000, 'probabilities': True}`` (or with ``'device': 'H1-1'`` or ``'device': 'H1-2'``)" All of these backends are compatible with hybrid quantum-classical models. Note that using quantum hardware or cloud-based emulators are much slower than local simulations. diff --git a/docs/guide/ml_use-cases.rst b/docs/guide/ml_use-cases.rst index 7ac9191..126a036 100644 --- a/docs/guide/ml_use-cases.rst +++ b/docs/guide/ml_use-cases.rst @@ -18,7 +18,7 @@ lambeq use cases The above figure introduces a couple of concepts that might need further explanation for users new to quantum computing: -- **shot-based run/simulation**: Unlike classical computers, quantum computers are inherently non-deterministic. This means that running a quantum circuit only once and using the output for some task would produce unreliable results. The solution is to run the same circuit many times (or :term:`shots`), exploiting statistical aggregation. The inherent uncertainty of quantum computers is greatly increased by the limitations of current :term:`NISQ` devices, which are prone to :term:`noise`, errors, and environmental interference. +- **shot-based run/simulation**: Unlike classical computers, quantum computers are inherently non-deterministic. This means that running a quantum circuit only once and using the output for some task may produce unreliable results. A common approach is to run the same circuit many times (or :term:`shots`) and use statistical aggregation. On current :term:`NISQ` devices, this statistical variability can be further influenced by factors such as :term:`noise` and environmental interference. - **noisy simulation**: A noisy simulation uses a noise model that tries to approximate the negative effect of noise, errors, and environmental interference that are inherent in current :term:`NISQ` devices. It is the closest you can get to an actual quantum run from a simulation running on classical hardware. :numref:`tbl-usecases` provides a concise reference for the most common scenarios, together with the recommended ``lambeq`` models and trainers to use for each of them, while the following subsections present each case in more detail. @@ -161,14 +161,14 @@ After obtaining satisfactory simulation results, an optional next step is to eva "`Alpine Quantum Technologies `_", "`Trapped ions `_" "`Amazon Braket `_", "`Annealing `_, trapped ions, `superconducting qubits `_, `photonics `_" "`Atom Computing `_", "`Neutral atoms `_ in an `optical lattice `_" - "`Google Quantum AI `_", "Superconducting qubits" + "`Google Quantum AI `_", "Superconducting qubits" "`IBM Quantum `_", "Superconducting qubits" "`IonQ Cloud access `_", "Trapped ions" "`IQM `_", "Superconducting qubits" "`Microsoft Azure Quantum `_", "Trapped ions, superconducting qubits, `neutral atoms `_" "`Oxford Quantum Circuits `_", "Superconducting qubits" - "`Quandela `_", "Photonics" - "`Quantinuum `_", "Trapped ions" + "`Quandela `_", "Photonics" + "`Quantinuum `_", "Trapped ions" "`Quantware `_", "Superconducting qubits" "`QuEra `_", "Neutral atoms" "`Rigetti Quantum Cloud Services `_", "Superconducting qubits" @@ -213,7 +213,8 @@ Hybrid classical/quantum simulations on classical hardware - To mix neural nets (or other classical models) and quantum circuits into hybrid models - To exploit the rich functionality and options provided by the :term:`PennyLane` toolkit -:term:`PennyLane` is currently one of the most complete quantum ML toolkits available, covering almost every possible training use case. One of its big strengths is allowing the combination of quantum and classical parts in models, in what is usually referred to as `hybrid` QML. PennyLane integrates smoothly with PyTorch; for example in ``lambeq`` it is possible to use a :py:class:`.PennyLaneModel` in conjunction with a :py:class:`.PytorchTrainer` to perform a wide range of experiments. +For building hybrid quantum-classical models, ``lambeq`` provides access to the :term:`PennyLane` QML toolkits via the :py:class:`.PennyLaneModel`. :term:`PennyLane` integrates smoothly with PyTorch; for example in ``lambeq`` it is possible to use a :py:class:`.PennyLaneModel` in conjunction with a :py:class:`.PytorchTrainer` to perform a wide range of experiments. + .. rubric:: See also: diff --git a/docs/guide/pipeline.rst b/docs/guide/pipeline.rst index 3179dfb..1f80565 100644 --- a/docs/guide/pipeline.rst +++ b/docs/guide/pipeline.rst @@ -20,6 +20,6 @@ In more detail: 4. The resulting :term:`string diagram` can be converted into a concrete :term:`quantum circuit` (or a :term:`tensor network` in the case of a "classical" experiment), based on a specific `parameterisation `_ scheme and concrete choices of :term:`ansätze `. ``lambeq`` features an extensible class hierarchy containing a selection of pre-defined :term:`ansätze `, appropriate for both classical and quantum experiments. -5. Now the output of the pipeline (:term:`quantum circuit` or :term:`tensor network`) is ready to be used for :ref:`training `. Since Release :ref:`rel-0.2.0`, ``lambeq`` provides a detailed hierarchy of model and trainer classes that cover all the important use-cases of supervised learning. +5. Now the output of the pipeline (:term:`quantum circuit` or :term:`tensor network`) is ready to be used for :ref:`training `. Since Release :ref:`rel-0.2.0`, ``lambeq`` provides a detailed hierarchy of model and trainer classes that cover many of the important use-cases of supervised learning. In the case of a fully quantum pipeline, the trainer will first process the :term:`quantum circuit` by calling a quantum compiler, and then it will upload the result onto a quantum computer, while in the classical case the :term:`tensor network` will be passed to an ML or optimisation library, such as :term:`PyTorch` or JAX. From d7cd8746712cf95a595bb1b21f7deeaf1a4d689d Mon Sep 17 00:00:00 2001 From: Sean Burton Date: Tue, 2 Jun 2026 17:17:03 +0100 Subject: [PATCH 3/4] Additional changes --- docs/guide/lambeq-basic.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/lambeq-basic.rst b/docs/guide/lambeq-basic.rst index ff8798e..92f8e38 100644 --- a/docs/guide/lambeq-basic.rst +++ b/docs/guide/lambeq-basic.rst @@ -15,10 +15,10 @@ lambeq and compositionality ``lambeq`` is rooted in the formalism of :term:`monoidal categories ` :cite:p:`coecke_2010`, a branch of `category theory` that provides a robust algebraic framework for structuring and reasoning about compositionality. This foundation enables us to model linguistic structures and semantic compositions in a mathematically rigorous yet computationally efficient manner. For this reason, ``lambeq``'s models have some characteristics that differ from traditional statistical approaches. -1. **Scalability to Quantum Computing:** ``lambeq``'s mathematical foundations are compatible with quantum algorithms, where transformations in quantum states can represent semantic composition. ``lambeq`` can be used to encode linguistic structures directly into :term:`quantum circuits `, enabling training without reliance on neural networks or other "classical" components. +1. **Scalability to Quantum Computing:** ``lambeq``'s mathematical foundations are compatible with quantum algorithms, where transformations in quantum states can represent semantic composition. ``lambeq`` can be used to encode linguistic structures directly into :term:`quantum circuits `, enabling out-of-the-box training of parameterised quantum circuits. 2. **Interpretability:** The mathematical operations used to combine meanings are transparent and tied directly to linguistic principles. This can support clearer reasoning about model behaviour and accountability, while also helping with debugging and error analysis. 3. **Generalisation and flexibility:** The framework is highly abstract, allowing generalization across different types of related data representations (:term:`syntax trees `, string diagrams, tensor networks, quantum circuits). -4. **Theoretical depth for linguistic analysis:** The compositional nature of ``lambeq``'s models allows for deeper theoretical insights into linguistic phenomena, bridging gaps between computational linguistics and formal linguistics. +4. **Connections to formal linguistics:** The compositional nature of ``lambeq``'s models is intended to align computational representations with concepts from formal linguistics, which may help relate model structure to linguistic theory. 5. **Interdisciplinary applications:** Since compositionality is a fundamental aspect in many other fields (e.g. systems theory, programming languages, bioinformatics, or even human cognition), ``lambeq`` can facilitate interdisciplinary research. Related research From 9bbf1829f3b05b23a833c7a681c2eb9ecf916ed9 Mon Sep 17 00:00:00 2001 From: Sean Burton Date: Thu, 4 Jun 2026 15:38:33 +0100 Subject: [PATCH 4/4] Address review comments --- docs/support.rst | 2 +- docs/tutorials/discocirc-basics.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/support.rst b/docs/support.rst index 9134d3a..30bcd88 100644 --- a/docs/support.rst +++ b/docs/support.rst @@ -3,4 +3,4 @@ User support If you need help with ``lambeq`` or you think you have found a bug, please send an email to lambeq-support@quantinuum.com. You can also open an issue at ``lambeq``'s `GitHub repository `_. The development team reviews support requests and aims to respond promptly. Furthermore, if you want to subscribe to ``lambeq``'s mailing list (lambeq-users@quantinuum.com), send an email to lambeq-support@quantinuum.com to let us know. -One way to get in touch with the QNLP community and learn about ``lambeq`` is to join our `QNLP discord server `_, where you can ask questions, get notified about important announcements and news, and chat with other QNLP researchers. +One way to get in touch with the QNLP community and learn about ``lambeq`` is to join our `QNLP Discord server `_, where you can ask questions, get notified about important announcements and news, and chat with other QNLP researchers. diff --git a/docs/tutorials/discocirc-basics.ipynb b/docs/tutorials/discocirc-basics.ipynb index 2422c8b..19ec390 100644 --- a/docs/tutorials/discocirc-basics.ipynb +++ b/docs/tutorials/discocirc-basics.ipynb @@ -9,7 +9,7 @@ "\n", "# From text to circuit\n", "\n", - "Thus far, our exploration of `lambeq` has been confined to sentence-level analysis. However, many compelling NLP tasks, such as discourse analysis, summarization, and {term}`coreference resolution`, inherently operate at the discourse level, requiring models to understand and process relationships and structures spanning across multiple sentences. To make these kind of tasks possible on a quantum computer, `lambeq` supports {term}`DisCoCirc` {cite:p}`coecke_2021a`, a framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or documents into a quantum circuit. The generated quantum circuits are intended to represent selected semantic relationships in the provided text, and can be trained using `lambeq`'s {ref}`machine learning ` features {cite:p}`krawchuk_2025`.\n", + "Thus far, our exploration of `lambeq` has been confined to sentence-level analysis. However, many compelling NLP tasks, such as discourse analysis, summarization, and {term}`coreference resolution`, inherently operate at the discourse level, requiring models to understand and process relationships and structures spanning across multiple sentences. To make these kinds of tasks possible on a quantum computer, `lambeq` supports {term}`DisCoCirc` {cite:p}`coecke_2021a`, a framework of compositional models (still at the experimental stage) with the ability to encode entire paragraphs or documents into a quantum circuit. The generated quantum circuits are intended to represent selected semantic relationships in the provided text, and can be trained using `lambeq`'s {ref}`machine learning ` features {cite:p}`krawchuk_2025`.\n", "\n", "{download}`⬇️ Download code <../_code/discocirc-basics.ipynb>`\n", "\n",