Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo in ladder_idempotent #39638

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions src/sage/combinat/symmetric_group_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
from sage.misc.lazy_attribute import lazy_attribute
from sage.categories.algebras_with_basis import AlgebrasWithBasis
from sage.combinat.free_module import CombinatorialFreeModule
from sage.combinat.permutation import Permutation, Permutations, from_permutation_group_element
from sage.combinat.permutation_cython import (left_action_same_n, right_action_same_n)
from sage.combinat.permutation import (Permutation, Permutations,
from_permutation_group_element)
from sage.combinat.permutation_cython import (left_action_same_n,
right_action_same_n)
from sage.combinat.partition import _Partitions, Partitions, Partitions_n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be before permutation

from sage.combinat.tableau import Tableau, StandardTableaux_size, StandardTableaux_shape, StandardTableaux
from sage.combinat.tableau import (Tableau, StandardTableaux_size,
StandardTableaux_shape, StandardTableaux)
from sage.combinat.skew_tableau import SkewTableau
from sage.algebras.group_algebra import GroupAlgebra_class
from sage.algebras.cellular_basis import CellularBasis
Expand All @@ -30,7 +33,8 @@
from sage.misc.lazy_import import lazy_import
from sage.misc.persist import register_unpickle_override

lazy_import('sage.groups.perm_gps.permgroup_element', 'PermutationGroupElement')
lazy_import('sage.groups.perm_gps.permgroup_element',
'PermutationGroupElement')


# TODO: Remove this function and replace it with the class
Expand Down Expand Up @@ -74,7 +78,8 @@
sage: a = sum(basis); a
[1, 2, 3] + [1, 3, 2] + [2, 1, 3] + [2, 3, 1] + [3, 1, 2] + [3, 2, 1]
sage: a^2
6*[1, 2, 3] + 6*[1, 3, 2] + 6*[2, 1, 3] + 6*[2, 3, 1] + 6*[3, 1, 2] + 6*[3, 2, 1]
6*[1, 2, 3] + 6*[1, 3, 2] + 6*[2, 1, 3] + 6*[2, 3, 1]
+ 6*[3, 1, 2] + 6*[3, 2, 1]
sage: a^2 == 6*a
True
sage: b = QS3([3, 1, 2])
Expand Down Expand Up @@ -105,7 +110,8 @@
sage: SGA = SymmetricGroupAlgebra(QQ, WeylGroup(["A",3], prefix='s')); SGA
Symmetric group algebra of order 4 over Rational Field
sage: SGA.group()
Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
Weyl Group of type ['A', 3] (as a matrix group acting
on the ambient space)
sage: SGA.an_element()
s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1

Expand Down Expand Up @@ -184,7 +190,8 @@

sage: QS3 = SymmetricGroupAlgebra(QQ, 3, category=Monoids())
sage: QS3.category()
Category of finite dimensional cellular monoid algebras over Rational Field
Category of finite dimensional cellular monoid algebras
over Rational Field
sage: TestSuite(QS3).run(skip=['_test_construction'])


Expand Down Expand Up @@ -1247,17 +1254,17 @@
blocks[c] = [la]
return blocks

