Skip to content

Commit

Permalink
Fixing doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tscrim committed Nov 15, 2023
1 parent 7917119 commit 65687a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/sage/algebras/cellular_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion src/sage/categories/finite_dimensional_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()])
Expand Down
7 changes: 4 additions & 3 deletions src/sage/combinat/symmetric_group_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/sage/modules/with_basis/cell_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down

0 comments on commit 65687a9

Please sign in to comment.