Diagram#

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

Bases: discopy.symmetric.Diagram, discopy.ribbon.Diagram

A compact diagram is a symmetric diagram and a ribbon diagram.

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

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

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

ty_factory#

alias of Ty

classmethod trace_factory(diagram, left=False)[source]#

The trace of a pivotal diagram is its pre- and post-composition with cups and caps to form a feedback loop.

Parameters:
  • diagram (Diagram) – The diagram to trace.

  • left – Whether to trace on the left or right.

braid_factory#

alias of Swap

cap_factory#

alias of Cap

cup_factory#

alias of Cup

factory#

alias of Diagram