and informal introduction. We remark that this calculus is quite general. Although we only consider the graphical calculus of , the category of finite-dimensional Hilbert spaces and linear maps, most of what we prove holds in the general setting of dagger compact categories [@Kelly1972; @Kelly1980; @Abramsky2004].

In the string diagram calculus

, wires correspond to finite-dimensional Hilbert spaces and boxes correspond to linear maps.

We read diagrams from bottom to top.

Composition and tensor product are depicted as follows:

(0,0) to (0,3.5); at (0,1.05) [$f$]{}; at (0,2.45) [$g$]{}; at (0,0)[$V_1$]{}; at (0, 1.75) [$V_2$]{}; at (0, 3.5) [$V_3$]{};

&

(0,0) to (0,3.5); (1.5,0) to (1.5,3.5); at (0,1.75) [$f$]{}; at (1.5,1.75) [$g$]{}; at (0,0)[$V_1$]{}; at (1.5, 0) [$V_3$]{}; at (0, 3.5) [$V_2$]{}; at (1.5, 3.5) [$V_4$]{};

\
gf:V\_1V\_3 & fg: V\_1V\_3V\_2V\_4

All finite-dimensional Hilbert spaces $V$ have dual spaces $V^*=\Hom(V,\mathbb{C})$, represented in the graphical calculus as an oriented wire with the opposite orientation as $V$. Duality is characterized by the following linear maps, here called *cups and caps*:

\[eq:cupscapsHilb\]

(0,0) to \[out=up, in=up, looseness=2.5\] (2,0) ; at (2.05,0) [$\pv V$]{}; at (0,0) [$V^*$]{};

&

(0,0) to \[out=up, in=up, looseness=2.5\] (2,0) ; at (2.0,0) [$\pv V$]{}; at (0,0) [$V^*$]{};

&

(0,0) to 