Symmetric#
- class discopy.para.Symmetric(dom, cod, inside, param=None, copar=None)[source]#
Bases:
discopy.abc.SymmetricCategory,discopy.abc.ResultA 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.thenin 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 asinterchange.recopar(other)Post-compose the coparameter space with other : copar -> q, covariantly where
reparam()is contravariant.- 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:
- 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:
- 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.thenin general.
- 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.
- 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:
- 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 asinterchange.- Parameters:
other (category) – The reparametrisation, a morphism into
param.- Return type:
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")