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

Commit c47b060

Browse files
committed
Doing some changes to normal symmetric functions plethysm to support coefficients and lazy symmetric functions.
1 parent 1d559cc commit c47b060

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

src/sage/combinat/sf/sfa.py

+55-12
Original file line numberDiff line numberDiff line change
@@ -3073,6 +3073,31 @@ def plethysm(self, x, include=None, exclude=None):
30733073
sage: sum(s[mu](X)*s[mu.conjugate()](Y) for mu in P5) == sum(m[mu](X)*e[mu](Y) for mu in P5)
30743074
True
30753075
3076+
Sage can also do the plethysm with an element in the completion::
3077+
3078+
sage: L = LazySymmetricFunctions(s)
3079+
sage: f = s[2,1]
3080+
sage: g = L(s[1]) / (1 - L(s[1])); g
3081+
s[1] + (s[1,1]+s[2]) + (s[1,1,1]+2*s[2,1]+s[3])
3082+
+ (s[1,1,1,1]+3*s[2,1,1]+2*s[2,2]+3*s[3,1]+s[4])
3083+
+ (s[1,1,1,1,1]+4*s[2,1,1,1]+5*s[2,2,1]+6*s[3,1,1]+5*s[3,2]+4*s[4,1]+s[5])
3084+
+ ... + O^8
3085+
sage: fog = f(g)
3086+
sage: fog[:8]
3087+
[s[2, 1],
3088+
s[1, 1, 1, 1] + 3*s[2, 1, 1] + 2*s[2, 2] + 3*s[3, 1] + s[4],
3089+
2*s[1, 1, 1, 1, 1] + 8*s[2, 1, 1, 1] + 10*s[2, 2, 1]
3090+
+ 12*s[3, 1, 1] + 10*s[3, 2] + 8*s[4, 1] + 2*s[5],
3091+
3*s[1, 1, 1, 1, 1, 1] + 17*s[2, 1, 1, 1, 1] + 30*s[2, 2, 1, 1]
3092+
+ 16*s[2, 2, 2] + 33*s[3, 1, 1, 1] + 54*s[3, 2, 1] + 16*s[3, 3]
3093+
+ 33*s[4, 1, 1] + 30*s[4, 2] + 17*s[5, 1] + 3*s[6],
3094+
5*s[1, 1, 1, 1, 1, 1, 1] + 30*s[2, 1, 1, 1, 1, 1] + 70*s[2, 2, 1, 1, 1]
3095+
+ 70*s[2, 2, 2, 1] + 75*s[3, 1, 1, 1, 1] + 175*s[3, 2, 1, 1]
3096+
+ 105*s[3, 2, 2] + 105*s[3, 3, 1] + 100*s[4, 1, 1, 1] + 175*s[4, 2, 1]
3097+
+ 70*s[4, 3] + 75*s[5, 1, 1] + 70*s[5, 2] + 30*s[6, 1] + 5*s[7]]
3098+
sage: parent(fog)
3099+
Lazy completion of Symmetric Functions over Rational Field in the Schur basis
3100+
30763101
.. SEEALSO::
30773102
30783103
:meth:`frobenius`
@@ -3089,41 +3114,59 @@ def plethysm(self, x, include=None, exclude=None):
30893114
sage: f = a1*p[1] + a2*p[2] + a11*p[1,1]
30903115
sage: g = b1*p[1] + b21*p[2,1] + b111*p[1,1,1]
30913116
sage: r = f(g); r
3092-
a1*b1*p[1] + a11*b1^2*p[1, 1] + a1*b111*p[1, 1, 1] + 2*a11*b1*b111*p[1, 1, 1, 1] + a11*b111^2*p[1, 1, 1, 1, 1, 1] + a2*b1^2*p[2] + a1*b21*p[2, 1] + 2*a11*b1*b21*p[2, 1, 1] + 2*a11*b21*b111*p[2, 1, 1, 1, 1] + a11*b21^2*p[2, 2, 1, 1] + a2*b111^2*p[2, 2, 2] + a2*b21^2*p[4, 2]
3117+
a1*b1*p[1] + a11*b1^2*p[1, 1] + a1*b111*p[1, 1, 1]
3118+
+ 2*a11*b1*b111*p[1, 1, 1, 1] + a11*b111^2*p[1, 1, 1, 1, 1, 1]
3119+
+ a2*b1^2*p[2] + a1*b21*p[2, 1] + 2*a11*b1*b21*p[2, 1, 1]
3120+
+ 2*a11*b21*b111*p[2, 1, 1, 1, 1] + a11*b21^2*p[2, 2, 1, 1]
3121+
+ a2*b111^2*p[2, 2, 2] + a2*b21^2*p[4, 2]
30933122
sage: r - f(g, include=[])
30943123
(a2*b1^2-a2*b1)*p[2] + (a2*b111^2-a2*b111)*p[2, 2, 2] + (a2*b21^2-a2*b21)*p[4, 2]
30953124
30963125
Check that we can compute the plethysm with a constant::
30973126
30983127
sage: p[2,2,1](2)
3099-
8
3128+
8*p[]
31003129
31013130
sage: p[2,2,1](a1)
3102-
a1^5
3131+
a1^5*p[]
31033132
31043133
.. TODO::
31053134
31063135
The implementation of plethysm in
31073136
:class:`sage.data_structures.stream.Stream_plethysm` seems
31083137
to be faster. This should be investigated.
3109-
31103138
"""
31113139
parent = self.parent()
3140+
if not self:
3141+
return self
3142+
31123143
R = parent.base_ring()
31133144
tHA = HopfAlgebrasWithBasis(R).TensorProducts()
3114-
tensorflag = tHA in x.parent().categories()
3115-
if not (is_SymmetricFunction(x) or tensorflag):
3116-
raise TypeError("only know how to compute plethysms "
3117-
"between symmetric functions or tensors "
3118-
"of symmetric functions")
3145+
from sage.structure.element import parent as get_parent
3146+
Px = get_parent(x)
3147+
tensorflag = Px in tHA
3148+
if not tensorflag and Px is not R:
3149+
if not is_SymmetricFunction(x):
3150+
from sage.rings.lazy_series import LazySymmetricFunction
3151+
if isinstance(x, LazySymmetricFunction):
3152+
from sage.rings.lazy_series_ring import LazySymmetricFunctions
3153+
L = LazySymmetricFunctions(parent)
3154+
return L(self)(x)
3155+
3156+
# Try to coerce into a symmetric function
3157+
phi = parent.coerce_map_from(Px)
3158+
if phi is None:
3159+
raise TypeError("only know how to compute plethysms "
3160+
"between symmetric functions or tensors "
3161+
"of symmetric functions")
3162+
x = phi(x)
3163+
31193164
p = parent.realization_of().power()
3120-
if self == parent.zero():
3121-
return self
31223165

31233166
degree_one = _variables_recursive(R, include=include, exclude=exclude)
31243167

31253168
if tensorflag:
3126-
tparents = x.parent()._sets
3169+
tparents = Px._sets
31273170
s = sum(d * prod(sum(_raise_variables(c, r, degree_one)
31283171
* tensor([p[r].plethysm(base(la))
31293172
for base, la in zip(tparents, trm)])

0 commit comments

Comments
 (0)