@@ -394,7 +394,7 @@ def grassmannian_quotient(self, i=0, side='right'):
394
394
while not (D == [i ] or D == []):
395
395
m = D [0 ]
396
396
if m == i :
397
- m = D [1 ]
397
+ m = D [1 ]
398
398
if side == 'right' :
399
399
fin = fin .apply_simple_reflection (m , side = 'left' )
400
400
gr = gr .apply_simple_reflection (m , side = 'right' )
@@ -470,7 +470,7 @@ def value(self, i, base_window=False):
470
470
if base_window :
471
471
self [i - 1 ]
472
472
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 )
474
474
475
475
def position (self , i ):
476
476
r"""
@@ -518,7 +518,7 @@ def apply_simple_reflection_right(self, i):
518
518
if j == 0 :
519
519
a = l [0 ]
520
520
l [0 ] = l [- 1 ] - (self .k + 1 )
521
- l [- 1 ] = a + (self .k + 1 )
521
+ l [- 1 ] = a + (self .k + 1 )
522
522
else :
523
523
a = l [j - 1 ]
524
524
l [j - 1 ] = l [j ]
@@ -589,7 +589,7 @@ def has_right_descent(self, i) -> bool:
589
589
sage: p.has_right_descent(0)
590
590
False
591
591
"""
592
- return self .value (i )> self .value (i + 1 )
592
+ return self .value (i ) > self .value (i + 1 )
593
593
594
594
def has_left_descent (self , i ) -> bool :
595
595
r"""
@@ -708,20 +708,20 @@ def maximal_cyclic_factor(self, typ='decreasing', side='right', verbose=False):
708
708
j = i
709
709
for _ in range (1 , self .k ):
710
710
if (typ [0 ],side [0 ]) == ('d' , 'r' ):
711
- j = (j + 1 )% (k + 1 )
711
+ j = (j + 1 ) % (k + 1 )
712
712
if (typ [0 ],side [0 ]) == ('i' , 'r' ):
713
- j = (j - 1 )% (k + 1 )
713
+ j = (j - 1 ) % (k + 1 )
714
714
if (typ [0 ],side [0 ]) == ('d' , 'l' ):
715
- j = (j - 1 )% (k + 1 )
715
+ j = (j - 1 ) % (k + 1 )
716
716
if (typ [0 ],side [0 ]) == ('i' , 'l' ):
717
- j = (j + 1 )% (k + 1 )
717
+ j = (j + 1 ) % (k + 1 )
718
718
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 ))
721
721
if verbose :
722
722
print (i , T )
723
723
if len (T ) > len (best_T ):
724
- best_T = T
724
+ best_T = T
725
725
#if (typ[0],side[0])==('i','r'): best_T.reverse()
726
726
#if (typ[0],side[0])==('d','l'): best_T.reverse()
727
727
#if typ[0]=='d': best_T.reverse()
@@ -791,7 +791,7 @@ def maximal_cyclic_decomposition(self, typ='decreasing', side='right', verbose=F
791
791
y = y .apply_simple_reflection_left (i )
792
792
if verbose :
793
793
print (S , y .length ())
794
- if side [0 ]== 'r' :
794
+ if side [0 ] == 'r' :
795
795
listy .reverse ()
796
796
return listy
797
797
@@ -848,13 +848,13 @@ def to_lehmer_code(self, typ='decreasing', side='right'):
848
848
#value than the number in position i. Then cyclically shift
849
849
#the resulting vector.
850
850
for i in range (self .k + 1 ):
851
- a = self (i )
851
+ a = self (i )
852
852
for j in range (i - self .k , i ):
853
- b = self (j )
853
+ b = self (j )
854
854
# A small rotation is necessary for the reduced word from
855
855
# the Lehmer code to match the element.
856
856
if a < b :
857
- code [i - 1 ]+= ((b - a )// (self .k + 1 )+ 1 )
857
+ code [i - 1 ] += ((b - a )// (self .k + 1 )+ 1 )
858
858
elif typ [0 ] == 'i' and side [0 ] == 'l' :
859
859
#Find number of positions to the right of i smaller than i, then
860
860
#cyclically shift the resulting vector.
@@ -866,7 +866,7 @@ def to_lehmer_code(self, typ='decreasing', side='right'):
866
866
#the lehmer code to match the element.
867
867
if b < i :
868
868
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' :
870
870
#Find number of positions to the left of i larger than i.
871
871
for i in range (self .k + 1 ):
872
872
pos = self .position (i )
@@ -1029,7 +1029,7 @@ def tableau_of_word(self, w, typ='decreasing', side='right', alpha=None):
1029
1029
if x0 .length () != len (w ):
1030
1030
raise ValueError ("word was not reduced" )
1031
1031
if alpha is None :
1032
- alpha = Composition ([1 for i in w ])
1032
+ alpha = Composition ([1 for i in w ])
1033
1033
else :
1034
1034
if sum (alpha ) != len (w ):
1035
1035
raise ValueError ("size of alpha must match length of w" )
@@ -1647,7 +1647,7 @@ def check(self):
1647
1647
if not len (self ) == 6 :
1648
1648
raise ValueError ("length of list must be 6" )
1649
1649
#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 )
1651
1651
if s % 2 :
1652
1652
raise ValueError ("type G affine permutations have an even number of"
1653
1653
" entries greater than 6 to the left of the 7th position" )
@@ -1678,7 +1678,7 @@ def value(self, i, base_window=False):
1678
1678
if base_window :
1679
1679
self [i - 1 ]
1680
1680
window = (i - 1 ) // N
1681
- return self [(i - 1 )% N ] + window * (N )
1681
+ return self [(i - 1 ) % N ] + window * (N )
1682
1682
1683
1683
def position (self , i ):
1684
1684
r"""
@@ -1758,28 +1758,28 @@ def apply_simple_reflection_left(self, i):
1758
1758
l = []
1759
1759
if i == 1 :
1760
1760
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 :
1763
1763
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 :
1765
1765
l .append (self [m ]- 1 )
1766
1766
else :
1767
1767
l .append (self [m ])
1768
1768
elif i == 2 :
1769
1769
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 :
1772
1772
l .append (self [m ]+ 1 )
1773
- elif res == 3 or res == 5 :
1773
+ elif res == 3 or res == 5 :
1774
1774
l .append (self [m ]- 1 )
1775
1775
else :
1776
1776
l .append (self [m ])
1777
1777
elif i == 0 :
1778
1778
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 :
1781
1781
l .append (self [m ]- 2 )
1782
- elif res == 5 or res == 0 :
1782
+ elif res == 5 or res == 0 :
1783
1783
l .append (self [m ]+ 2 )
1784
1784
else :
1785
1785
l .append (self [m ])
@@ -1983,9 +1983,9 @@ def AffinePermutationGroup(cartan_type):
1983
1983
Type G affine permutation with window [0, 4, -1, 8, 3, 7]
1984
1984
"""
1985
1985
ct = CartanType (cartan_type )
1986
- if ct .letter == 'A' :
1986
+ if ct .letter == 'A' :
1987
1987
return AffinePermutationGroupTypeA (ct )
1988
- if ct .letter == 'B' :
1988
+ if ct .letter == 'B' :
1989
1989
return AffinePermutationGroupTypeB (ct )
1990
1990
if ct .letter == 'C' :
1991
1991
return AffinePermutationGroupTypeC (ct )
@@ -2140,7 +2140,7 @@ def index_set(self):
2140
2140
"""
2141
2141
return self .cartan_type ().index_set ()
2142
2142
2143
- _index_set = index_set
2143
+ _index_set = index_set
2144
2144
2145
2145
def reflection_index_set (self ):
2146
2146
r"""
0 commit comments