Skip to content

Releases: discopy/discopy

v1.1.7

20 Mar 09:25
7b0f777
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.1.6...1.1.7

v1.1.6

21 Dec 11:33
e1a90c7
Compare
Choose a tag to compare

Bug fixes:

  • Fix caching mechanism of NamedGeneric
  • Fix pickling of parametrised classes

v1.1.5

20 Nov 11:12
9fb2cc8
Compare
Choose a tag to compare

New features:

  • Unpickling is now backward compatible: pickled diagrams from DisCoPy v0.6 can be unpickled into the current version.
  • Tensor is now parametrised by the dtype.
  • A hypergraph equality context manager has been.
  • Discard has been defined on Markov categories
  • Tensor.copy has been added
  • The term "polygynous" has been changed to "left monogamous"

Bug fixes:

  • Missing qiskit-aer import has been added
  • Missing Sum classes has been added to markov
  • Broken links in QNLP tutorial has been fixed
  • Ribbon rotation has been fixed
  • Matrix.swap has been fixed

Notable updates in the documentation:

  • Examples from arXiv:2205.05190 has been added into docs/notebooks/examples.ipynb

v1.1.4

22 Jun 11:19
c708018
Compare
Choose a tag to compare

Fix PennyLane Sympy substitution

v0.6.0

16 Jun 08:33
f804929
Compare
Choose a tag to compare
  • Now the convention of the density matrix is the same as DisCoPy 1: U @ U*
  • The documentation has been fixed.
  • Serialisation has been fixed. The new recommendation is to just pickle.dump circuits, and soon, we'll implement their loading into DisCoPy 1

v1.1.3

02 Jun 09:01
e0cbf81
Compare
Choose a tag to compare
  • Revert symmetric diagram hashing and equality back to old behaviour, see PR #179
  • Fix flake8 coding style #178

v0.5.1.2

01 Jun 11:20
Compare
Choose a tag to compare

Fixes:

  • Fix jax support for traced objects (see #177)

v1.1.2

26 May 07:46
d405730
Compare
Choose a tag to compare

New features:

  • the interaction module implements the Int-construction from balanced to ribbon categories, see PR #144
  • equality of symmetric.Diagram computes hypergraph isomorphism, so that we get all the axioms for free
  • similarly, we get the axioms of traced, compact, markov and frobenius for free
  • Diagram.from_callable allows to build diagrams as decorated python functions

Main changes:

  • Matrix now infers the dtype if it is not specified, see PR #161
  • balanced.Diagram is now a subclass of traced.Diagram
  • cartesian is renamed to markov and frobenius.Diagram is now a subclass of markov.Diagram
  • hypergraph.Diagram is renamed to just hypergraph.Hypergraph
  • the new Hypergraph class is a named generic parameterised by a category, in this way it does not depend on any of symmetric, compact or frobenius
  • the hypergraph.Box class is not needed anymore, it is replaced by a method Hypergraph.from_box
  • upgrade and downgrade are renamed to from_ and to_diagram
  • Hypergraph.is_progressive now allows spiders to from one input to many outputs
  • an extended signature for Diagram.encode to allow easier transition from the old v0.5 syntax (dom, cod, boxes, offsets)
  • a new class pregroup.Ty is introduced, it subclasses rigid.Ty. It overrides the adjointness check to be more flexible and allow for forbidden cups and caps, e.g. Cup(n.r, n)
  • pregroup.Diagram is now a subclass of frobenius.Diagram instead of rigid. This allows for spiders and swaps in pregroup diagrams, while retaining the distinction between left and right adjoints
  • two new methods closed.Ty.is_under and is_over to account for the fact that tensoring an exponential object with the empty type does not yield an exponential object
  • refactoring of the quantum module to make the gate application methods cleaner, removing the need for Circuit.__getattr__

v0.5.1.1

29 Mar 15:52
Compare
Choose a tag to compare

Features:

  • better pennylane support, see PR #127

Fixes:

  • fix controlled gate decomposition, see PR #140

v1.0.0

12 Jan 18:43
Compare
Choose a tag to compare

Added:

  • modules for the hierarchy of graphical languages: traced, pivotal, compact, etc.
  • a hierarchy of Category classes which serve as the domain and codomain of Functor
  • an inheritance mechanism with factory methods that allow better code reuse, e.g. composition of diagrams is defined exactly once in Arrow.then
  • syntactic sugar for whiskering, i.e. tensoring with an identity on a given object
  • layers may have more than one box, the foliation method merges layers together
  • module discopy.drawing.grid which will eventually replace the old discopy.drawing.legacy, with to_ascii and to_html
  • the category of matrices with direct sum and the category of Python functions
  • matrices and tensors are explicitly parameterised by their data type
  • tensor.Functor now has an explicit dom and dtype
  • categorial and pregroup now have their own Diagram class
  • grammar now has two new modules thue (i.e. unrestricted grammar) and dependency (with an interface to spaCy)

Changed:

  • a complete refactor of the documentation with a new "executable book" style
  • more uniform syntax for arrows, diagrams, functions and matrices with the same signature inside, dom, cod
  • boxes and offsets are now properties rather than attributes
  • rename Functor.ob_factory and Functor.ar_factory to Functor.cod.ob and Functor.cod.ar
  • better type checking and error handling, it is only possible to compose diagrams that are from the same factory
  • types now behave like strings, i.e. indexing a type yields a type again
  • Circuit is a now a subclass of tensor.Diagram
  • rename biclosed to closed
  • swap the semantics curry(left=True) and curry(left=False) for more consistency (i.e. rigid.Diagram.curry uses left adjoint when left=True)
  • rigid.Diagram.l and .r now implement the diagrammatic transpose rather than the conjugate, they both call a new method rotate

Removed:

  • nothing is imported from rigid by default anymore, thus from discopy import Ty must be replaced by from discopy.X import Ty for the desired module X (e.g. rigid or grammar.pregroup)
  • pregroup.draw is gone, it will eventually become a special case of the new grid drawing
  • sympy evaluation of tensor networks is gone, use lambdify instead
  • no more Swap or Spider in rigid, it now goes to compact and frobenius