Subpackages

lambeq.ansatz

Concrete implementations of classical and quantum ansätze.

API: lambeq.ansatz

UML diagrams: lambeq.ansatz

Classes:

Inheritance diagram of lambeq.ansatz.IQPAnsatz, lambeq.ansatz.MPSAnsatz, lambeq.ansatz.Sim14Ansatz, lambeq.ansatz.Sim15Ansatz, lambeq.ansatz.Sim4Ansatz, lambeq.ansatz.SpiderAnsatz, lambeq.ansatz.StronglyEntanglingAnsatz, lambeq.ansatz.Symbol

lambeq.backend

lambeq’s internal representation of categories. This work is based on DisCoPy (https://discopy.org/) which is released under the BSD 3-Clause “New” or “Revised” License.

API: lambeq.backend

UML diagrams: lambeq.backend

Classes:

Inheritance diagram of lambeq.backend.grammar.Entity, lambeq.backend.grammar.Category, lambeq.backend.grammar.Ty, lambeq.backend.quantum.Ty, lambeq.backend.grammar.Diagrammable, lambeq.backend.grammar.Box, lambeq.backend.quantum.Box, lambeq.backend.grammar.Layer, lambeq.backend.quantum.Layer, lambeq.backend.grammar.Diagram, lambeq.backend.quantum.Diagram, lambeq.backend.grammar.Cup, lambeq.backend.grammar.Cap, lambeq.backend.grammar.Daggered, lambeq.backend.quantum.Daggered, lambeq.backend.grammar.Spider, lambeq.backend.grammar.Swap, lambeq.backend.quantum.Swap, lambeq.backend.grammar.Word, lambeq.backend.grammar.Functor

Inheritance diagram of lambeq.backend.quantum.Box, lambeq.backend.quantum.SelfConjugate, lambeq.backend.quantum.AntiConjugate, lambeq.backend.quantum.Swap, lambeq.backend.quantum.Ket, lambeq.backend.quantum.Bra, lambeq.backend.quantum.Parametrized, lambeq.backend.quantum.Rotation, lambeq.backend.quantum.Rx, lambeq.backend.quantum.Ry, lambeq.backend.quantum.Rz, lambeq.backend.quantum.Controlled, lambeq.backend.quantum.MixedState, lambeq.backend.quantum.Discard, lambeq.backend.quantum.Measure, lambeq.backend.quantum.Encode, lambeq.backend.quantum.Scalar, lambeq.backend.quantum.Sqrt, lambeq.backend.quantum.Daggered, lambeq.backend.quantum.Bit

lambeq.bobcat

The code for Bobcat parser, a state-of-the-art CCG parser used for getting syntactic derivations of sentences.

API: lambeq.bobcat

UML diagrams: lambeq.bobcat

Classes:

Inheritance diagram of lambeq.bobcat.grammar.Grammar, lambeq.bobcat.lexicon.Category, lambeq.bobcat.parser.ChartParser, lambeq.bobcat.parser.Sentence, lambeq.bobcat.parser.Supertag, lambeq.bobcat.rules.Rule, lambeq.bobcat.tagger.Tagger, lambeq.bobcat.tagger.BertForChartClassification, lambeq.bobcat.tree.ParseTree

lambeq.rewrite

Contains implementations of rewrite rules for the transformation of string diagrams.

API: lambeq.rewrite

UML diagrams: lambeq.rewrite

Classes

Inheritance diagram of lambeq.rewrite.CoordinationRewriteRule, lambeq.rewrite.CurryRewriteRule, lambeq.rewrite.DiagramRewriter, lambeq.rewrite.RemoveCupsRewriter, lambeq.rewrite.RemoveSwapsRewriter, lambeq.rewrite.RewriteRule, lambeq.rewrite.Rewriter, lambeq.rewrite.SimpleRewriteRule, lambeq.rewrite.UnifyCodomainRewriter, lambeq.rewrite.UnknownWordsRewriteRule

lambeq.text2diagram

Package containing the interfaces for the CCG parsers (including a CCGBankParser), as well as abstractions and concrete classes for readers, implementing a variety of compositional models for sentences.

API: lambeq.text2diagram

UML diagrams: lambeq.text2diagram

Objects

Classes:

Inheritance diagram of lambeq.text2diagram.BobcatParser, lambeq.text2diagram.CCGType, lambeq.text2diagram.CCGBankParser, lambeq.text2diagram.CCGRule, lambeq.text2diagram.CCGTree, lambeq.text2diagram.DepCCGParser, lambeq.text2diagram.LinearReader, lambeq.text2diagram.Reader, lambeq.text2diagram.TreeReader, lambeq.text2diagram.TreeReaderMode, lambeq.text2diagram.WebParser

lambeq.tokeniser

Tokenisation classes and features for all parsers and readers.

API: lambeq.tokeniser

UML diagrams: lambeq.tokeniser

Classes

Inheritance diagram of lambeq.tokeniser.SpacyTokeniser

lambeq.training

Provides a selection of trainers, models, and optimizers that greatly simplify supervised training for most of lambeq’s use cases, classical and quantum.

API: lambeq.training

UML diagrams: lambeq.training

Classes

Inheritance diagram of lambeq.training.BinaryCrossEntropyLoss, lambeq.training.Checkpoint, lambeq.training.CrossEntropyLoss, lambeq.training.Dataset, lambeq.training.MSELoss, lambeq.training.LossFunction, lambeq.training.NelderMeadOptimizer, lambeq.training.NumpyModel, lambeq.training.PytorchModel, lambeq.training.PytorchTrainer, lambeq.training.RotosolveOptimizer, lambeq.training.SPSAOptimizer, lambeq.training.TketModel, lambeq.training.PennyLaneModel, lambeq.training.QuantumModel, lambeq.training.QuantumTrainer