Diagram#

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

Bases: discopy.monoidal.Diagram

A braided diagram is a monoidal diagram with Braid 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 braid(left, right)[source]#

The diagram braiding left over right.

Parameters
  • left (Ty) – The type on the top left and bottom right.

  • right (Ty) – The type on the top right and bottom left.

Return type

Diagram

Note

This calls hexagon() and braid_factory.

simplify()[source]#

Remove braids followed by their dagger.

Return type

Diagram

braid_factory#

alias of Braid

factory#

alias of Diagram