Releases: CQCL/lambeq
Releases · CQCL/lambeq
0.2.6
Added:
- A strict pregroups mode to the CLI. With this mode enabled, all swaps are removed from the output string diagrams by changing the ordering of the atomic types, converting them into a valid pregroup form.
Fixed:
- Adjusted the behaviour of output normalisation in quantum models. Now,
NumpyModel
always returns probabilities instead of amplitudes. - Removed the prediction from the output of the
SPSAOptimizer
, which now returns just the loss.
0.2.5
Added:
- Added a "swapping" unary rule box to handle unary rules that change the direction of composition, improving the coverage of the
BobcatParser
. - Added a
--version
flag to the CLI. - Added a
make_checkpoint
method to all training models.
Changed:
- Changed the
WebParser
so that the online service to use is specified by name rather than by URL. - Changed the
BobcatParser
to only allow one tree per category in a cell, doubling parsing speed without affecting the structure of the parse trees (in most cases). - Made the linting of the codebase stricter, enforced by the GitHub action. The flake8 configuration can be viewed in the
setup.cfg
file.
Fixed:
- Fixed the parameter names in
CCGRule
, wheredom
andcod
had inadvertently been swapped.
0.2.4
Added:
- Support for using
jax
as backend oftensornetwork
when settinguse_jit=True
in theNumpyModel
. The interface is not affected by this change, but performance of the model is significantly improved.
Fixed:
- Fix a bug that caused the
BobcatParser
and theWebParser
to trigger an SSL certificate error using Windows. - Fix false positives in assigning conjunction rule using the
CCGBankParser
. The rule, + X[conj] -> X[conj]
is a case of removing left punctuation, but was being assigned conjunction erroneously.
0.2.3
Added:
CCGRule
: Addsymbol
method that returns the ASCII symbol of a given CCG rule.CCGTree
: Extendderiv
method with CCG output. It is now capable of returning standard CCG diagrams.- Command-line interface: CCG mode. When enabled, the output will be a string representation of the CCG diagram corresponding to the
CCGTree
object produced by the parser, instead of DisCoPy diagram or circuit. - Documentation: Add a troubleshooting page.
Change:
- Change the behaviour of
spiders_reader
such that the spiders decompose logarithmically. This change also affects other rewrite rules that use spiders, such as coordination and relative pronouns. - Rename
AtomicType.PREPOSITION
toAtomicType.PREPOSITIONAL_PHRASE
.
Fixed:
- Fix a bug that raised a
dtype
error when using theTketModel
on Windows. - Fix a bug that caused the normalisation of scalar outputs of circuits without open wires using a
QuantumModel
.
0.2.2
Added:
- Add support for Python 3.10.
- Unify class hierarchies for parsers and readers:
CCGParser
is now a subclass ofReader
and placed in the common packagetext2diagram
. The old packagesreader
andccg2discocat
are no longer available. Compatibility problems with previous versions should be minimal, since from Release 0.2.0 and onwards alllambeq
classes can be imported from the global namespace. - Add
CurryRewriteRule
, which uses map-state duality in order to remove adjoint types from the boxes of a diagram. When used in conjunction withdiscopy.rigid.Diagram.normal_form()
, this removes cups from the diagram, eliminating post-selection. - The
Bobcat
parser now updates automatically when new versions are made available online. - Allow customising available root categories for the parser when using the command-line interface.
Fixed:
- Update grammar file of
Bobcat
parser to avoid problems with conflicting unary rules.
0.2.1
Added:
- A new
Checkpoint
class that implements pickling and file operations fromTrainer
andModel
.
Changed:
- Improvements to the
training
module, allowing multiple diagrams to be accepted as input to theSPSAOptimizer
. - Updated documentation, including sub-package structures and class diagrams.
0.2.0
Added:
- A new state-of-the-art CCG parser, fully integrated with
lambeq
, which replaces depccg as the default parser of the toolkit. The newBobcat
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
training
package, providing a selection of trainers, models, and optimizers that greatly simplify supervised training for most oflambeq
's use cases, classical and quantum. The new package adds several new features tolambeq
, such as the ability to save to and restore models from checkpoints. - Furthermore, the
training
package usesDisCoPy
's tensor network capability to contract tensor diagrams efficiently. In particular,DisCoPy
0.4.1's new unitary and density matrix simulators in result in substantially faster training speeds 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
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). - A new
TreeReader
class that exploits the biclosed structure of CCG grammatical derivations. - Three new rewrite rules for relative pronouns and coordination.
- Tokenisation features have been added in all parsers and readers.
- Additional generator methods and minor improvements for the
CCGBankParser
class.
Changed:
- Improved and more detailed package structure.
- Most classes and functions can now be imported from
lambeq
directly, instead of having to import from the sub-packages. - The
circuit
andtensor
modules have been combined into anlambeq.ansatz
package. (However, as mentioned above, the classes and functions they define can now be imported directly fromlambeq
and should continue to do so in future releases.) - Improved documentation and additional tutorials.
0.1.2
0.1.1
Minor changes:
- Update install script to use PyPI package
- Add badges and link to documentation to README file
- Add lambeq logo and link to GitHub to documentation
- Allow documentation to automatically get package version
- Add keywords and classifiers to setup file
Fixes:
- Add
lambeq.circuit
submodule to top-levellambeq
module - Fix references to license file
0.1.0
Initial release of lambeq. This contains a lot of core material:
- converting sentences to string diagrams
- CCG parsing, including reading from CCGBank
- support for depccg parsing
- rewriting diagrams
- ansatze for circuits and tensors, including MPS ansatze
- support for JAX and PyTorch integration
- example notebooks and documentation