Discopy

Latest version: v1.2.0

Safety actively analyzes 714919 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 7

1.1.2

New features:

- the `interaction` module implements the Int-construction from balanced to ribbon categories, see PR https://github.com/discopy/discopy/pull/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 https://github.com/discopy/discopy/pull/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__`

0.6.0

- 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

0.5.1.2

Fixes:
- Fix jax support for traced objects (see 177)

0.5.1.1

Features:
* better pennylane support, see PR https://github.com/discopy/discopy/pull/127

Fixes:
* fix controlled gate decomposition, see PR https://github.com/discopy/discopy/pull/140

0.5.0

Added:

- `Ry` gate for `from_tk`
- Add ansatz 8 from arXiv:1905.10876 (Sim et al.)

Changed:
- Always decompose long range gates in `to_tn`

Fixed:
- Custom mixed states in `to_tn`
- Add `l`, `r` - adjoints to `Swap`
- Fix `infer_dtype` for jax backend

0.4.3

Added:
* New optics module, check `discopy.quantum.optics`
* Add ansatze from arXiv:1905.10876 (Sim et al.)

Changed:
* Upgrade PyZX dependency to version 0.7.0
* Defer slow imports of matplotlib, networkx and sympy.
* Change default behaviour of permutation to not give the inverse
* Fix `from_pyzx`

Page 2 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.