English

The Cost of Compositionality: A High-Performance Implementation of String Diagram Composition

Category Theory 2022-11-04 v2 Programming Languages

Abstract

String diagrams are an increasingly popular algebraic language for the analysis of graphical models of computations across different research fields. Whereas string diagrams have been thoroughly studied as semantic structures, much less attention has been given to their algorithmic properties, and efficient implementations of diagrammatic reasoning are almost an unexplored subject. This work intends to be a contribution in such a direction. We introduce a data structure representing string diagrams in terms of adjacency matrices. This encoding has the key advantage of providing simple and efficient algorithms for composition and tensor product of diagrams. We demonstrate its effectiveness by showing that the complexity of the two operations is linear in the size of string diagrams. Also, as our approach is based on basic linear algebraic operations, we can take advantage of heavily optimised implementations, which we use to measure performances of string diagrammatic operations via several benchmarks.

Keywords

Cite

@article{arxiv.2105.09257,
  title  = {The Cost of Compositionality: A High-Performance Implementation of String Diagram Composition},
  author = {Paul Wilson and Fabio Zanasi},
  journal= {arXiv preprint arXiv:2105.09257},
  year   = {2022}
}

Comments

In Proceedings ACT 2021, arXiv:2211.01102

R2 v1 2026-06-24T02:16:14.077Z