def ladder_idemponent(self, la):
def ladder_idempotent(self, la):
r"""
Return the ladder idempontent of ``self``.
Return the ladder idempotent of ``self``.

Let `F` be a field of characteristic `p`. The *ladder idempotent*
of shape `\lambda` is the idempotent of `F[S_n]` defined as follows.
Let `T` be the :meth:`ladder tableau
<sage.combinat.partition.Partition.ladder_tableau>` of shape `\lambda`.
Let `[T]` be the set of standard tableaux whose residue sequence
is the same as for `T`. Let `\alpha` be the sizes of the ladders
of `\lambda`. Then the ladder idempontent is constructed as
of `\lambda`. Then the ladder idempotent is constructed as

.. MATH::

Expand All @@ -1273,7 +1280,7 @@

sage: SGA = SymmetricGroupAlgebra(GF(3), 4)
sage: for la in Partitions(SGA.n):
....: idem = SGA.ladder_idemponent(la)
....: idem = SGA.ladder_idempotent(la)
....: print(la)
....: print(idem)
....: assert idem^2 == idem
Expand Down Expand Up @@ -1301,8 +1308,8 @@
and also projective modules)::

sage: SGA = SymmetricGroupAlgebra(QQ, 5)
sage: for la in Partitions(SGA.n):

Check warning on line 1311 in src/sage/combinat/symmetric_group_algebra.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.12)

Warning: slow doctest:

slow doctest:

Check warning on line 1311 in src/sage/combinat/symmetric_group_algebra.py

View workflow job for this annotation

GitHub Actions / Conda (ubuntu, Python 3.11)

Warning: slow doctest:

slow doctest:
....: idem = SGA.ladder_idemponent(la)
....: idem = SGA.ladder_idempotent(la)
....: assert idem^2 == idem
....: print(la, SGA.principal_ideal(idem).dimension())
[5] 1
Expand All @@ -1324,15 +1331,14 @@
n = self.n
if not p:
p = n + 1
la = _Partitions(la)
if sum(la) != n:
raise ValueError(f"{la} is not a partition of {n}")
la = Partitions_n(n)(la)
Tlad, alpha = la.ladder_tableau(p, ladder_lengths=True)
if not all(val < p for val in alpha):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a detail: if any(val >= p for val in alpha):

raise ValueError(f"{la} is not {p}-ladder restricted")
Tclass = Tlad.residue_sequence(p).standard_tableaux()
Elad = sum(epsilon_ik(T, T) for T in Tclass)
Elad = self.element_class(self, {sigma: R(c) for sigma, c in Elad._monomial_coefficients.items()})
Elad = self.element_class(self, {sigma: R(c)
for sigma, c in Elad._monomial_coefficients.items()})
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
YG = SymmetricGroup(n).young_subgroup(alpha)
coeff = ~R.prod(factorial(val) for val in alpha)
Expand Down Expand Up @@ -2066,7 +2072,7 @@
return self._dft_seminormal(mult=mult)
if form == "modular":
return self._dft_modular()
raise ValueError("invalid form (= %s)" % form)
raise ValueError(f"invalid form (= {form})")

Check warning on line 2075 in src/sage/combinat/symmetric_group_algebra.py

View check run for this annotation

Codecov / codecov/patch

src/sage/combinat/symmetric_group_algebra.py#L2075

Added line #L2075 was not covered by tests

def _dft_seminormal(self, mult='l2r'):
"""
Expand Down Expand Up @@ -2382,7 +2388,7 @@
[1, 1, 1] [1, 2, 3] - [1, 3, 2] - [2, 1, 3] + [2, 3, 1] + [3, 1, 2] - [3, 2, 1]
"""
T = []
total = 1 # make it 1-based
total = 1 # make it 1-based
for r in la:
T.append(list(range(total, total+r)))
total += r
Expand Down Expand Up @@ -3454,7 +3460,7 @@
T[1, 2, 3]
"""
if i not in range(1, self.n):
raise ValueError("i (= %(i)d) must be between 1 and n (= %(n)d)" % {'i': i, 'n': self.n})
raise ValueError(f"i (= {i}) must be between 1 and n (={self.n})")

Check warning on line 3463 in src/sage/combinat/symmetric_group_algebra.py

View check run for this annotation

Codecov / codecov/patch

src/sage/combinat/symmetric_group_algebra.py#L3463

Added line #L3463 was not covered by tests

t_i = Permutation((i, i + 1))
perm_i = t_i.right_action_product(perm)
Expand Down Expand Up @@ -3496,7 +3502,8 @@
sage: H3 = HeckeAlgebraSymmetricGroupT(QQ, 3, 1)
sage: a = H3([2,1,3])+2*H3([1,2,3])-H3([3,2,1])
sage: a^2 #indirect doctest
6*T[1, 2, 3] + 4*T[2, 1, 3] - T[2, 3, 1] - T[3, 1, 2] - 4*T[3, 2, 1]
6*T[1, 2, 3] + 4*T[2, 1, 3] - T[2, 3, 1]
- T[3, 1, 2] - 4*T[3, 2, 1]

::

Expand Down Expand Up @@ -3527,7 +3534,7 @@
ValueError: i (= 0) must be between 1 and n-1 (= 2)
"""
if i not in range(1, self.n):
raise ValueError("i (= %(i)d) must be between 1 and n-1 (= %(nm)d)" % {'i': i, 'nm': self.n - 1})
raise ValueError(f"i (= {i}) must be between 1 and n-1 (= {self.n - 1})")

P = self.basis().keys()
return self.monomial(P(list(range(1, i)) + [i + 1, i] +
Expand Down Expand Up @@ -3591,7 +3598,7 @@
if k not in range(2, self.n + 1):
if k == 1:
return self.one()
raise ValueError("k (= %(k)d) must be between 1 and n (= %(n)d)" % {'k': k, 'n': self.n})
raise ValueError(f"k (= {k}) must be between 1 and n (= {self.n})")

q = self.q()
P = self._indices
Expand Down
Loading