The Python toolkit for computing with string diagrams


DisCoPy is free software, its source code is open and hosted on GitHub. To learn more, we suggest to start with the documentation.


Applied category theory is information plumbing. It’s boring… but plumbers save more lives than doctors.

Once string diagrams become as ubiquitous as matrices, they will need their own fundamental package: DisCoPy.


DisCoPy began as an implementation of:

  • DisCoCat (distributional compositional categorical) models,
  • and QNLP (quantum natural language processing).

This application has now been packaged into its own library, lambeq.


Want to contribute or just ask us a question? Get in touch on Discord!