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

Commit

Permalink
Making the test for coercion of plethysms wrt tesnor products more ro…
Browse files Browse the repository at this point in the history
…bust.
  • Loading branch information
tscrim committed Aug 30, 2022
1 parent 5f21f3d commit a2e9ed7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/sage/combinat/sf/sfa.py
Expand Up @@ -3127,9 +3127,19 @@ def plethysm(self, x, include=None, exclude=None):
sage: p[2,2,1](2)
8*p[]
sage: p[2,2,1](int(2))
8*p[]
sage: p[2,2,1](a1)
a1^5*p[]
sage: X = algebras.Shuffle(QQ, 'ab')
sage: Y = algebras.Shuffle(QQ, 'bc')
sage: T = tensor([X,Y])
sage: s = SymmetricFunctions(T).s()
sage: s(2*T.one())
(2*B[word:]#B[word:])*s[]
.. TODO::
The implementation of plethysm in
Expand All @@ -3145,8 +3155,11 @@ def plethysm(self, x, include=None, exclude=None):
from sage.structure.element import parent as get_parent
Px = get_parent(x)
tensorflag = Px in tHA
if not tensorflag and Px is not R:
if not is_SymmetricFunction(x):
if not is_SymmetricFunction(x):
if Px is R: # Handle stuff that is directly in the base ring
x = parent(x)
elif (not tensorflag or any(not isinstance(factor, SymmetricFunctionAlgebra_generic)
for factor in Px._sets)):
from sage.rings.lazy_series import LazySymmetricFunction
if isinstance(x, LazySymmetricFunction):
from sage.rings.lazy_series_ring import LazySymmetricFunctions
Expand All @@ -3155,11 +3168,12 @@ def plethysm(self, x, include=None, exclude=None):

# Try to coerce into a symmetric function
phi = parent.coerce_map_from(Px)
if phi is None:
if phi is not None:
x = phi(x)
elif not tensorflag:
raise TypeError("only know how to compute plethysms "
"between symmetric functions or tensors "
"of symmetric functions")
x = phi(x)

p = parent.realization_of().power()

Expand Down

0 comments on commit a2e9ed7

Please sign in to comment.