Symmetric#

class discopy.para.Symmetric(dom, cod, inside, param=None, copar=None)[source]#

Bases: discopy.abc.SymmetricCategory, discopy.abc.Result

A parametric map from dom to cod with parameter space param is a morphism inside : dom @ param -> cod in an underlying category, optionally with a coparameter space copar on the codomain, i.e. inside : dom @ param -> cod @ copar.

Parameters:
  • dom (category.ob) – The domain of the parametric map.

  • cod (category.ob) – The codomain of the parametric map.

  • inside (category) – The morphism dom @ param -> cod @ copar.

  • param (category.ob) – The parameter space, empty by default.

  • copar (category.ob) – The coparameter space, empty by default.

Summary

lift(inside)

A morphism of the underlying category as a parametric map with the empty parameter space, i.e. the injection functor from a category into its category of parametric maps.

id([dom])

The identity parametric map on dom, with empty parameter space.

then(other)

Sequential composition tensors the hidden spaces on both sides, i.e. (p, f) >> (q, g) == (p @ q, f @ q >> g) for empty coparameters and the routing of Stream.then in general.

tensor(other)

Parallel composition tensors the hidden spaces on both sides, with swaps routing the parameters to the right of the domains and the coparameters to the right of the codomains.

swap(left, right)

The swap of the underlying category, with empty parameter space.

reparam(other)

Precompose the parameter space with other : q -> param, i.e. the 2-cells of Symmetric, kept as a method of the 1-cells the same way as interchange.

recopar(other)

Post-compose the coparameter space with other : copar -> q, covariantly where reparam() is contravariant.

category#

alias of Diagram

ob#

alias of Ty

classmethod lift(inside)[source]#

A morphism of the underlying category as a parametric map with the empty parameter space, i.e. the injection functor from a category into its category of parametric maps.

Parameters:

inside (category) – The morphism to lift.

Return type:

Symmetric

classmethod id(dom=None)[source]#

The identity parametric map on dom, with empty parameter space.

Parameters:

dom (ob) – The domain of the identity, also its codomain.

Return type:

Symmetric

then(other)[source]#

Sequential composition tensors the hidden spaces on both sides, i.e. (p, f) >> (q, g) == (p @ q, f @ q >> g) for empty coparameters and the routing of Stream.then in general.

Parameters:

other (Symmetric) – The parametric map to compose with.

Return type:

Symmetric

tensor(other)[source]#

Parallel composition tensors the hidden spaces on both sides, with swaps routing the parameters to the right of the domains and the coparameters to the right of the codomains.

Parameters:

other (Symmetric) – The parametric map to tensor with.

Return type:

Symmetric

classmethod swap(left, right)[source]#

The swap of the underlying category, with empty parameter space.

Parameters:
  • left (ob) – The object on the left of the swap.

  • right (ob) – The object on the right of the swap.

Return type:

Symmetric

reparam(other)[source]#

Precompose the parameter space with other : q -> param, i.e. the 2-cells of Symmetric, kept as a method of the 1-cells the same way as interchange.

Parameters:

other (category) – The reparametrisation, a morphism into param.

Return type:

Symmetric

Example

>>> from discopy.symmetric import Ty, Box
>>> x, y, p, q = map(Ty, "xypq")
>>> f = Symmetric(x, y, Box('f', x @ p, y), p)
>>> r = Box('r', q, p)
>>> f.reparam(r).inside.draw(doctest="docs/_static/para/reparam.svg")
../_images/reparam.svg
recopar(other)[source]#

Post-compose the coparameter space with other : copar -> q, covariantly where reparam() is contravariant.

Parameters:

other (category) – The recoparametrisation, a morphism out of copar.

Return type:

Symmetric