Today I would like to introduce a diagrammatic notation for dealing with tensor products and multilinear maps. The basic idea for this notation appears to be due to Penrose. It has the advantage of both being widely applicable and easier and more intuitive to work with; roughly speaking, computations are performed by topological manipulations on diagrams, revealing the natural notation to use here is 2-dimensional (living in a plane) rather than 1-dimensional (living on a line).

For the sake of accessibility we will restrict our attention to vector spaces. There are category-theoretic things happening in this post but we will not point them out explicitly. We assume familiarity with the notion of tensor product of vector spaces but not much else.

Below the composition of a map with a map will be denoted (rather than the more typical ). This will make it easier to translate between diagrams and non-diagrams. All diagrams were drawn in Paper.

**String diagrams**

**String diagrams** for finite-dimensional vector spaces work as follows. To start with, a linear map is represented by a box labeled with one input string labeled and one output string labeled . Composition of linear maps and is given by pairing input and output wires with matching labels.

The tensor product of two linear maps is a map represented graphically by stacking boxes vertically. Note that has two input wires and two output wires.

The -dimensional vector space is not represented by a wire at all, to reflect the fact that it is an identity for tensor product in the sense that there is a natural isomorphism . Thus a vector in a vector space is a morphism , which is just a box with no input wire and one output wire, and a linear functional or covector is a morphism , which is just a box with no output wire and one input wire.

The identity map is represented by a wire with no attached box, to reflect the fact that it is an identity for composition, and the identity map is not represented by anything at all.

In general, an arbitrary linear map

(obtained for example by taking the tensor product of various other maps) is represented by a box labeled with input wires labeled and output wires labeled .

Such maps admit a generalized notion of composition given by pairing only some input and output wires rather than all of them (defined formally by composition after tensoring with a suitable collection of identity morphisms). For example, if is a bilinear map on a vector space , the following is the statement that is associative:

In 1-dimensional notation, this reads

.

Implicit in our use of string diagram notation is the **interchange law**, which asserts that the following diagram is a well-defined map (in the sense that the two ways of evaluating it using tensor products and compositions produce the same result):

In 1-dimensional notation, this reads

.

The interchange law should be thought of as a -dimensional version of associativity. It allows us to “drop generalized parentheses” in the sense that we do not have to specify what order we tensor and compose a family of maps as above.

**Symmetry**

The tensor product is commutative in a suitable sense, so we should be able to freely change the order of input and output wires. We can do this formally as follows. For any pair of vector spaces there is a distinguished **symmetry** map

which is represented by unlabeled crossing wires. The symmetry maps obey various axioms which ensure that they behave like crossing wires ought to. The most important axiom is **naturality**, which asserts that we can slide boxes along symmetries:

In 1-dimensional notation, this reads

.

Note that if we only want to slide one box along a symmetry we can let the other one be an identity.

Strictly speaking, naturality also applies to morphisms drawn with more than one input or output wire, so can look more complicated than the above.

Another axiom obeyed by the symmetry asserts that applying the symmetry twice gives the identity. Topologically it is described by pulling two wires apart. Looking ahead to future posts, we will call this axiom **Reidemeister II**:

In 1-dimensional notation, this reads .

The third axiom we will discuss is sometimes called the **braid relation**, but following the pattern of the above naming scheme we will call it **Reidemeister III**. Topologically it is described by pulling the middle wire across a crossing:

In 1-dimensional notation, this reads that

is equal to

.

In particular, specialized to the case of an -fold tensor product , Reidemeister II and III are precisely the relations in a well-known presentation of the symmetric group , so that naturally acts on .

The symmetry maps allow string diagrams greater expressive power. For example, if is a bilinear map, the following is the statement that is commutative:

on September 1, 2014 at 7:12 am |Hopf algebroids and (quantum) groupoids (Part 1) | Simplicity[…] diagrams isn’t clear, you can learn about string diagrams in several places on the web, like here or […]

on November 8, 2012 at 2:23 am |home_pw@msn.comin the symmetry section, consider the first formula. Should the last symbol be V as given, or U? (i.e. typo)?

on November 8, 2012 at 6:15 pm |Qiaochu YuanYes, it should be . Fixed.

on November 6, 2012 at 11:16 pm |String diagrams, duality, and trace « Annoying Precision[…] « Introduction to string diagrams […]

on November 6, 2012 at 7:01 am |Todd TrimbleNo mention of Joyal and Street???

on November 6, 2012 at 1:07 pm |Qiaochu YuanI’m not familiar with the history of string diagrams and I didn’t want to say something incorrect about Joyal and Street’s contributions. I also didn’t want to talk too much about category theory until later.

on November 6, 2012 at 3:31 pm |Zhen LinTo the best of my knowledge, the calculus of string diagrams as applied to braided monoidal categories was first formalised by Joyal and Street in their 1991 paper, in which the soundness of the calculus is also proven. But if you are only using string diagrams for, say, the category of finite-dimensional vector spaces, then it is probably not unfair to only mention Penrose.

Penrose’s diagrammatic notation has some other clever features: for example, the metric tensor is written as an upside down U, highlighting its naturality of its use in lowering indices. Even determinants can be expressed reasonably efficiently… that’s all in _Road to Reality_.

on November 6, 2012 at 5:26 pm |Todd Trimble@Zhen: (as an aside, I’m sure you know that Geometry of Tensor Calculus I covers a number of doctrines besides braided monoidal categories). I have to admit that I’ve looked only cursorily at Penrose’s work. Does he prove theorems that place his notation on a rigorous footing? It was my impression that this is precisely a value of Joyal and Street’s work. (Of course, Feynman diagrams were another precursor of string diagrams. It could even be said that Peirce’s existential graphs were yet another precursor.)

on November 7, 2012 at 12:58 pm |Zhen Lin@Todd: If Penrose proved anything, it probably isn’t be in _Road to Reality_. But I’m not sure there’s anything that even needs proving in the context of finite-dimensional vector spaces: all the objects in question can be regarded as arrays of numbers, and the diagram is just a way of keeping track of all the indices and contractions. Of course, maybe there’s some subtlety I’m missing…

on November 7, 2012 at 6:15 pm |Todd TrimbleZhen, I’m not sure I really want to argue about it here, but it seems to me a major point of string diagrams would be the recognition that the meaning of a string diagram, whether in a general monoidal category or just in vector spaces, is invariant under certain types of deformation of string diagrams (e.g., the yanking moves for adjunctions) — that seems to be the whole point which makes their manipulation so effective. And it seems to me that that point is definitely in need of proof, even when restricted to just the vector space case.

But I’m happy to shut up and let Qiaochu keep talking!

on November 6, 2012 at 4:02 am |Rod CarvalhoIn the first diagram, shouldn’t it be instead of ?

on November 6, 2012 at 6:12 am |Rod CarvalhoNevermind. You answer this question in:

on November 6, 2012 at 12:41 am |Zhen LinString diagrams are a wonderful tool, and not just for calculations in monoidal categories – minus the braiding part, they work in bicategories too. It’s incredibly helpful when trying to work out proofs involving lots of functors and natural transformations. The triangle identities involving adjunctions take a particularly nice form when presented as string diagrams, which makes working with them a lot easier.

on November 6, 2012 at 1:06 pm |Qiaochu YuanYes, I might talk about this in a subsequent post (but no jinxes).