Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
return correct partition in g_cycle_type, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Aug 30, 2022
1 parent e383a01 commit 29c6545
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/sage/rings/lazy_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4656,12 +4656,14 @@ def derivative_with_respect_to_p1(self, n=1):
return P.element_class(P, coeff_stream)

def functorial_composition(self, *args):
r"""Return the functorial composition of ``self`` and ``g``.
r"""
Return the functorial composition of ``self`` and ``g``.
If `F` and `G` are species, their functorial composition is the species
`F \Box G` obtained by setting `(F \Box G) [A] = F[ G[A] ]`.
In other words, an `(F \Box G)`-structure on a set `A` of labels is an
`F`-structure whose labels are the set of all `G`-structures on `A`.
If `F` and `G` are species, their functorial composition is
the species `F \Box G` obtained by setting `(F \Box G) [A] =
F[ G[A] ]`. In other words, an `(F \Box G)`-structure on a
set `A` of labels is an `F`-structure whose labels are the
set of all `G`-structures on `A`.
It can be shown (as in section 2.2 of [BLL]_) that there is a
corresponding operation on cycle indices:
Expand All @@ -4675,6 +4677,12 @@ def functorial_composition(self, *args):
This method implements that operation on cycle index series.
.. WARNING::
The operation `f \Box g` only makes sense when `g`
corresponds to a permutation representation, i.e., a
group action.
EXAMPLES:
The species `G` of simple graphs can be expressed in terms of a functorial
Expand Down Expand Up @@ -4724,11 +4732,10 @@ def functorial_composition(self, *args):
Check a corner case::
sage: h = SymmetricFunctions(QQ).h()
sage: L = LazySymmetricFunctions(h)
sage: Ep = L(lambda n: h[n-1]*h[1], valuation=1); Ep
h[1] + (h[1,1]) + (h[2,1]) + (h[3,1]) + (h[4,1]) + (h[5,1]) + (h[6,1]) + O^8
sage: Ep.functorial_composition(L([3*h[0]]))
3*h[]
sage: L(h[2,1]).functorial_composition(L([3*h[0]]))
3*h[] + O^7
"""
if len(args) != self.parent()._arity:
Expand All @@ -4749,9 +4756,11 @@ def functorial_composition(self, *args):
f = Stream_map_coefficients(self._coeff_stream, lambda x: x, p)

def g_cycle_type(s):
# the cycle type of G[sigma] of any permutation sigma
# with cycle type s
if not s:
if g[0]:
return Partition([ZZ(g[0].coefficient([]))])
return Partition([1]*ZZ(g[0].coefficient([])))
return Partition([])
res = []
# in the species case, k is at most
Expand All @@ -4774,8 +4783,10 @@ def coefficient(n):
res = p(0)
for s in Partitions(n):
t = g_cycle_type(s)
q = t.aut() * f[t.size()].coefficient(t) / s.aut()
res += q * p(s)
f_t = f[t.size()]
if f_t:
q = t.aut() * f_t.coefficient(t) / s.aut()
res += q * p(s)
return res

coeff_stream = Stream_function(coefficient, R, P._sparse, 0)
Expand Down

0 comments on commit 29c6545

Please sign in to comment.