diff --git a/pyproject.toml b/pyproject.toml index dc778cd..d8d42e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "yarrow-diagrams" -version = "0.0.2.1" +version = "0.0.2.2" authors = [ { name="Paul Wilson", email="paul@statusfailed.com" } ] diff --git a/yarrow/bipartite_multigraph.py b/yarrow/bipartite_multigraph.py index 48deb31..072b3ea 100644 --- a/yarrow/bipartite_multigraph.py +++ b/yarrow/bipartite_multigraph.py @@ -178,10 +178,11 @@ def __matmul__(f, g): return f.coproduct(g) @classmethod - def coproduct_list(cls, Gs: 'List[BipartiteMultigraph]', wn=None, xn=None): - """ Compute the coproduct of a list of bipartite multigraphs. - Note that while this is O(n) in the sequential case, it does not enjoy - parallel speedups. + def coproduct_list(cls, Gs: 'List[AbstractBipartiteMultigraph]', wn=None, xn=None): + """ Compute the coproduct of a list of bipartite multigraphs. O(n) in the size of the result. + + .. warning:: + Does not speed up to O(log n) in the parallel case. """ if len(Gs) == 0: assert wn is not None diff --git a/yarrow/diagram.py b/yarrow/diagram.py index 4a8006b..7f7334d 100644 --- a/yarrow/diagram.py +++ b/yarrow/diagram.py @@ -310,7 +310,12 @@ def __rshift__(f, g): # TODO: IMPROVE THIS @classmethod - def tensor_list(cls, ds: 'List[Diagram]', wn=None, xn=None): + def tensor_list(cls, ds: 'List[AbstractDiagram]', wn=None, xn=None): + """ Compute the tensor product of a list of diagrams. O(n) time in the size of the result. + + .. warning:: + Does not speed up to O(log n) in the parallel case + """ if len(ds) == 0: assert wn is not None assert xn is not None @@ -328,14 +333,18 @@ def tensor_operations(cls, ops: Operations): pass # hide the docstring for now """ Compute the X-fold tensoring of operations + .. code-block:: text + xn : X → Σ₁ whose typings are given by the segmented finite functions + .. code-block:: text + s_type : sum_{i ∈ X} arity(xn(i)) → Σ₀ t_type : sum_{i ∈ X} coarity(xn(i)) → Σ₀ - (This is Proposition 4.13 in the paper) + See Proposition 4.13 in :cite:t:`dpafsd`. """ Fun = cls._Fun Array = Fun._Array diff --git a/yarrow/finite_function.py b/yarrow/finite_function.py index cf457d0..f8642d9 100644 --- a/yarrow/finite_function.py +++ b/yarrow/finite_function.py @@ -276,7 +276,11 @@ def argsort(f: 'AbstractFiniteFunction'): @classmethod def coproduct_list(cls, fs: List['AbstractFiniteFunction'], target=None): - """ Compute the coproduct of a list of finite functions with a common target """ + """ Compute the coproduct of a list of finite functions. O(n) in size of the result. + + .. warning:: + Does not speed up to O(log n) in the parallel case. + """ # NOTE: this function is not parallelized! if len(fs) == 0: return cls.initial(0 if target is None else target) @@ -287,6 +291,11 @@ def coproduct_list(cls, fs: List['AbstractFiniteFunction'], target=None): @classmethod def tensor_list(cls, fs: List['AbstractFiniteFunction']): + """ Compute the tensor product of a list of finite functions. O(n) in size of the result. + + .. warning:: + Does not speed up to O(log n) in the parallel case. + """ if len(fs) == 0: return cls.initial(0)