17 research outputs found
DisCoPy: the Hierarchy of Graphical Languages in Python
DisCoPy is a Python toolkit for computing with monoidal categories. It comes
with two flexible data structures for string diagrams: the first one for planar
monoidal categories based on lists of layers, the second one for symmetric
monoidal categories based on cospans of hypergraphs. Algorithms for functor
application then allow to translate string diagrams into code for numerical
computation, be it differentiable, probabilistic or quantum. This report gives
an overview of the library and the new developments released in its version
1.0. In particular, we showcase the implementation of diagram equality for a
large fragment of the hierarchy of graphical languages for monoidal categories,
as well as a new syntax for defining string diagrams as Python functions.Comment: 14 pages, 10 figure
Grammar-Aware Question-Answering on Quantum Computers
Natural language processing (NLP) is at the forefront of great advances in
contemporary AI, and it is arguably one of the most challenging areas of the
field. At the same time, with the steady growth of quantum hardware and notable
improvements towards implementations of quantum algorithms, we are approaching
an era when quantum computers perform tasks that cannot be done on classical
computers with a reasonable amount of resources. This provides a new range of
opportunities for AI, and for NLP specifically. Earlier work has already
demonstrated a potential quantum advantage for NLP in a number of manners: (i)
algorithmic speedups for search-related or classification tasks, which are the
most dominant tasks within NLP, (ii) exponentially large quantum state spaces
allow for accommodating complex linguistic structures, (iii) novel models of
meaning employing density matrices naturally model linguistic phenomena such as
hyponymy and linguistic ambiguity, among others. In this work, we perform the
first implementation of an NLP task on noisy intermediate-scale quantum (NISQ)
hardware. Sentences are instantiated as parameterised quantum circuits. We
encode word-meanings in quantum states and we explicitly account for
grammatical structure, which even in mainstream NLP is not commonplace, by
faithfully hard-wiring it as entangling operations. This makes our approach to
quantum natural language processing (QNLP) particularly NISQ-friendly. Our
novel QNLP model shows concrete promise for scalability as the quality of the
quantum hardware improves in the near future
Category theory for quantum natural language processing
This thesis introduces quantum natural language processing (QNLP) models based on a simple yet powerful analogy between computational linguistics and quantum mechanics: grammar as entanglement. The grammatical structure of text and sentences connects the meaning of words in the same way that entanglement structure connects the states of quantum systems. Category theory allows to make this language-to-qubit analogy formal: it is a monoidal functor from grammar to vector spaces. We turn this abstract analogy into a concrete algorithm that translates the grammatical structure onto the architecture of parameterised quantum circuits. We then use a hybrid classical-quantum algorithm to train the model so that evaluating the circuits computes the meaning of sentences in data-driven tasks.
The implementation of QNLP models motivated the development of DisCoPy (Distributional Compositional Python), the toolkit for applied category theory of which the first chapter gives a comprehensive overview. String diagrams are the core data structure of DisCoPy, they allow to reason about computation at a high level of abstraction. We show how they can encode both grammatical structures and quantum circuits, but also logical formulae, neural networks or arbitrary Python code. Monoidal functors allow to translate these abstract diagrams into concrete computation, interfacing with optimised task-specific libraries.
The second chapter uses DisCopy to implement QNLP models as parameterised functors from grammar to quantum circuits. It gives a first proof-of-concept for the more general concept of functorial learning: generalising machine learning from functions to functors by learning from diagram-like data. In order to learn optimal functor parameters via gradient descent, we introduce the notion of diagrammatic differentiation: a graphical calculus for computing the gradients of parameterised diagrams
Copper-catalyzed cyclization reactions for the synthesis of alkaloids
info:eu-repo/semantics/publishe