ColouredMonoid#
- class discopy.abc.ColouredMonoid[source]#
Bases:
Category,GenericA coloured monoid is a category whose sequential composition
thenis given by a monoidaltensor, with the objectsC0(its colours) as the boundaries of its morphisms.An ordinary
Monoidis the special case with a single, trivial colour, i.e.type(None). We do not enforce this so that e.g.monoidal.Tycan take colours as objects.- classmethod id(dom=None)[source]#
The monoidal unit, i.e. the empty tensor
cls().- Parameters:
dom (C0)
- Return type:
C1
- classmethod unit(colour=None)[source]#
The unit at a colour, i.e. the identity on it.
It need not be an element of the monoid, which is why it may land in
C0: the layers ofmonoidal.Layerare closed undertensorbut the empty one is a type rather than a layer.- Parameters:
colour (C0)
- Return type:
C0 | C1
- abstract tensor(*objects)[source]#
The n-ary product of a monoid for
n > 0.- Parameters:
objects (C1)
- Return type:
C1
- then(*others)[source]#
Sequential composition, given by the monoid product.
- Parameters:
others (C1)
- Return type:
C1