abc

Contents

abc#

The abstract base classes for categories.

These mirror the concrete hierarchy of discopy modules: each class adds the characteristic generator of its categorical structure as an abc.abstractmethod(), e.g. BraidedCategory is a MonoidalCategory with an abstract BraidedCategory.braid().

Software dependencies between modules go top-to-bottom, left-to-right and forgetful functors between categories go the other way.

Each class also declares its discopy.testable.axiom() equations, which every free category inherits along with the structure they axiomatise: Category states the unitality and associativity of composition, the typing of its identities and composites, and the involution and contravariance of its dagger; a ColouredMonoid inherits them as the unitality and associativity of its product, its composition.

Summary#

Category

A category is a class with two class variables ob, ar, two attributes dom, cod and two methods id, then.

ColouredMonoid

A coloured monoid is a category whose sequential composition then is given by a monoidal tensor, with the objects C0 (its colours) as the boundaries of its morphisms.

Monoid

A monoid is a coloured monoid with a single, trivial colour.

Nat

Nat is the free monoid on one generator, i.e. the natural numbers with addition as tensor.

MonoidalCategory

A monoidal category is a Category with a method tensor for both its objects and its morphisms.

PRO

A PRO is a MonoidalCategory whose objects are the natural numbers Nat, i.e. the free monoidal category on one generator.

TracedCategory

A traced category is a MonoidalCategory with a method trace for the partial trace of a morphism over some objects.

ResiduatedMonoid

A monoid is residuated when it comes with methods over and under with syntactic sugar << and >>.

BiclosedCategory

A biclosed category is a MonoidalCategory with methods ev and curry for the evaluation and currying of morphisms.

Pregroup

A pregroup is a residuated monoid where the left and right exponentials are given by tensoring with the chosen left and right duals for each object.

RigidCategory

A rigid category is a BiclosedCategory with a Pregroup as object type and methods for cups and caps.

PivotalCategory

A pivotal category is a RigidCategory where the left and right adjoints coincide, hence it is also a TracedCategory.

BraidedCategory

A braided category is a MonoidalCategory with a method braid for the natural isomorphism x @ y -> y @ x.

PROB

A PROB is a BraidedCategory whose objects are the natural numbers Nat, i.e. the free braided category on one generator.

SymmetricCategory

A symmetric category is a BraidedCategory where the braid is its own inverse called swap for the symmetry x @ y -> y @ x.

PROP

A PROP is a SymmetricCategory whose objects are the natural numbers Nat, i.e. the free symmetric category on one generator.

MarkovCategory

A Markov category is a SymmetricCategory with methods copy and merge for the supply of commutative comonoids.

ClosedCategory

A closed category is a symmetric BiclosedCategory.

FeedbackCategory

A feedback category is a MarkovCategory with a delay endofunctor and a feedback operator.

BalancedCategory

A balanced category is a BraidedCategory and a TracedCategory with a method twist for the natural automorphism x -> x.

RibbonCategory

A ribbon category is a PivotalCategory which is also a BalancedCategory, i.e. where diagrams can draw knots and links.

CompactCategory

A compact category is a RibbonCategory which is also a SymmetricCategory, i.e. with cups, caps and swaps and where the twist is the identity.

HypergraphCategory

A hypergraph category is a symmetric category with a supply of spiders, i.e. special commutative Frobenius algebras on each objects.

NamedGeneric

A NamedGeneric is a Generic where the type parameter has a name.