@@ -394,7 +394,7 @@ def grassmannian_quotient(self, i=0, side='right'):
394394 while not (D == [i ] or D == []):
395395 m = D [0 ]
396396 if m == i :
397- m = D [1 ]
397+ m = D [1 ]
398398 if side == 'right' :
399399 fin = fin .apply_simple_reflection (m , side = 'left' )
400400 gr = gr .apply_simple_reflection (m , side = 'right' )
@@ -470,7 +470,7 @@ def value(self, i, base_window=False):
470470 if base_window :
471471 self [i - 1 ]
472472 window = (i - 1 ) // (self .k + 1 )
473- return self [(i - 1 )% (self .k + 1 )] + window * (self .k + 1 )
473+ return self [(i - 1 ) % (self .k + 1 )] + window * (self .k + 1 )
474474
475475 def position (self , i ):
476476 r"""
@@ -518,7 +518,7 @@ def apply_simple_reflection_right(self, i):
518518 if j == 0 :
519519 a = l [0 ]
520520 l [0 ] = l [- 1 ] - (self .k + 1 )
521- l [- 1 ] = a + (self .k + 1 )
521+ l [- 1 ] = a + (self .k + 1 )
522522 else :
523523 a = l [j - 1 ]
524524 l [j - 1 ] = l [j ]
@@ -589,7 +589,7 @@ def has_right_descent(self, i) -> bool:
589589 sage: p.has_right_descent(0)
590590 False
591591 """
592- return self .value (i )> self .value (i + 1 )
592+ return self .value (i ) > self .value (i + 1 )
593593
594594 def has_left_descent (self , i ) -> bool :
595595 r"""
@@ -708,20 +708,20 @@ def maximal_cyclic_factor(self, typ='decreasing', side='right', verbose=False):
708708 j = i
709709 for _ in range (1 , self .k ):
710710 if (typ [0 ],side [0 ]) == ('d' , 'r' ):
711- j = (j + 1 )% (k + 1 )
711+ j = (j + 1 ) % (k + 1 )
712712 if (typ [0 ],side [0 ]) == ('i' , 'r' ):
713- j = (j - 1 )% (k + 1 )
713+ j = (j - 1 ) % (k + 1 )
714714 if (typ [0 ],side [0 ]) == ('d' , 'l' ):
715- j = (j - 1 )% (k + 1 )
715+ j = (j - 1 ) % (k + 1 )
716716 if (typ [0 ],side [0 ]) == ('i' , 'l' ):
717- j = (j + 1 )% (k + 1 )
717+ j = (j + 1 ) % (k + 1 )
718718 if y .has_descent (j , side ):
719- y = y .apply_simple_reflection (j ,side )
720- T .append (j % (k + 1 ))
719+ y = y .apply_simple_reflection (j ,side )
720+ T .append (j % (k + 1 ))
721721 if verbose :
722722 print (i , T )
723723 if len (T ) > len (best_T ):
724- best_T = T
724+ best_T = T
725725 #if (typ[0],side[0])==('i','r'): best_T.reverse()
726726 #if (typ[0],side[0])==('d','l'): best_T.reverse()
727727 #if typ[0]=='d': best_T.reverse()
@@ -791,7 +791,7 @@ def maximal_cyclic_decomposition(self, typ='decreasing', side='right', verbose=F
791791 y = y .apply_simple_reflection_left (i )
792792 if verbose :
793793 print (S , y .length ())
794- if side [0 ]== 'r' :
794+ if side [0 ] == 'r' :
795795 listy .reverse ()
796796 return listy
797797
@@ -848,13 +848,13 @@ def to_lehmer_code(self, typ='decreasing', side='right'):
848848 #value than the number in position i. Then cyclically shift
849849 #the resulting vector.
850850 for i in range (self .k + 1 ):
851- a = self (i )
851+ a = self (i )
852852 for j in range (i - self .k , i ):
853- b = self (j )
853+ b = self (j )
854854 # A small rotation is necessary for the reduced word from
855855 # the Lehmer code to match the element.
856856 if a < b :
857- code [i - 1 ]+= ((b - a )// (self .k + 1 )+ 1 )
857+ code [i - 1 ] += ((b - a )// (self .k + 1 )+ 1 )
858858 elif typ [0 ] == 'i' and side [0 ] == 'l' :
859859 #Find number of positions to the right of i smaller than i, then
860860 #cyclically shift the resulting vector.
@@ -866,7 +866,7 @@ def to_lehmer_code(self, typ='decreasing', side='right'):
866866 #the lehmer code to match the element.
867867 if b < i :
868868 code [i - 1 ] += (i - b ) // (self .k + 1 ) + 1
869- elif typ [0 ] == 'd' and side [0 ]== 'l' :
869+ elif typ [0 ] == 'd' and side [0 ] == 'l' :
870870 #Find number of positions to the left of i larger than i.
871871 for i in range (self .k + 1 ):
872872 pos = self .position (i )
@@ -1029,7 +1029,7 @@ def tableau_of_word(self, w, typ='decreasing', side='right', alpha=None):
10291029 if x0 .length () != len (w ):
10301030 raise ValueError ("word was not reduced" )
10311031 if alpha is None :
1032- alpha = Composition ([1 for i in w ])
1032+ alpha = Composition ([1 for i in w ])
10331033 else :
10341034 if sum (alpha ) != len (w ):
10351035 raise ValueError ("size of alpha must match length of w" )
@@ -1647,7 +1647,7 @@ def check(self):
16471647 if not len (self ) == 6 :
16481648 raise ValueError ("length of list must be 6" )
16491649 #Check that we have an even number of 'big' elements left of the 7th entry.
1650- s = sum (i // 6 - (i % 6 == 0 ) for i in self if i > 6 )
1650+ s = sum (i // 6 - (i % 6 == 0 ) for i in self if i > 6 )
16511651 if s % 2 :
16521652 raise ValueError ("type G affine permutations have an even number of"
16531653 " entries greater than 6 to the left of the 7th position" )
@@ -1678,7 +1678,7 @@ def value(self, i, base_window=False):
16781678 if base_window :
16791679 self [i - 1 ]
16801680 window = (i - 1 ) // N
1681- return self [(i - 1 )% N ] + window * (N )
1681+ return self [(i - 1 ) % N ] + window * (N )
16821682
16831683 def position (self , i ):
16841684 r"""
@@ -1758,28 +1758,28 @@ def apply_simple_reflection_left(self, i):
17581758 l = []
17591759 if i == 1 :
17601760 for m in range (6 ):
1761- res = self [m ]% 6
1762- if res == 1 or res == 3 or res == 5 :
1761+ res = self [m ] % 6
1762+ if res == 1 or res == 3 or res == 5 :
17631763 l .append (self [m ]+ 1 )
1764- elif res == 2 or res == 4 or res == 0 :
1764+ elif res == 2 or res == 4 or res == 0 :
17651765 l .append (self [m ]- 1 )
17661766 else :
17671767 l .append (self [m ])
17681768 elif i == 2 :
17691769 for m in range (6 ):
1770- res = self [m ]% 6
1771- if res == 2 or res == 4 :
1770+ res = self [m ] % 6
1771+ if res == 2 or res == 4 :
17721772 l .append (self [m ]+ 1 )
1773- elif res == 3 or res == 5 :
1773+ elif res == 3 or res == 5 :
17741774 l .append (self [m ]- 1 )
17751775 else :
17761776 l .append (self [m ])
17771777 elif i == 0 :
17781778 for m in range (6 ):
1779- res = self [m ]% 6
1780- if res == 1 or res == 2 :
1779+ res = self [m ] % 6
1780+ if res == 1 or res == 2 :
17811781 l .append (self [m ]- 2 )
1782- elif res == 5 or res == 0 :
1782+ elif res == 5 or res == 0 :
17831783 l .append (self [m ]+ 2 )
17841784 else :
17851785 l .append (self [m ])
@@ -1983,9 +1983,9 @@ def AffinePermutationGroup(cartan_type):
19831983 Type G affine permutation with window [0, 4, -1, 8, 3, 7]
19841984 """
19851985 ct = CartanType (cartan_type )
1986- if ct .letter == 'A' :
1986+ if ct .letter == 'A' :
19871987 return AffinePermutationGroupTypeA (ct )
1988- if ct .letter == 'B' :
1988+ if ct .letter == 'B' :
19891989 return AffinePermutationGroupTypeB (ct )
19901990 if ct .letter == 'C' :
19911991 return AffinePermutationGroupTypeC (ct )
@@ -2140,7 +2140,7 @@ def index_set(self):
21402140 """
21412141 return self .cartan_type ().index_set ()
21422142
2143- _index_set = index_set
2143+ _index_set = index_set
21442144
21452145 def reflection_index_set (self ):
21462146 r"""
0 commit comments