lambeq
lambeq
is an open-source, modular, extensible high-level Python library for experimental Quantum Natural Language Processing (QNLP), created by Quantinuum’s QNLP team. At a high level, the library allows the conversion of any sentence to a quantum circuit, based on a given compositional model and certain parameterisation and choices of ansätze, and facilitates training for both quantum and classical NLP experiments. The notes for the latest release can be found here.
lambeq
is available for Python 3.9 and higher, on Linux, macOS and Windows. To install, type:
pip install lambeq
or refer to Installation for more information. To start the tutorial, go to Step 1: Sentence Input. To see the example notebooks, go to Examples. To use the command-line interface, read Command-line interface. To make your own contributions to lambeq
, see Contributing to lambeq.
Note
Please do not try to read this documentation directly from the preview provided in the GitHub repository, since some of the pages will not be rendered properly.
User support
If you need help with lambeq
or you think you have found a bug, please send an email to lambeq-support@cambridgequantum.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@cambridgequantum.com), send an email to lambeq-support@cambridgequantum.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.
Licence
Licensed under the Apache 2.0 License.
How to cite
If you use lambeq
for your research, please cite the accompanying paper [Kea2021]:
@article{kartsaklis2021lambeq,
title={lambeq: {A}n {E}fficient {H}igh-{L}evel {P}ython {L}ibrary for {Q}uantum {NLP}},
author={Dimitri Kartsaklis and Ian Fan and Richie Yeung and Anna Pearson and Robin Lorenz and Alexis Toumi and Giovanni de Felice and Konstantinos Meichanetzidis and Stephen Clark and Bob Coecke},
year={2021},
journal={arXiv preprint arXiv:2110.04236},
}
- lambeq package
AtomicType
BaseAnsatz
BinaryCrossEntropyLoss
BobcatParseError
BobcatParser
CCGBankParseError
CCGBankParser
CCGParser
CCGRule
CCGRule.BACKWARD_APPLICATION
CCGRule.BACKWARD_COMPOSITION
CCGRule.BACKWARD_CROSSED_COMPOSITION
CCGRule.BACKWARD_TYPE_RAISING
CCGRule.CONJUNCTION
CCGRule.FORWARD_APPLICATION
CCGRule.FORWARD_COMPOSITION
CCGRule.FORWARD_CROSSED_COMPOSITION
CCGRule.FORWARD_TYPE_RAISING
CCGRule.GENERALIZED_BACKWARD_COMPOSITION
CCGRule.GENERALIZED_BACKWARD_CROSSED_COMPOSITION
CCGRule.GENERALIZED_FORWARD_COMPOSITION
CCGRule.GENERALIZED_FORWARD_CROSSED_COMPOSITION
CCGRule.LEXICAL
CCGRule.REMOVE_PUNCTUATION_LEFT
CCGRule.REMOVE_PUNCTUATION_RIGHT
CCGRule.UNARY
CCGRule.UNKNOWN
CCGRule.__call__()
CCGRule.apply()
CCGRule.check_match()
CCGRule.infer_rule()
CCGRule.resolve()
CCGRule.symbol
CCGRuleUseError
CCGTree
CCGType
CCGType.CONJUNCTION
CCGType.CONJ_TAG
CCGType.NOUN
CCGType.NOUN_PHRASE
CCGType.PREPOSITIONAL_PHRASE
CCGType.PUNCTUATION
CCGType.SENTENCE
CCGType.__init__()
CCGType.argument
CCGType.direction
CCGType.is_atomic
CCGType.is_complex
CCGType.is_conjoinable
CCGType.is_empty
CCGType.is_over
CCGType.is_under
CCGType.left
CCGType.name
CCGType.over()
CCGType.parse()
CCGType.replace_result()
CCGType.result
CCGType.right
CCGType.slash()
CCGType.split()
CCGType.to_grammar()
CCGType.to_string()
CCGType.under()
Checkpoint
CircuitAnsatz
CoordinationRewriteRule
CrossEntropyLoss
CurryRewriteRule
Dataset
DepCCGParseError
DepCCGParser
DiagramRewriter
IQPAnsatz
LinearReader
LossFunction
MPSAnsatz
MSELoss
Model
NelderMeadOptimizer
NelderMeadOptimizer.__init__()
NelderMeadOptimizer.backward()
NelderMeadOptimizer.bounds
NelderMeadOptimizer.load_state_dict()
NelderMeadOptimizer.model
NelderMeadOptimizer.objective()
NelderMeadOptimizer.project()
NelderMeadOptimizer.state_dict()
NelderMeadOptimizer.step()
NelderMeadOptimizer.update_hyper_params()
NumpyModel
Optimizer
PennyLaneModel
PytorchModel
PytorchTrainer
QuantumModel
QuantumTrainer
Reader
RemoveCupsRewriter
RemoveSwapsRewriter
RewriteRule
Rewriter
RotosolveOptimizer
SPSAOptimizer
Sim14Ansatz
Sim15Ansatz
SimpleRewriteRule
SpacyTokeniser
SpiderAnsatz
StronglyEntanglingAnsatz
Symbol
TensorAnsatz
TketModel
Tokeniser
Trainer
TreeReader
TreeReaderMode
UnifyCodomainRewriter
UnknownWordsRewriteRule
VerbosityLevel
WebParseError
WebParser
diagram2str()
- Subpackages
- Class diagrams
- Command-line interface