Skip to content

Commit e383a01

Browse files
committed
add (currently failing) sanity check for functorial composition
1 parent 34bb6ea commit e383a01

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/sage/rings/lazy_series.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4656,7 +4656,7 @@ def derivative_with_respect_to_p1(self, n=1):
46564656
return P.element_class(P, coeff_stream)
46574657

46584658
def functorial_composition(self, *args):
4659-
r"""Returns the functorial composition of ``self`` and ``g``.
4659+
r"""Return the functorial composition of ``self`` and ``g``.
46604660
46614661
If `F` and `G` are species, their functorial composition is the species
46624662
`F \Box G` obtained by setting `(F \Box G) [A] = F[ G[A] ]`.
@@ -4704,6 +4704,32 @@ def functorial_composition(self, *args):
47044704
8
47054705
47064706
labellings of their vertices with two 1's and two 2's.
4707+
4708+
4709+
The derivative of the symmetric function `\sum_n h_n`, times
4710+
`p_1` is the neutral element with respect to functorial
4711+
composition::
4712+
4713+
sage: p = SymmetricFunctions(QQ).p()
4714+
sage: h = SymmetricFunctions(QQ).h()
4715+
sage: L = LazySymmetricFunctions(h)
4716+
sage: E = L(lambda n: h[n])
4717+
sage: Ep = p[1]*E.derivative_with_respect_to_p1(); Ep
4718+
h[1] + (h[1,1]) + (h[2,1]) + (h[3,1]) + (h[4,1]) + (h[5,1]) + O^7
4719+
sage: f = L(lambda n: randint(3, 6)*h[n])
4720+
sage: f - Ep.functorial_composition(f)
4721+
O^7
4722+
4723+
TESTS:
4724+
4725+
Check a corner case::
4726+
4727+
sage: L = LazySymmetricFunctions(h)
4728+
sage: Ep = L(lambda n: h[n-1]*h[1], valuation=1); Ep
4729+
h[1] + (h[1,1]) + (h[2,1]) + (h[3,1]) + (h[4,1]) + (h[5,1]) + (h[6,1]) + O^8
4730+
sage: Ep.functorial_composition(L([3*h[0]]))
4731+
3*h[]
4732+
47074733
"""
47084734
if len(args) != self.parent()._arity:
47094735
raise ValueError("arity must be equal to the number of arguments provided")

0 commit comments

Comments
 (0)