Skip to content

Commit b2ef1e4

Browse files
committed
allow SymmetricFunctions as arguments of functorial composition
1 parent 8ca3624 commit b2ef1e4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/sage/rings/lazy_series.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,7 +4767,7 @@ def functorial_composition(self, *args):
47674767
47684768
sage: h = SymmetricFunctions(QQ).h()
47694769
sage: L = LazySymmetricFunctions(h)
4770-
sage: L(h[2,1]).functorial_composition(L([3*h[0]]))
4770+
sage: L(h[2,1]).functorial_composition(3*h[0])
47714771
3*h[] + O^7
47724772
47734773
Check an instance of a non-group action::
@@ -4776,7 +4776,7 @@ def functorial_composition(self, *args):
47764776
sage: p = SymmetricFunctions(QQ).p()
47774777
sage: L = LazySymmetricFunctions(p)
47784778
sage: f = L(lambda n: s[n])
4779-
sage: g = L(2*s[2, 1, 1] + s[2, 2] + 3*s[4])
4779+
sage: g = 2*s[2, 1, 1] + s[2, 2] + 3*s[4]
47804780
sage: r = f.functorial_composition(g); r[4]
47814781
Traceback (most recent call last):
47824782
...
@@ -4793,7 +4793,14 @@ def functorial_composition(self, *args):
47934793
if len(args) == 1:
47944794
g = args[0]
47954795
P = g.parent()
4796-
R = P._laurent_poly_ring
4796+
if isinstance(g, LazySymmetricFunction):
4797+
R = P._laurent_poly_ring
4798+
else:
4799+
from sage.rings.lazy_series_ring import LazySymmetricFunctions
4800+
R = g.parent()
4801+
P = LazySymmetricFunctions(R)
4802+
g = P(g)
4803+
47974804
p = R.realization_of().p()
47984805
# TODO: does the following introduce a memory leak?
47994806
g = Stream_map_coefficients(g._coeff_stream, p)

0 commit comments

Comments
 (0)