Diagram
Diagram#
- class discopy.balanced.Diagram(inside, dom, cod, _scan=True)[source]#
Bases:
discopy.braided.Diagram
A balanced diagram is a braided diagram with
Twist
.- 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 twist(dom)[source]#
The twist on an object.
Note
This calls
twist_factory
.
- to_braided()[source]#
Doubles evry object and sends the twist to the braid.
Example
>>> x = Ty('x') >>> braided_twist = Diagram.twist(x).to_braided()
>>> from discopy.drawing import Equation >>> Equation(Twist(x), braided_twist, symbol='$\\mapsto$').draw( ... draw_type_labels=False, ... path="docs/_static/balanced/twist_dual_rail.png")