PRO#
- class discopy.monoidal.PRO(inside=0, dom=None, cod=None, _scan=True)[source]#
Bases:
TyA PRO is a natural number
nseen as a type with addition as tensor.- Parameters:
inside (int | tuple) – The length of the PRO type, or a tuple of generators whose length is taken.
dom (C0) –
cod (C0) –
_scan (bool) –
Example
>>> assert PRO(1) @ PRO(2) == PRO(3)
Note
If
obisPROthenDiagramwill automatically turn anyn: intintoPRO(n). ThusPROnever needs to be called.>>> @factory ... class Circuit(Diagram): ... ob = PRO >>> class Gate(Box, Circuit): ... >>> CX = Gate('CX', 2, 2)
>>> assert CX @ 2 >> 2 @ CX == CX @ CX