From c4d48fbac60ac05db426a307d90c33d20886a13a Mon Sep 17 00:00:00 2001 From: zabrocki Date: Wed, 3 Dec 2025 13:15:14 -0500 Subject: [PATCH 1/4] fix corner case of plethysm with tensors --- src/sage/combinat/sf/sfa.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 9cb5b4fae0e..e43cbfaa652 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -3601,6 +3601,8 @@ def plethysm(self, x, include=None, exclude=None): sage: s = SymmetricFunctions(T).s() sage: s[2](5) 15*B[] # B[] + sage: s[[]](tensor([p[1], s[1]])) + p[] # s[] .. TODO:: @@ -3646,11 +3648,11 @@ def plethysm(self, x, include=None, exclude=None): if tensorflag: tparents = Px._sets lincomb = Px.linear_combination - elt = lincomb((prod(lincomb((tensor([p[r].plethysm(base(la)) + elt = lincomb((prod((lincomb((tensor([p[r].plethysm(base(la)) for base, la in zip(tparents, trm)]), _raise_variables(c, r, degree_one)) for trm, c in x) - for r in mu), + for r in mu),tensor([base.one() for base in tparents])), d) for mu, d in p(self)) return Px(elt) From 3e35b76912ecf46f5e4fd9a53cb5b68339cfa20b Mon Sep 17 00:00:00 2001 From: zabrocki Date: Wed, 3 Dec 2025 13:28:49 -0500 Subject: [PATCH 2/4] point to issue in doc test Co-authored-by: Anne Schilling --- src/sage/combinat/sf/sfa.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index e43cbfaa652..02578ef7108 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -3601,6 +3601,9 @@ def plethysm(self, x, include=None, exclude=None): sage: s = SymmetricFunctions(T).s() sage: s[2](5) 15*B[] # B[] + + Fixed :issue:`41257`:: + sage: s[[]](tensor([p[1], s[1]])) p[] # s[] From 23e32693f7f17d6d7186cd1271bbae716254ad2e Mon Sep 17 00:00:00 2001 From: zabrocki Date: Wed, 3 Dec 2025 15:14:20 -0500 Subject: [PATCH 3/4] move doc test so that p and s are properly defined --- src/sage/combinat/sf/sfa.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 02578ef7108..ac54fff8d3e 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -3569,6 +3569,11 @@ def plethysm(self, x, include=None, exclude=None): sage: (1+p[2]).plethysm(p[2]) p[] + p[4] + Fixed :issue:`41257`:: + + sage: s[[]](tensor([p[1], s[1]])) + p[] # s[] + Check that degree one elements are treated in the correct way:: sage: R. = QQ[] @@ -3602,11 +3607,6 @@ def plethysm(self, x, include=None, exclude=None): sage: s[2](5) 15*B[] # B[] - Fixed :issue:`41257`:: - - sage: s[[]](tensor([p[1], s[1]])) - p[] # s[] - .. TODO:: The implementation of plethysm in From cdd57314688d1ba5afd17b76c570d250fafe6070 Mon Sep 17 00:00:00 2001 From: zabrocki Date: Wed, 3 Dec 2025 17:18:49 -0500 Subject: [PATCH 4/4] accept formatting change Co-authored-by: Martin Rubey --- src/sage/combinat/sf/sfa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index ac54fff8d3e..1668c67d0d5 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -3655,7 +3655,7 @@ def plethysm(self, x, include=None, exclude=None): for base, la in zip(tparents, trm)]), _raise_variables(c, r, degree_one)) for trm, c in x) - for r in mu),tensor([base.one() for base in tparents])), + for r in mu), tensor([base.one() for base in tparents])), d) for mu, d in p(self)) return Px(elt)