Skip to content

Commit a7af730

Browse files
committed
Removing Tabloid(s) class; improving class structure; adding functionality.
1 parent 4da2779 commit a7af730

File tree

8 files changed

+203
-354
lines changed

8 files changed

+203
-354
lines changed

src/doc/en/reference/combinat/module_list.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ Comprehensive Module List
362362
sage/combinat/tableau
363363
sage/combinat/tableau_residues
364364
sage/combinat/tableau_tuple
365-
sage/combinat/tabloid
366365
sage/combinat/tamari_lattices
367366
sage/combinat/tiling
368367
sage/combinat/tools

src/sage/combinat/all.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@
171171
lazy_import('sage.combinat.super_tableau',
172172
["StandardSuperTableau", "SemistandardSuperTableau", "StandardSuperTableaux", "SemistandardSuperTableaux"])
173173

174-
# Tabloids
175-
lazy_import('sage.combinat.tabloid', "Tabloids")
176-
177174
# Words
178175
from .words.all import *
179176

src/sage/combinat/catalog_partitions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
- :ref:`sage.combinat.superpartition`
1111
- :ref:`sage.combinat.tableau`
1212
- :ref:`sage.combinat.tableau_tuple`
13-
- :ref:`sage.combinat.tabloid`
1413
- :ref:`sage.combinat.skew_tableau`
1514
- :ref:`sage.combinat.ribbon`
1615
- :ref:`sage.combinat.ribbon_tableau`

src/sage/combinat/composition.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
from sage.combinat.combinatorial_map import combinatorial_map
4646
from sage.misc.persist import register_unpickle_override
4747

48+
from sage.misc.lazy_import import lazy_import
49+
lazy_import("sage.combinat.partition", "Partition")
50+
4851

4952
class Composition(CombinatorialElement):
5053
r"""
@@ -1186,7 +1189,6 @@ def to_partition(self):
11861189
sage: Composition([]).to_partition() # needs sage.combinat
11871190
[]
11881191
"""
1189-
from sage.combinat.partition import Partition
11901192
return Partition(sorted(self, reverse=True))
11911193

11921194
def to_skew_partition(self, overlap=1):
@@ -1754,7 +1756,7 @@ def _element_constructor_(self, lst) -> Composition:
17541756
sage: P([3,3,1]) # indirect doctest
17551757
[3, 3, 1]
17561758
"""
1757-
if isinstance(lst, Composition):
1759+
if isinstance(lst, (Composition, Partition)):
17581760
lst = list(lst)
17591761
elt = self.element_class(self, lst)
17601762
if elt not in self:
@@ -1774,7 +1776,7 @@ def __contains__(self, x) -> bool:
17741776
sage: [0,0] in Compositions()
17751777
True
17761778
"""
1777-
if isinstance(x, Composition):
1779+
if isinstance(x, (Composition, Partition)):
17781780
return True
17791781
elif isinstance(x, list):
17801782
for i in x:

src/sage/combinat/partition.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5497,7 +5497,7 @@ def specht_module(self, base_ring=None):
54975497
sage: SM = Partition([2,2,1]).specht_module(QQ); SM
54985498
Specht module of [2, 2, 1] over Rational Field
54995499
sage: s = SymmetricFunctions(QQ).s()
5500-
sage: s(SM.frobenius_image()) # needs sage.modules
5500+
sage: SM.frobenius_image() # needs sage.modules
55015501
s[2, 2, 1]
55025502
"""
55035503
from sage.combinat.specht_module import SpechtModule
@@ -5570,6 +5570,24 @@ def simple_module_dimension(self, base_ring=None):
55705570
from sage.combinat.specht_module import simple_module_rank
55715571
return simple_module_rank(self, base_ring)
55725572

5573+
def tabloid_module(self, base_ring=None):
5574+
r"""
5575+
Return the tabloid module corresponding to ``self``.
5576+
5577+
EXAMPLES::
5578+
5579+
sage: TM = Partition([2,2,1]).tabloid_module(QQ); TM
5580+
Tabloid module of [2, 2, 1] over Rational Field
5581+
sage: TM.frobenius_image()
5582+
s[2, 2, 1] + s[3, 1, 1] + 2*s[3, 2] + 2*s[4, 1] + s[5]
5583+
"""
5584+
from sage.combinat.specht_module import TabloidModule
5585+
from sage.combinat.symmetric_group_algebra import SymmetricGroupAlgebra
5586+
if base_ring is None:
5587+
from sage.rings.rational_field import QQ
5588+
base_ring = QQ
5589+
R = SymmetricGroupAlgebra(base_ring, sum(self))
5590+
return TabloidModule(R, self)
55735591

55745592
##############
55755593
# Partitions #

src/sage/combinat/permutation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7342,6 +7342,19 @@ def cardinality(self):
73427342
"""
73437343
return factorial(self.n)
73447344

7345+
@cached_method
7346+
def gens(self):
7347+
r"""
7348+
Return a set of generators for ``self`` as a group.
7349+
7350+
EXAMPLES::
7351+
7352+
sage: P4 = Permutations(4)
7353+
sage: P4.gens()
7354+
([2, 1, 3, 4], [1, 3, 2, 4], [1, 2, 4, 3])
7355+
"""
7356+
return tuple(self.group_generators())
7357+
73457358
def degree(self):
73467359
"""
73477360
Return the degree of ``self``.

0 commit comments

Comments
 (0)