From 65687a9c8904be7b01e483399f270599e0b47511 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Wed, 15 Nov 2023 09:54:16 +0900 Subject: [PATCH] Fixing doctests. --- src/sage/algebras/cellular_basis.py | 8 ++++---- .../finite_dimensional_algebras_with_basis.py | 10 +++++++++- src/sage/combinat/symmetric_group_algebra.py | 7 ++++--- src/sage/modules/with_basis/cell_module.py | 8 ++++---- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/sage/algebras/cellular_basis.py b/src/sage/algebras/cellular_basis.py index 873bd899b3e..8aad8efcd71 100644 --- a/src/sage/algebras/cellular_basis.py +++ b/src/sage/algebras/cellular_basis.py @@ -135,21 +135,21 @@ class CellularBasis(CombinatorialFreeModule): sage: len(S.basis()) 6 sage: a,b,c,d,e,f = C.basis() - sage: a + sage: f C([3], [[1, 2, 3]], [[1, 2, 3]]) sage: c C([2, 1], [[1, 3], [2]], [[1, 2], [3]]) sage: d C([2, 1], [[1, 2], [3]], [[1, 3], [2]]) - sage: a * a + sage: f * f C([3], [[1, 2, 3]], [[1, 2, 3]]) - sage: a * c + sage: f * c 0 sage: d * c C([2, 1], [[1, 2], [3]], [[1, 2], [3]]) sage: c * d C([2, 1], [[1, 3], [2]], [[1, 3], [2]]) - sage: S(a) + sage: S(f) 1/6*[1, 2, 3] + 1/6*[1, 3, 2] + 1/6*[2, 1, 3] + 1/6*[2, 3, 1] + 1/6*[3, 1, 2] + 1/6*[3, 2, 1] sage: S(d) diff --git a/src/sage/categories/finite_dimensional_algebras_with_basis.py b/src/sage/categories/finite_dimensional_algebras_with_basis.py index b8ed6332ead..2ba4069a8d5 100644 --- a/src/sage/categories/finite_dimensional_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_algebras_with_basis.py @@ -1437,7 +1437,15 @@ def simple_module_parameterization(self): sage: S = SymmetricGroupAlgebra(QQ, 4) # needs sage.groups sage.modules sage: S.simple_module_parameterization() # needs sage.groups sage.modules - ([4], [3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]) + ([1, 1, 1, 1], [2, 1, 1], [2, 2], [3, 1], [4]) + + sage: S = SymmetricGroupAlgebra(GF(3), 4) # needs sage.groups sage.modules + sage: S.simple_module_parameterization() # needs sage.groups sage.modules + ([2, 1, 1], [2, 2], [3, 1], [4]) + + sage: S = SymmetricGroupAlgebra(GF(4), 4) # needs sage.groups sage.modules + sage: S.simple_module_parameterization() # needs sage.groups sage.modules + ([3, 1], [4]) """ return tuple([mu for mu in self.cell_poset() if self.cell_module(mu).nonzero_bilinear_form()]) diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py index 70704a0e9f7..1d87c0bf31d 100644 --- a/src/sage/combinat/symmetric_group_algebra.py +++ b/src/sage/combinat/symmetric_group_algebra.py @@ -739,14 +739,15 @@ def _from_cellular_index(self, x): from sage.combinat.rsk import RSK_inverse from sage.sets.recursively_enumerated_set import RecursivelyEnumeratedSet G = self.basis().keys() - one = self.base_ring().one() + R = self.base_ring() + one = R.one() # check if the KL polynomials can be computed using ``coxeter3`` try: from sage.libs.coxeter3.coxeter_group import CoxeterGroup as Coxeter3Group except ImportError: # Falback to using the KL polynomial from sage.combinat.kazhdan_lusztig import KazhdanLusztigPolynomial - q = PolynomialRing(self.base_ring(), 'q').gen() + q = PolynomialRing(QQ, 'q').gen() KLG = SymmetricGroup(self.n) self._cellular_KL = KazhdanLusztigPolynomial(KLG, q) polyfunc = self._cellular_KL.P @@ -758,7 +759,7 @@ def _from_cellular_index(self, x): def func(S, T, mult=None): w = KLG.from_reduced_word(RSK_inverse(T, S, output="permutation").reduced_word()) bruhat = RecursivelyEnumeratedSet([w], lambda u: u.bruhat_lower_covers(), structure='graded') - return self.element_class(self, {G.from_reduced_word(v.reduced_word()): c(q=one) + return self.element_class(self, {G.from_reduced_word(v.reduced_word()): R(c(q=one)) for v in bruhat if (c := polyfunc(v, w))}) else: diff --git a/src/sage/modules/with_basis/cell_module.py b/src/sage/modules/with_basis/cell_module.py index 66d72f648f8..25e6509dde7 100644 --- a/src/sage/modules/with_basis/cell_module.py +++ b/src/sage/modules/with_basis/cell_module.py @@ -334,9 +334,9 @@ def _acted_upon_(self, scalar, self_on_left=False): sage: elt = W.an_element(); elt 2*W[[1, 2], [3]] + 2*W[[1, 3], [2]] sage: sc = C.an_element(); sc - 3*C([2, 1], [[1, 3], [2]], [[1, 2], [3]]) + 2*C([1, 1, 1], [[1], [2], [3]], [[1], [2], [3]]) + + 3*C([2, 1], [[1, 3], [2]], [[1, 2], [3]]) + 2*C([2, 1], [[1, 3], [2]], [[1, 3], [2]]) - + 2*C([3], [[1, 2, 3]], [[1, 2, 3]]) sage: sc * elt 10*W[[1, 3], [2]] @@ -448,9 +448,9 @@ def _acted_upon_(self, scalar, self_on_left=False): sage: elt = L.an_element(); elt 2*L[[1, 2], [3]] + 2*L[[1, 3], [2]] sage: sc = C.an_element(); sc - 3*C([2, 1], [[1, 3], [2]], [[1, 2], [3]]) + 2*C([1, 1, 1], [[1], [2], [3]], [[1], [2], [3]]) + + 3*C([2, 1], [[1, 3], [2]], [[1, 2], [3]]) + 2*C([2, 1], [[1, 3], [2]], [[1, 3], [2]]) - + 2*C([3], [[1, 2, 3]], [[1, 2, 3]]) sage: sc * elt 10*L[[1, 3], [2]]