_images/snake-equation.png

DisCoPy documentation#

DisCoPy is a Python toolkit for computing with string diagrams.

DisCoPy began as an implementation of DisCoCat and QNLP. This has now become its own library: lambeq.

Features#

Architecture#

Software dependencies between modules go top-to-bottom, left-to-right and forgetful functors between categories go the other way.

syntax
cat

grammar
       ┌───────
monoidal

───────┐       
cfg
braided







traced






└──────
closed

categorial
rigid

pregroup
pivotal

dependency
balanced

─────────────

interaction
ribbon

circuit
symmetric

─────────────

hypergraph
compact

tk
markov
─────────────
frobenius
zx
python
matrix
tensor
channel
semantics
quantum

Quickstart#

pip install discopy

If you want to see DisCoPy in action, check out the QNLP tutorial!

Contribute#

We’re keen to welcome new contributors!

First, read the contributing guidelines. Then get in touch on Discord or open an issue.

How to cite#

If you wish to cite DisCoPy in an academic publication, we suggest you cite:

  • G. de Felice, A. Toumi & B. Coecke, DisCoPy: Monoidal Categories in Python, EPTCS 333, 2021, pp. 183-197, DOI: 10.4204/EPTCS.333.13

If furthermore your work is related to quantum computing, you can also cite:

  • A. Toumi, G. de Felice & R. Yeung, DisCoPy for the quantum computer scientist, arXiv:2205.05190

Indices and tables#