Diagram#
- class discopy.pivotal.Diagram(inside, dom, cod, _scan=True)[source]#
Bases:
discopy.rigid.Diagram
,discopy.traced.Diagram
A pivotal diagram is a rigid diagram and a traced diagram with pivotal types as domain and codomain.
- Parameters:
- dagger()[source]#
The dagger of a pivotal diagram is its vertical reflection.
Example
>>> x, y, z = map(Ty, "xyz") >>> f = Box('f', x @ y, z).curry()
>>> from discopy.drawing import Equation >>> Equation(f, f.dagger(), symbol="$\\mapsto$").draw( ... asymmetry=.1, ... path="docs/_static/pivotal/dagger.png")
- conjugate()[source]#
The horizontal reflection of a diagram, defined as the dagger of the rotation.
Equivalently, it is the rotation of the dagger.
Example
>>> x, y, z = map(Ty, "xyz") >>> x, y, z = map(Ty, "xyz") >>> f = Box('f', x @ y, z).curry() >>> assert f.conjugate() == f[::-1].rotate() == f.rotate()[::-1]
>>> from discopy.drawing import Equation >>> Equation(f, f.conjugate(), symbol="$\\mapsto$").draw( ... path="docs/_static/pivotal/conjugate.png")