String diagram

In category theory, string diagrams are a way of representing morphisms in monoidal categories, or more generally 2-cells in 2-categories.
Definition.
The idea is to represent structures of dimension "d" by structures of dimension "2-d", using Poincaré duality. Thus,
The parallel composition of 2-cells corresponds to the horizontal juxtaposition of diagrams and the sequential composition to the vertical juxtaposition of diagrams.
Example.
Consider an adjunction formula_3 between two categories formula_4 and formula_5 where formula_6 is left adjoint of formula_7 and the natural transformations formula_8 and formula_9 are respectively the unit and the counit. The string diagrams corresponding to these natural transformations are:
The string corresponding to the identity functor is drawn as a dotted line and can be omitted.
The definition of an adjunction requires the following equalities:
The first one is depicted as
Other diagrammatic languages.
Morphisms in monoidal categories can also be drawn as string diagrams since a strict monoidal category can be seen as a 2-category with only one object (there will therefore be only one type of planar region) and Mac Lane's strictification theorem states that any monoidal category is monoidally equivalent to a strict one. The graphical language of string diagrams for monoidal categories may be extended to represent expressions in categories with other structure, such as braided monoidal categories, dagger categories, etc. and is related to geometric presentations for braided monoidal categories and ribbon categories. In quantum computing, there are several diagrammatic languages based on string diagrams for reasoning about linear maps between qubits, the most well-known of which is the ZX-calculus.