In mathematics, 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 FinVect, the monoidal category of finite-dimensional 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 widespread. 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 f:x→y, which represent processes, with a list of wires x coming in at the top and y at the bottom, which represent the input and output systems being processed by the box f. Starting from a collection of wires and boxes, called a signature, one may generate the set of all string diagrams by induction:
each box f:x→y is a string diagram, for each list of wires x, the identity id(x):x→x 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 f:x→y and f′:x′→y′, their tensor f⊗f′:xx′→yy′ 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 f:x→y and g:y→z, their composition g∘f:x→z 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 X⋆ denote the free monoid, i.e. the set of lists with elements in a set X. A monoidal signature Σ is given by:
a set Σ0 of generating objects, the lists of generating objects in Σ0⋆ are also called types, a set Σ1 of generating arrows, also called boxes, a pair of functions dom,cod:Σ1→Σ0⋆ which assign a domain and codomain to each box, i.e. the input and output types. A morphism of monoidal signature F:Σ→Σ′ is a pair of functions F0:Σ0→Σ'0 and F1:Σ1→Σ'1 which is compatible with the domain and codomain, i.e. such that dom∘F1 = F0∘dom and cod∘F1 = F0∘cod. Thus we get the category 𝐌𝐨𝐧𝐒𝐢𝐠 of monoidal signatures and their morphisms. There is a forgetful functor U:𝐌𝐨𝐧𝐂𝐚𝐭→𝐌𝐨𝐧𝐒𝐢𝐠 which sends a monoidal category to its underlying signature and a monoidal functor to its underlying morphism of signatures, i.e. it forgets the identity, composition and tensor. The free functor C−:𝐌𝐨𝐧𝐒𝐢𝐠→𝐌𝐨𝐧𝐂𝐚𝐭, i.e. the left adjoint to the forgetful functor, sends a monoidal signature Σ to the free monoidal category CΣ it generates. String diagrams (with generators from Σ) are arrows in the free monoidal category CΣ. The interpretation in a monoidal category D is a defined by a monoidal functor F:CΣ→D, which by freeness is uniquely determined by a morphism of monoidal signatures F:Σ→U(D). Intuitively, once the image of generating objects and arrows are given, the image of every diagram they generate is fixed.
Geometric A topological graph, also called a one-dimensional cell complex, is a tuple (Γ,Γ0,Γ1) of a Hausdorff space Γ, a closed discrete subset Γ0⊆Γ of nodes and a set of connected components Γ1 called edges, each homeomorphic to an open interval with boundary in Γ0 and such that Γ−Γ0=∐Γ1. A plane graph between two real numbers a,b∈ℝ with a<b is a finite topological graph embedded in ℝ×[a,b] such that every point x∈Γ ∩ ℝ×{a,b} is also a node x∈Γ0 and belongs to the closure of exactly one edge in Γ1. Such points are called outer nodes, they define the domain and codomain dom(Γ),cod(Γ)∈Γ1⋆ of the string diagram, i.e. the list of edges that are connected to the top and bottom boundary. The other nodes f∈Γ0 − {a,b}×ℝ are called inner nodes. A plane graph is progressive, also called recumbent, when the vertical projection e→[a,b] is injective for every edge e∈Γ1. Intuitively, the edges in a progressive plane graph go from top to bottom without bending backward. In that case, each edge can be given a top-to-bottom orientation with designated nodes as source and target. One can then define the domain and codomain dom(f),cod(f)∈Γ1⋆ of each inner node f, given by the list of edges that have source and target. A plane graph is generic when the vertical projection Γ0−{a,b}×ℝ→[a,b] is injective, i.e. no two inner nodes are at the same height. In that case, one can define a list boxes(Γ)∈Γ0⋆ of the inner nodes ordered from top to bottom. A progressive plane graph is labeled by a monoidal signature Σ if it comes equipped with a pair of functions v0:Γ1→Σ0 from edges to generating objects and v1:Γ0−{a,b}×ℝ→Σ1 from inner nodes to generating arrows, in a way compatible with domain and codomain. A deformation of plane graphs is a continuous map h:Γ×[0,1]→[a,b]×ℝ such that
the image of h(−,t) defines a plane graph for all t∈[0,1], for all x∈Γ0, if h(x,t) is an inner node for some t it is inner for all t∈[0,1]. A deformation is progressive (generic, labeled) if h(−,t) is progressive (generic, labeled) for all t∈[0,1]. Deformations induce an equivalence relation with Γ∼Γ′ if and only if there is some h with h(−,0)=Γ and h(−,1)=Γ′. String diagrams are equivalence classes of labeled progressive plane graphs. Indeed, one can define:
… excerpt ends here. Continue reading the full article.





