@@ -3127,9 +3127,19 @@ def plethysm(self, x, include=None, exclude=None):
3127
3127
sage: p[2,2,1](2)
3128
3128
8*p[]
3129
3129
3130
+ sage: p[2,2,1](int(2))
3131
+ 8*p[]
3132
+
3130
3133
sage: p[2,2,1](a1)
3131
3134
a1^5*p[]
3132
3135
3136
+ sage: X = algebras.Shuffle(QQ, 'ab')
3137
+ sage: Y = algebras.Shuffle(QQ, 'bc')
3138
+ sage: T = tensor([X,Y])
3139
+ sage: s = SymmetricFunctions(T).s()
3140
+ sage: s(2*T.one())
3141
+ (2*B[word:]#B[word:])*s[]
3142
+
3133
3143
.. TODO::
3134
3144
3135
3145
The implementation of plethysm in
@@ -3145,8 +3155,11 @@ def plethysm(self, x, include=None, exclude=None):
3145
3155
from sage .structure .element import parent as get_parent
3146
3156
Px = get_parent (x )
3147
3157
tensorflag = Px in tHA
3148
- if not tensorflag and Px is not R :
3149
- if not is_SymmetricFunction (x ):
3158
+ if not is_SymmetricFunction (x ):
3159
+ if Px is R : # Handle stuff that is directly in the base ring
3160
+ x = parent (x )
3161
+ elif (not tensorflag or any (not isinstance (factor , SymmetricFunctionAlgebra_generic )
3162
+ for factor in Px ._sets )):
3150
3163
from sage .rings .lazy_series import LazySymmetricFunction
3151
3164
if isinstance (x , LazySymmetricFunction ):
3152
3165
from sage .rings .lazy_series_ring import LazySymmetricFunctions
@@ -3155,11 +3168,12 @@ def plethysm(self, x, include=None, exclude=None):
3155
3168
3156
3169
# Try to coerce into a symmetric function
3157
3170
phi = parent .coerce_map_from (Px )
3158
- if phi is None :
3171
+ if phi is not None :
3172
+ x = phi (x )
3173
+ elif not tensorflag :
3159
3174
raise TypeError ("only know how to compute plethysms "
3160
3175
"between symmetric functions or tensors "
3161
3176
"of symmetric functions" )
3162
- x = phi (x )
3163
3177
3164
3178
p = parent .realization_of ().power ()
3165
3179
0 commit comments