22
22
from sage .combinat .permutation import Permutations
23
23
from sage .combinat .free_module import CombinatorialFreeModule
24
24
from sage .combinat .specht_module import SpechtModule as SymGroupSpechtModule
25
- from sage .combinat .partition_tuple import PartitionTuples , PartitionTuple
25
+ from sage .combinat .partition_tuple import PartitionTuples
26
26
from sage .groups .conjugacy_classes import ConjugacyClass
27
27
from sage .modules .with_basis .subquotient import SubmoduleWithBasis , QuotientModuleWithBasis
28
28
from sage .modules .with_basis .representation import Representation_abstract
@@ -280,7 +280,7 @@ def to_matrix(self):
280
280
"""
281
281
Cp = CyclotomicField (self .parent ()._m )
282
282
g = Cp .gen ()
283
- D = diagonal_matrix (Cp , [g ** i for i in self ._colors ])
283
+ D = diagonal_matrix (Cp , [g ** i for i in self ._colors ])
284
284
return self ._perm .to_matrix () * D
285
285
286
286
def has_left_descent (self , i ) -> bool :
@@ -478,7 +478,7 @@ def __classcall_private__(cls, m, p, n):
478
478
return ColoredPermutations (m , n )
479
479
return super ().__classcall__ (cls , m , p , n )
480
480
481
- def __init__ (self , m , p , n ):
481
+ def __init__ (self , m , p , n ) -> None :
482
482
r"""
483
483
Initialize ``self``.
484
484
@@ -509,9 +509,7 @@ def __init__(self, m, p, n):
509
509
self ._C = IntegerModRing (self ._m )
510
510
self ._P = Permutations (self ._n )
511
511
512
- if (self ._p == 1 and (self ._m == 1 or self ._m == 2 )
513
- or (self ._p == 2 and self ._m == 2 )
514
- or (self ._n == 2 and self ._p == self ._m )):
512
+ if self ._p <= self ._m <= 2 or (self ._n == 2 and self ._p == self ._m ):
515
513
from sage .categories .finite_coxeter_groups import FiniteCoxeterGroups
516
514
category = FiniteCoxeterGroups ()
517
515
if not (self ._n == self ._m == self ._p == 2 ): # special case of type D_2
@@ -523,7 +521,7 @@ def __init__(self, m, p, n):
523
521
category = category .WellGenerated ()
524
522
Parent .__init__ (self , category = category )
525
523
526
- def _repr_ (self ):
524
+ def _repr_ (self ) -> str :
527
525
"""
528
526
Return a string representation of ``self``.
529
527
@@ -743,8 +741,8 @@ def simple_reflection(self, i):
743
741
if i == self ._n + 1 or self ._n == 1 :
744
742
return sn ** self ._p
745
743
746
- snm = self .simple_reflection (self ._n - 1 )
747
- return sn ** (self ._m - 1 ) * snm * sn
744
+ snm = self .simple_reflection (self ._n - 1 )
745
+ return sn ** (self ._m - 1 ) * snm * sn
748
746
749
747
@cached_method
750
748
def _inverse_simple_reflections (self ):
@@ -2227,7 +2225,7 @@ def __init__(self, G, base_ring, diagram):
2227
2225
data = [cartesian_product ([OrderedSetPartitions ([val * x for x , val in zip (sorted (X ), signs )], la ),
2228
2226
OrderedSetPartitions (sorted (Y ), mu )])
2229
2227
for (X , Y ) in OrderedSetPartitions (G ._n , [sum (la ), sum (mu )])
2230
- for signs in product ([1 ,- 1 ], repeat = sum (la ))]
2228
+ for signs in product ([1 , - 1 ], repeat = sum (la ))]
2231
2229
tabloids = DisjointUnionEnumeratedSets (data )
2232
2230
tabloids .rename (f"Tabloids of shape { self ._diagram } " )
2233
2231
@@ -2527,8 +2525,8 @@ def group_elements(sigma):
2527
2525
n = T .size ()
2528
2526
for sigma in T .column_stabilizer ():
2529
2527
sigma = sigma .tuple ()
2530
- for signs in product (* [[1 ,- 1 ] if i not in mu_vals else [1 ]
2531
- for i in range (1 ,n + 1 )]):
2528
+ for signs in product (* [[1 , - 1 ] if i not in mu_vals else [1 ]
2529
+ for i in range (1 , n + 1 )]):
2532
2530
yield self ._semigroup ([s * val for s , val in zip (signs , sigma )])
2533
2531
2534
2532
return ambient .sum_of_terms ((ambient ._semigroup_basis_action (elt , tab ),
@@ -2922,7 +2920,7 @@ class SimpleModule(Representation_abstract, QuotientModuleWithBasis):
2922
2920
[0 0 0 0 0 0 1 0]
2923
2921
[0 0 0 0 0 0 0 1]
2924
2922
"""
2925
- def __init__ (self , specht_module ):
2923
+ def __init__ (self , specht_module ) -> None :
2926
2924
r"""
2927
2925
Initialize ``self``.
2928
2926
@@ -2932,18 +2930,19 @@ def __init__(self, specht_module):
2932
2930
sage: D = B4.simple_module([[2,1], [1]], GF(3))
2933
2931
sage: TestSuite(D).run()
2934
2932
"""
2935
- self ._diagram = specht_module ._diagram
2936
2933
p = specht_module .base_ring ().characteristic ()
2937
- if ( not all ( la . is_regular ( p ) for la in specht_module ._diagram )
2938
- or (p == 2 and specht_module . _diagram [0 ])):
2934
+ d = self . _diagram = specht_module ._diagram
2935
+ if (p == 2 and d [0 ]) or not all ( la . is_regular ( p ) for la in d ):
2939
2936
raise ValueError (f"the partition must be { p } -regular" )
2940
- Representation_abstract .__init__ (self , specht_module ._semigroup , specht_module ._side ,
2937
+ Representation_abstract .__init__ (self , specht_module ._semigroup ,
2938
+ specht_module ._side ,
2941
2939
algebra = specht_module ._semigroup_algebra )
2942
2940
cat = specht_module .category ()
2943
- QuotientModuleWithBasis .__init__ (self , specht_module .maximal_submodule (),
2941
+ QuotientModuleWithBasis .__init__ (self ,
2942
+ specht_module .maximal_submodule (),
2944
2943
cat , prefix = 'D' , bracket = '' )
2945
2944
2946
- def _repr_ (self ):
2945
+ def _repr_ (self ) -> str :
2947
2946
r"""
2948
2947
Return a string representation of ``self``.
2949
2948
@@ -2955,7 +2954,7 @@ def _repr_(self):
2955
2954
"""
2956
2955
return f"Simple module of { self ._diagram } over { self .base_ring ()} "
2957
2956
2958
- def _latex_ (self ):
2957
+ def _latex_ (self ) -> str :
2959
2958
r"""
2960
2959
Return a latex representation of ``self``.
2961
2960
0 commit comments