Releases: discopy/discopy
Releases · discopy/discopy
v1.1.7
What's Changed
- Add example to README.md by @toumix in #253
- Fix docs, remove architecture from readme by @toumix in #255
- Fix pregroup swap rotation by @toumix in #258
- Fix documentation, update its dependencies by @boldar99 in #260
- feat: Do not infer dtype when
data
isNone
intensor.Box
by @boldar99 in #261 - Update build.yml with versions 3.10 and 3.11 by @toumix in #262
- Fix CRz and CRx gate conversion by @y-richie-y in #263
- Fix scalar too by @y-richie-y in #264
- Fix CZ scalar too by @y-richie-y in #265
- TypeVar argument must be str by @toumix in #267
Full Changelog: 1.1.6...1.1.7
v1.1.6
v1.1.5
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 thedtype
.- A hypergraph equality context manager has been.
Discard
has been defined onMarkov
categoriesTensor.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
v0.6.0
v1.1.3
v0.5.1.2
v1.1.2
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
andfrobenius
for free Diagram.from_callable
allows to build diagrams as decorated python functions
Main changes:
Matrix
now infers thedtype
if it is not specified, see PR #161balanced.Diagram
is now a subclass oftraced.Diagram
cartesian
is renamed tomarkov
andfrobenius.Diagram
is now a subclass ofmarkov.Diagram
hypergraph.Diagram
is renamed to justhypergraph.Hypergraph
- the new
Hypergraph
class is a named generic parameterised by acategory
, 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 methodHypergraph.from_box
upgrade
anddowngrade
are renamed tofrom_
andto_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 subclassesrigid.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 offrobenius.Diagram
instead ofrigid
. 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
andis_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 forCircuit.__getattr__
v0.5.1.1
v1.0.0
Added:
- modules for the hierarchy of graphical languages: traced, pivotal, compact, etc.
- a hierarchy of
Category
classes which serve as the domain and codomain ofFunctor
- 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 olddiscopy.drawing.legacy
, withto_ascii
andto_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 explicitdom
anddtype
categorial
andpregroup
now have their ownDiagram
classgrammar
now has two new modulesthue
(i.e. unrestricted grammar) anddependency
(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
andoffsets
are now properties rather than attributes- rename
Functor.ob_factory
andFunctor.ar_factory
toFunctor.cod.ob
andFunctor.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 oftensor.Diagram
- rename
biclosed
toclosed
- swap the semantics
curry(left=True)
andcurry(left=False)
for more consistency (i.e.rigid.Diagram.curry
uses left adjoint whenleft=True
) rigid.Diagram.l
and.r
now implement the diagrammatic transpose rather than the conjugate, they both call a new methodrotate
Removed:
- nothing is imported from
rigid
by default anymore, thusfrom discopy import Ty
must be replaced byfrom discopy.X import Ty
for the desired module X (e.g.rigid
orgrammar.pregroup
) pregroup.draw
is gone, it will eventually become a special case of the new grid drawingsympy
evaluation of tensor networks is gone, uselambdify
instead- no more
Swap
orSpider
inrigid
, it now goes tocompact
andfrobenius