PRO

Contents

PRO#

class discopy.monoidal.PRO(n=0)[source]#

Bases: Ty

A PRO is a natural number n seen 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 ob is PRO then Diagram will automatically turn any n: int into PRO(n). Thus PRO never 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
ob#

alias of PRO