Skip to content

Commit de52c5f

Browse files
committed
fix warnings in coxeter_group.py
1 parent e2e0f8d commit de52c5f

File tree

1 file changed

+78
-66
lines changed

1 file changed

+78
-66
lines changed

src/sage/libs/coxeter3/coxeter_group.py

Lines changed: 78 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ def index_set(self):
103103
104104
EXAMPLES::
105105
106-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
107-
sage: W.index_set() # optional - coxeter3
106+
sage: # optional - coxeter3
107+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
108+
sage: W.index_set()
108109
(1, 2, 3)
109-
sage: C = CoxeterGroup(['A', 3,1], implementation='coxeter3') # optional - coxeter3
110-
sage: C.index_set() # optional - coxeter3
110+
sage: C = CoxeterGroup(['A', 3,1], implementation='coxeter3')
111+
sage: C.index_set()
111112
(0, 1, 2, 3)
112113
"""
113114
return self.cartan_type().index_set()
@@ -157,7 +158,7 @@ def simple_reflections(self):
157158
EXAMPLES::
158159
159160
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
160-
sage: s = W.simple_reflections() # optional - coxeter3
161+
sage: s = W.simple_reflections() # optional - coxeter3
161162
sage: s[2]*s[1]*s[2] # optional - coxeter3
162163
[1, 2, 1]
163164
"""
@@ -247,11 +248,12 @@ def root_system(self):
247248
248249
EXAMPLES::
249250
250-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
251-
sage: R = W.root_system(); R # optional - coxeter3
251+
sage: # optional - coxeter3
252+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
253+
sage: R = W.root_system(); R
252254
Root system of type ['A', 3]
253-
sage: alpha = R.root_space().basis() # optional - coxeter3
254-
sage: alpha[2] + alpha[3] # optional - coxeter3
255+
sage: alpha = R.root_space().basis()
256+
sage: alpha[2] + alpha[3]
255257
alpha[2] + alpha[3]
256258
"""
257259
return self.cartan_type().root_system()
@@ -303,13 +305,14 @@ def kazhdan_lusztig_polynomial(self, u, v, constant_term_one=True):
303305
304306
EXAMPLES::
305307
306-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
307-
sage: W.kazhdan_lusztig_polynomial([], [1,2, 1]) # optional - coxeter3
308+
sage: # optional - coxeter3
309+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
310+
sage: W.kazhdan_lusztig_polynomial([], [1,2, 1])
308311
1
309-
sage: W.kazhdan_lusztig_polynomial([1],[3,2]) # optional - coxeter3
312+
sage: W.kazhdan_lusztig_polynomial([1],[3,2])
310313
0
311-
sage: W = CoxeterGroup(['A',3],implementation='coxeter3') # optional - coxeter3
312-
sage: W.kazhdan_lusztig_polynomial([2],[2,1,3,2]) # optional - coxeter3
314+
sage: W = CoxeterGroup(['A',3],implementation='coxeter3')
315+
sage: W.kazhdan_lusztig_polynomial([2],[2,1,3,2])
313316
q + 1
314317
315318
.. NOTE::
@@ -384,24 +387,26 @@ def parabolic_kazhdan_lusztig_polynomial(self, u, v, J, constant_term_one=True):
384387
385388
EXAMPLES::
386389
387-
sage: W = CoxeterGroup(['A',3], implementation='coxeter3') # optional - coxeter3
388-
sage: W.parabolic_kazhdan_lusztig_polynomial([],[3,2],[1,3]) # optional - coxeter3
390+
sage: # optional - coxeter3
391+
sage: W = CoxeterGroup(['A',3], implementation='coxeter3')
392+
sage: W.parabolic_kazhdan_lusztig_polynomial([],[3,2],[1,3])
389393
0
390-
sage: W.parabolic_kazhdan_lusztig_polynomial([2],[2,1,3,2],[1,3]) # optional - coxeter3
394+
sage: W.parabolic_kazhdan_lusztig_polynomial([2],[2,1,3,2],[1,3])
391395
q
392396
393-
sage: C = CoxeterGroup(['A',3,1], implementation='coxeter3') # optional - coxeter3
394-
sage: C.parabolic_kazhdan_lusztig_polynomial([],[1],[0]) # optional - coxeter3
397+
sage: # optional - coxeter3
398+
sage: C = CoxeterGroup(['A',3,1], implementation='coxeter3')
399+
sage: C.parabolic_kazhdan_lusztig_polynomial([],[1],[0])
395400
1
396-
sage: C.parabolic_kazhdan_lusztig_polynomial([],[1,2,1],[0]) # optional - coxeter3
401+
sage: C.parabolic_kazhdan_lusztig_polynomial([],[1,2,1],[0])
397402
1
398-
sage: C.parabolic_kazhdan_lusztig_polynomial([],[0,1,0,1,2,1],[0]) # optional - coxeter3
403+
sage: C.parabolic_kazhdan_lusztig_polynomial([],[0,1,0,1,2,1],[0])
399404
q
400405
sage: w=[1, 2, 1, 3, 0, 2, 1, 0, 3, 0, 2]
401406
sage: v=[1, 2, 1, 3, 0, 1, 2, 1, 0, 3, 0, 2, 1, 0, 3, 0, 2]
402-
sage: C.parabolic_kazhdan_lusztig_polynomial(w,v,[1,3]) # optional - coxeter3
407+
sage: C.parabolic_kazhdan_lusztig_polynomial(w,v,[1,3])
403408
q^2 + q
404-
sage: C.parabolic_kazhdan_lusztig_polynomial(w,v,[1,3],constant_term_one=False) # optional - coxeter3
409+
sage: C.parabolic_kazhdan_lusztig_polynomial(w,v,[1,3],constant_term_one=False)
405410
q^4 + q^2
406411
407412
TESTS::
@@ -437,13 +442,14 @@ def __init__(self, parent, x):
437442
438443
Check that :trac:`32266` is fixed::
439444
440-
sage: A3 = CoxeterGroup('A3', implementation='coxeter3') # optional - coxeter3
441-
sage: s1,s2,s3 = A3.simple_reflections() # optional - coxeter3
442-
sage: s1*s3 # optional - coxeter3
445+
sage: # optional - coxeter3
446+
sage: A3 = CoxeterGroup('A3', implementation='coxeter3')
447+
sage: s1,s2,s3 = A3.simple_reflections()
448+
sage: s1*s3
443449
[1, 3]
444-
sage: s3*s1 # optional - coxeter3
450+
sage: s3*s1
445451
[1, 3]
446-
sage: s3*s1 == s1*s3 # optional - coxeter3
452+
sage: s3*s1 == s1*s3
447453
True
448454
"""
449455
if not isinstance(x, CoxGroupElement):
@@ -484,12 +490,13 @@ def _richcmp_(self, other, op):
484490
485491
EXAMPLES::
486492
487-
sage: W = CoxeterGroup(['B', 3], implementation='coxeter3') # optional - coxeter3
488-
sage: w = W([1,2,3]) # optional - coxeter3
489-
sage: v = W([3,1,2]) # optional - coxeter3
490-
sage: v < w # optional - coxeter3
493+
sage: # optional - coxeter3
494+
sage: W = CoxeterGroup(['B', 3], implementation='coxeter3')
495+
sage: w = W([1,2,3])
496+
sage: v = W([3,1,2])
497+
sage: v < w
491498
False
492-
sage: w < v # optional - coxeter3
499+
sage: w < v
493500
True
494501
495502
Some tests for equality::
@@ -534,11 +541,12 @@ def __getitem__(self, i):
534541
"""
535542
EXAMPLES::
536543
537-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
538-
sage: w0 = W([1,2,1]) # optional - coxeter3
539-
sage: w0[0] # optional - coxeter3
544+
sage: # optional - coxeter3
545+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
546+
sage: w0 = W([1,2,1])
547+
sage: w0[0]
540548
1
541-
sage: w0[1] # optional - coxeter3
549+
sage: w0[1]
542550
2
543551
544552
"""
@@ -549,13 +557,14 @@ def _mul_(self, y):
549557
"""
550558
EXAMPLES::
551559
552-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
553-
sage: s = W.gens() # optional - coxeter3
554-
sage: s[1]._mul_(s[1]) # optional - coxeter3
560+
sage: # optional - coxeter3
561+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
562+
sage: s = W.gens()
563+
sage: s[1]._mul_(s[1])
555564
[]
556-
sage: s[1]*s[2]*s[1] # optional - coxeter3
565+
sage: s[1]*s[2]*s[1]
557566
[1, 2, 1]
558-
sage: s[2]*s[1]*s[2] # optional - coxeter3
567+
sage: s[2]*s[1]*s[2]
559568
[1, 2, 1]
560569
"""
561570
return self.__class__(self.parent(), self.value * y.value)
@@ -564,11 +573,12 @@ def __len__(self):
564573
"""
565574
EXAMPLES::
566575
567-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
568-
sage: w = W([1,2,1]) # optional - coxeter3
569-
sage: w.length() # optional - coxeter3
576+
sage: # optional - coxeter3
577+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
578+
sage: w = W([1,2,1])
579+
sage: w.length()
570580
3
571-
sage: len(w) # optional - coxeter3
581+
sage: len(w)
572582
3
573583
"""
574584
return len(self.value)
@@ -594,18 +604,18 @@ def poincare_polynomial(self):
594604
595605
EXAMPLES::
596606
597-
sage: W = CoxeterGroup(['A', 2], implementation='coxeter3') # optional - coxeter3
598-
sage: W.long_element().poincare_polynomial() # optional - coxeter3
607+
sage: # optional - coxeter3
608+
sage: W = CoxeterGroup(['A', 2], implementation='coxeter3')
609+
sage: W.long_element().poincare_polynomial()
599610
t^3 + 2*t^2 + 2*t + 1
600-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
601-
sage: W([2,1,3,2]).poincare_polynomial() # optional - coxeter3
611+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
612+
sage: W([2,1,3,2]).poincare_polynomial()
602613
t^4 + 4*t^3 + 5*t^2 + 3*t + 1
603-
sage: W([1,2,3,2,1]).poincare_polynomial() # optional - coxeter3
614+
sage: W([1,2,3,2,1]).poincare_polynomial()
604615
t^5 + 4*t^4 + 6*t^3 + 5*t^2 + 3*t + 1
605-
606-
sage: rw = sage.combinat.permutation.from_reduced_word # optional - coxeter3
607-
sage: p = [w.poincare_polynomial() for w in W] # optional - coxeter3
608-
sage: [rw(w.reduced_word()) for i,w in enumerate(W) if p[i] != p[i].reverse()] # optional - coxeter3
616+
sage: rw = sage.combinat.permutation.from_reduced_word
617+
sage: p = [w.poincare_polynomial() for w in W]
618+
sage: [rw(w.reduced_word()) for i,w in enumerate(W) if p[i] != p[i].reverse()]
609619
[[3, 4, 1, 2], [4, 2, 3, 1]]
610620
"""
611621
return self.value.poincare_polynomial()
@@ -648,12 +658,13 @@ def action(self, v):
648658
649659
EXAMPLES::
650660
651-
sage: W = CoxeterGroup(['B', 3], implementation='coxeter3') # optional - coxeter3
652-
sage: R = W.root_system().root_space() # optional - coxeter3
653-
sage: v = R.an_element(); v # optional - coxeter3
661+
sage: # optional - coxeter3
662+
sage: W = CoxeterGroup(['B', 3], implementation='coxeter3')
663+
sage: R = W.root_system().root_space()
664+
sage: v = R.an_element(); v
654665
2*alpha[1] + 2*alpha[2] + 3*alpha[3]
655-
sage: w = W([1,2,3]) # optional - coxeter3
656-
sage: w.action(v) # optional - coxeter3
666+
sage: w = W([1,2,3])
667+
sage: w.action(v)
657668
-alpha[1] + alpha[2] + alpha[3]
658669
"""
659670
#TODO: Find a better way to do this
@@ -675,14 +686,15 @@ def action_on_rational_function(self, f):
675686
676687
EXAMPLES::
677688
678-
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3') # optional - coxeter3
679-
sage: S = PolynomialRing(QQ, 'x,y,z').fraction_field() # optional - coxeter3
680-
sage: x,y,z = S.gens() # optional - coxeter3
681-
sage: W([1]).action_on_rational_function(x+y+z) # optional - coxeter3
689+
sage: # optional - coxeter3
690+
sage: W = CoxeterGroup(['A', 3], implementation='coxeter3')
691+
sage: S = PolynomialRing(QQ, 'x,y,z').fraction_field()
692+
sage: x,y,z = S.gens()
693+
sage: W([1]).action_on_rational_function(x+y+z)
682694
(x^2*y + x*z + 1)/x
683-
sage: W([2]).action_on_rational_function(x+y+z) # optional - coxeter3
695+
sage: W([2]).action_on_rational_function(x+y+z)
684696
(x*y^2 + y^2*z + 1)/y
685-
sage: W([3]).action_on_rational_function(x+y+z) # optional - coxeter3
697+
sage: W([3]).action_on_rational_function(x+y+z)
686698
(y*z^2 + x*z + 1)/z
687699
"""
688700
Q = f.parent()

0 commit comments

Comments
 (0)