Skip to content

0.4.0

Compare
Choose a tag to compare
@Thommy257 Thommy257 released this 11 Jan 15:14
· 35 commits to main since this release

Added:

  • A new integrated backend that replaces 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:

    • lambeq.backend.grammar: Contains the building blocks for creating string diagrams.
    • lambeq.backend.tensor: Contains the necessary classes to create tensor diagrams.
    • lambeq.backend.quantum: Adds quantum-specific functionality to the backend and provides a circuit simulator based on the TensorNetwork library.
    • lambeq.backend.pennylane: Interface with PennyLane.
    • lambeq.backend.tk: Inteface with Tket.
    • lambeq.backend.numerical_backend: Common interface for numerical backends (such as Numpy, Jax, PyTorch, TensorFlow)
    • lambeq.backend.drawing: Contains drawing functionality for diagrams and circuits.
  • lambeq.BobcatParser: Added a special case for adjectival conjunction in tree translation.

  • lambeq.TreeReader: Diagrams now are created straight from the lambeq.CCGTree.

  • lambeq.CCGRule apply method: Added lambeq.CCGRule.apply method to class lambeq.CCGRule.

Changed:

  • Diagram-level rewriters: Rewrite functions remove_cups and remove_swaps are now refactored as diagram-level rewriters, lambeq.RemoveCupsRewriter and lambeq.RemoveSwapsRewriter correspondingly.
  • Extra whitespace is now ignored in the lambeq.Tokeniser.

Fixed:

  • lambeq.UnknownWordsRewriteRule: Fixed rewriting of non-word boxes.

Removed:

  • Removed CCGTree.to_biclosed_diagram and references to discopy.biclosed. Now CCG trees are directly converted into string diagrams, without the extra step of storing the derivation in a biclosed form.
  • lambeq.CCGRule: Removed replace_cat_result and added lambeq.CCGRule.resolve.