Diagram#
- class discopy.balanced.Diagram(inside, dom, cod, _scan=True)[source]#
Bases:
discopy.braided.Diagram
,discopy.traced.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.
Note
By default, our balanced diagrams are traced. Although not every balanced category embeds faithfully into a traced one (see the nLab), the free balanced category does have the desired cancellation property and it does in fact embed faithfully into the free balanced traced category.
- 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( ... wire_labels=False, ... path="docs/_static/balanced/twist_dual_rail.png")
- trace_factory#
alias of
Trace