Diagram#

class discopy.cartesian.Diagram(inside, dom, cod, _scan=True)[source]#

Bases: discopy.symmetric.Diagram

A cartesian diagram is a symmetric diagram with Copy boxes.

Parameters
  • inside (Layer) – The layers inside the diagram.

  • dom (monoidal.Ty) – The domain of the diagram, i.e. its input.

  • cod (monoidal.Ty) – The codomain of the diagram, i.e. its output.

classmethod copy(x, n=2)[source]#

Make n copies of a given type x.

Parameters
  • x (Ty) – The type to copy.

  • n – The number of copies.

Return type

Diagram

braid_factory#

alias of Swap

factory#

alias of Diagram