String diagram
String diagrams are a formal graphical language for representing morphisms in monoidal categories, or more generally 2-cells in 2-categories. They are a prominent tool in applied category theory. When interpreted in the monoidal category of vector spaces and linear maps with the tensor product, string diagrams are called tensor networks or Penrose graphical notation. This has led to the development of categorical quantum mechanics where the axioms of quantum theory are expressed in the language of monoidal categories. History Günter Hotz gave the first mathematical definition of string diagrams in order to formalise electronic circuits. However, the invention of string diagrams is usually credited to Roger Penrose, with Feynman diagrams also described as a precursor. They were later characterised as the arrows of free monoidal categories in a seminal article by André Joyal and Ross Street. While the diagrams in these first articles were hand-drawn, the advent of typesetting software such as LaTeX and PGF/TikZ made the publication of string diagrams more wide-spread. The existential graphs and diagrammatic reasoning of Charles Sanders Peirce are arguably the oldest form of string diagrams, they are interpreted in the monoidal category of finite sets and relations with the Cartesian product. The lines of identity of Peirce's existential graphs can be axiomatised as a Frobenius algebra, the cuts are unary operators on homsets that axiomatise logical negation. This makes string diagrams a sound and complete two-dimensional deduction system for first-order logic, invented independently from the one-dimensional syntax of Gottlob Frege's Begriffsschrift. Intuition String diagrams are made of boxes , which represent processes, with a list of wires coming in at the top and at the bottom, which represent the input and output systems being processed by the box . Starting from a collection of wires and boxes, called a signature, one may generate the set of all string diagrams by induction: each box is a string diagram, for each list of wires , the identity is a string diagram representing the process which does nothing to its input system, it is drawn as a bunch of parallel wires, for each pair of string diagrams and , their tensor is a string diagram representing the parallel composition of processes, it is drawn as the horizontal concatenation of the two diagrams, for each pair of string diagrams and , their composition is a string diagram representing the sequential composition of processes, it is drawn as the vertical concatenation of the two diagrams. Definition Algebraic Let the Kleene star denote the free monoid, i.e. the set of lists with elements in a set . A monoidal signature is given by: a set of generating objects, the lists of generating objects in are also called types, a set of generating arrows, also called boxes, a pair of functions which assign a domain and codomain to each box, i.e. the input and output types. A morphism of monoidal signature is a pair of functions and which is compatible with the domain and codomain, i.e. such that and . Thus