PRO#
- class discopy.monoidal.PRO(n=0)[source]#
Bases:
TyA PRO is a natural number
nseen as a type with addition as tensor.- Parameters:
n (int) – The length of the PRO type.
Example
>>> assert PRO(1) @ PRO(2) == PRO(3)
Note
If
obisPROthenDiagramwill automatically turn anyn: intintoPRO(n). ThusPROnever needs to be called.>>> @ar_factory ... class Circuit(Diagram): ... ob = PRO >>> class Gate(Box, Circuit): ... >>> CX = Gate('CX', 2, 2)
>>> assert CX @ 2 >> 2 @ CX == CX @ CX