Layer#
- class discopy.monoidal.Layer(left, box, right)[source]#
Bases:
Box
Layer of a diagram, i.e. a box with wires to the left and right.
- Parameters:
left (monoidal.Ty) – Left wires.
box (monoidal.Box) – Middle box.
right (monoidal.Ty) – Right wires.
Examples
>>> x, y, z = Ty('x'), Ty('y'), Ty('z') >>> f, g = Box('f', y, z), Box('g', z, x) >>> Layer(x, f, z) Layer(Ty('x'), Box('f', Ty('y'), Ty('z')), Ty('z')) >>> first, then = Layer(x, f, z), Layer(x, g, z) >>> print(first >> then) Id(x) @ f @ Id(z) >> Id(x) @ g @ Id(z)