symmetric#

The free symmetric category, i.e. diagrams with swaps.

Summary#

Permutation

A permutation box, i.e. a Box that reorders its input wires.

Layer

A tensor product of generators and non-empty plumbing, where plumbing is a type when it is the identity and a Permutation otherwise.

Diagram

A symmetric diagram is a balanced diagram with Swap boxes.

Box

A symmetric box is a balanced box in a symmetric diagram.

Swap

The permutation [1, 0] of two atomic types.

Sum

A symmetric sum is a balanced sum and a symmetric box.

Functor

A symmetric functor is a monoidal functor that preserves swaps.

Axioms#

>>> x, y, z, w = map(Ty, "xyzw")
>>> f, g = Box("f", x, y), Box("g", z, w)

Triangle#

>>> assert Diagram.swap(Ty(), x) == Id(x) == Diagram.swap(x, Ty())

Hexagon#

>>> assert Diagram.swap(x, y @ z) == Swap(x, y) @ z >> y @ Swap(x, z)
>>> assert Diagram.swap(x @ y, z) == x @ Swap(y, z) >> Swap(x, z) @ y
>>> Equation(Diagram.swap(x, y @ z), Diagram.swap(x @ y, z), symbol='').draw(
...     space=2, doctest='docs/_static/symmetric/hexagons.svg', figsize=(5, 2))
../_images/hexagons1.svg

Involution#

a.k.a. Reidemeister move 2

>>> assert Swap(x, y)[::-1] == Swap(y, x)
>>> assert Equation(Swap(x, y) >> Swap(y, x), Id(x @ y))
>>> Equation(Swap(x, y) >> Swap(y, x), Id(x @ y)).draw(
...     doctest='docs/_static/symmetric/inverse.svg', figsize=(3, 2))
../_images/inverse1.svg

Naturality#

>>> naturality = Equation(
...     f @ g >> Swap(f.cod, g.cod), Swap(f.dom, g.dom) >> g @ f)
>>> assert naturality
>>> naturality.draw(
...     doctest='docs/_static/symmetric/naturality.svg', figsize=(3, 2))
../_images/naturality.svg

Yang-Baxter#

a.k.a. Reidemeister move 3

This is a special case of naturality.

>>> yang_baxter_left = Swap(x, y) @ z >> y @ Swap(x, z) >> Swap(y, z) @ x
>>> yang_baxter_right = x @ Swap(y, z) >> Swap(x, z) @ y >> z @ Swap(x, y)
>>> assert Equation(yang_baxter_left, yang_baxter_right)

Both sides foliate to the same single permutation.

>>> yang_baxter_middle = yang_baxter_left.foliation()
>>> assert yang_baxter_middle == yang_baxter_right.foliation()
>>> assert yang_baxter_middle == Permutation(x @ y @ z, [2, 1, 0])
>>> Equation(yang_baxter_left, yang_baxter_middle, yang_baxter_right).draw(
...     doctest='docs/_static/symmetric/yang-baxter.svg', figsize=(5, 2))
../_images/yang-baxter.svg