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

05/19/2021
by   Paul Wilson, et al.
0

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 fewer 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 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.

READ FULL TEXT
research
05/16/2022

Promonads and String Diagrams for Effectful Categories

Premonoidal and Freyd categories are both generalized by non-cartesian F...
research
06/04/2019

Bialgebraic Semantics for String Diagrams

Turi and Plotkin's bialgebraic semantics is an abstract approach to spec...
research
04/29/2021

String Diagram Rewrite Theory II: Rewriting with Symmetric Monoidal Structure

Symmetric monoidal theories (SMTs) generalise algebraic theories in a wa...
research
10/13/2021

Representing Matrices Using Algebraic ZX-calculus

Elementary matrices play an important role in linear algebra application...
research
05/01/2023

Data-Parallel Algorithms for String Diagrams

We give parallel algorithms for string diagrams represented as structure...
research
04/20/2018

Normal forms for planar connected string diagrams

In the graphical calculus of planar string diagrams, equality is generat...
research
07/16/2023

Compositional Solution of Mean Payoff Games by String Diagrams

Following our recent development of a compositional model checking algor...

Please sign up or login with your details

Forgot password? Click here to reset