Skip to content

Commit 9469546

Browse files
author
Matthias Koeppe
committed
sage.combinat.root_system: Update # needs
1 parent 59da456 commit 9469546

15 files changed

+414
-347
lines changed

src/sage/combinat/root_system/cartan_matrix.py

Lines changed: 113 additions & 95 deletions
Large diffs are not rendered by default.

src/sage/combinat/root_system/cartan_type.py

Lines changed: 63 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,15 +1147,16 @@ def coxeter_diagram(self):
11471147
11481148
EXAMPLES::
11491149
1150-
sage: CartanType(['B',3]).coxeter_diagram() # needs sage.graphs
1150+
sage: # needs sage.graphs
1151+
sage: CartanType(['B',3]).coxeter_diagram()
11511152
Graph on 3 vertices
1152-
sage: CartanType(['A',3]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1153+
sage: CartanType(['A',3]).coxeter_diagram().edges(sort=True)
11531154
[(1, 2, 3), (2, 3, 3)]
1154-
sage: CartanType(['B',3]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1155+
sage: CartanType(['B',3]).coxeter_diagram().edges(sort=True)
11551156
[(1, 2, 3), (2, 3, 4)]
1156-
sage: CartanType(['G',2]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1157+
sage: CartanType(['G',2]).coxeter_diagram().edges(sort=True)
11571158
[(1, 2, 6)]
1158-
sage: CartanType(['F',4]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1159+
sage: CartanType(['F',4]).coxeter_diagram().edges(sort=True)
11591160
[(1, 2, 3), (2, 3, 4), (3, 4, 3)]
11601161
"""
11611162

@@ -1641,17 +1642,18 @@ def coxeter_diagram(self):
16411642
16421643
EXAMPLES::
16431644
1644-
sage: CartanType(['A',3]).coxeter_diagram() # needs sage.graphs
1645+
sage: # needs sage.graphs
1646+
sage: CartanType(['A',3]).coxeter_diagram()
16451647
Graph on 3 vertices
1646-
sage: CartanType(['A',3]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1648+
sage: CartanType(['A',3]).coxeter_diagram().edges(sort=True)
16471649
[(1, 2, 3), (2, 3, 3)]
1648-
sage: CartanType(['B',3]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1650+
sage: CartanType(['B',3]).coxeter_diagram().edges(sort=True)
16491651
[(1, 2, 3), (2, 3, 4)]
1650-
sage: CartanType(['G',2]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1652+
sage: CartanType(['G',2]).coxeter_diagram().edges(sort=True)
16511653
[(1, 2, 6)]
1652-
sage: CartanType(['F',4]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1654+
sage: CartanType(['F',4]).coxeter_diagram().edges(sort=True)
16531655
[(1, 2, 3), (2, 3, 4), (3, 4, 3)]
1654-
sage: CartanType(['A',2,2]).coxeter_diagram().edges(sort=True) # needs sage.graphs
1656+
sage: CartanType(['A',2,2]).coxeter_diagram().edges(sort=True)
16551657
[(0, 1, +Infinity)]
16561658
"""
16571659
return self.dynkin_diagram().coxeter_diagram()
@@ -1977,17 +1979,18 @@ def special_nodes(self):
19771979
19781980
EXAMPLES::
19791981
1980-
sage: CartanType(['A',3,1]).special_nodes() # needs sage.graphs sage.groups
1982+
sage: # needs sage.graphs sage.groups
1983+
sage: CartanType(['A',3,1]).special_nodes()
19811984
(0, 1, 2, 3)
1982-
sage: CartanType(['C',2,1]).special_nodes() # needs sage.graphs sage.groups
1985+
sage: CartanType(['C',2,1]).special_nodes()
19831986
(0, 2)
1984-
sage: CartanType(['D',4,1]).special_nodes() # needs sage.graphs sage.groups
1987+
sage: CartanType(['D',4,1]).special_nodes()
19851988
(0, 1, 3, 4)
1986-
sage: CartanType(['E',6,1]).special_nodes() # needs sage.graphs sage.groups
1989+
sage: CartanType(['E',6,1]).special_nodes()
19871990
(0, 1, 6)
1988-
sage: CartanType(['D',3,2]).special_nodes() # needs sage.graphs sage.groups
1991+
sage: CartanType(['D',3,2]).special_nodes()
19891992
(0, 2)
1990-
sage: CartanType(['A',4,2]).special_nodes() # needs sage.graphs sage.groups
1993+
sage: CartanType(['A',4,2]).special_nodes()
19911994
(0,)
19921995
"""
19931996
return tuple(sorted(self.dynkin_diagram().automorphism_group(edge_labels=True).orbit(self.special_node())))
@@ -2094,13 +2097,14 @@ def row_annihilator(self, m=None):
20942097
20952098
EXAMPLES::
20962099
2097-
sage: RootSystem(['C',2,1]).cartan_type().acheck() # needs sage.graphs
2100+
sage: # needs sage.graphs
2101+
sage: RootSystem(['C',2,1]).cartan_type().acheck()
20982102
Finite family {0: 1, 1: 1, 2: 1}
2099-
sage: RootSystem(['D',4,1]).cartan_type().acheck() # needs sage.graphs
2103+
sage: RootSystem(['D',4,1]).cartan_type().acheck()
21002104
Finite family {0: 1, 1: 1, 2: 2, 3: 1, 4: 1}
2101-
sage: RootSystem(['F',4,1]).cartan_type().acheck() # needs sage.graphs
2105+
sage: RootSystem(['F',4,1]).cartan_type().acheck()
21022106
Finite family {0: 1, 1: 2, 2: 3, 3: 2, 4: 1}
2103-
sage: RootSystem(['BC',4,2]).cartan_type().acheck() # needs sage.graphs
2107+
sage: RootSystem(['BC',4,2]).cartan_type().acheck()
21042108
Finite family {0: 1, 1: 2, 2: 2, 3: 2, 4: 2}
21052109
21062110
``acheck`` is a shortcut for row_annihilator::
@@ -2143,13 +2147,14 @@ def col_annihilator(self):
21432147
21442148
EXAMPLES::
21452149
2146-
sage: RootSystem(['C',2,1]).cartan_type().a() # needs sage.graphs
2150+
sage: # needs sage.graphs
2151+
sage: RootSystem(['C',2,1]).cartan_type().a()
21472152
Finite family {0: 1, 1: 2, 2: 1}
2148-
sage: RootSystem(['D',4,1]).cartan_type().a() # needs sage.graphs
2153+
sage: RootSystem(['D',4,1]).cartan_type().a()
21492154
Finite family {0: 1, 1: 1, 2: 2, 3: 1, 4: 1}
2150-
sage: RootSystem(['F',4,1]).cartan_type().a() # needs sage.graphs
2155+
sage: RootSystem(['F',4,1]).cartan_type().a()
21512156
Finite family {0: 1, 1: 2, 2: 3, 3: 4, 4: 2}
2152-
sage: RootSystem(['BC',4,2]).cartan_type().a() # needs sage.graphs
2157+
sage: RootSystem(['BC',4,2]).cartan_type().a()
21532158
Finite family {0: 2, 1: 2, 2: 2, 3: 2, 4: 1}
21542159
21552160
``a`` is a shortcut for col_annihilator::
@@ -2172,13 +2177,14 @@ def c(self):
21722177
21732178
EXAMPLES::
21742179
2175-
sage: RootSystem(['C',2,1]).cartan_type().c() # needs sage.graphs
2180+
sage: # needs sage.graphs
2181+
sage: RootSystem(['C',2,1]).cartan_type().c()
21762182
Finite family {0: 1, 1: 2, 2: 1}
2177-
sage: RootSystem(['D',4,1]).cartan_type().c() # needs sage.graphs
2183+
sage: RootSystem(['D',4,1]).cartan_type().c()
21782184
Finite family {0: 1, 1: 1, 2: 1, 3: 1, 4: 1}
2179-
sage: RootSystem(['F',4,1]).cartan_type().c() # needs sage.graphs
2185+
sage: RootSystem(['F',4,1]).cartan_type().c()
21802186
Finite family {0: 1, 1: 1, 2: 1, 3: 2, 4: 2}
2181-
sage: RootSystem(['BC',4,2]).cartan_type().c() # needs sage.graphs
2187+
sage: RootSystem(['BC',4,2]).cartan_type().c()
21822188
Finite family {0: 2, 1: 1, 2: 1, 3: 1, 4: 1}
21832189
21842190
TESTS::
@@ -2228,55 +2234,57 @@ def translation_factors(self):
22282234
22292235
EXAMPLES::
22302236
2231-
sage: CartanType(['C',2,1]).translation_factors() # needs sage.graphs
2237+
sage: # needs sage.graphs
2238+
sage: CartanType(['C',2,1]).translation_factors()
22322239
Finite family {0: 1, 1: 2, 2: 1}
2233-
sage: CartanType(['C',2,1]).dual().translation_factors() # needs sage.graphs
2240+
sage: CartanType(['C',2,1]).dual().translation_factors()
22342241
Finite family {0: 1, 1: 1, 2: 1}
2235-
sage: CartanType(['D',4,1]).translation_factors() # needs sage.graphs
2242+
sage: CartanType(['D',4,1]).translation_factors()
22362243
Finite family {0: 1, 1: 1, 2: 1, 3: 1, 4: 1}
2237-
sage: CartanType(['F',4,1]).translation_factors() # needs sage.graphs
2244+
sage: CartanType(['F',4,1]).translation_factors()
22382245
Finite family {0: 1, 1: 1, 2: 1, 3: 2, 4: 2}
2239-
sage: CartanType(['BC',4,2]).translation_factors() # needs sage.graphs
2246+
sage: CartanType(['BC',4,2]).translation_factors()
22402247
Finite family {0: 1, 1: 1, 2: 1, 3: 1, 4: 1/2}
22412248
22422249
We proceed with systematic tests taken from MuPAD-Combinat's
22432250
testsuite::
22442251
2245-
sage: list(CartanType(["A", 1, 1]).translation_factors()) # needs sage.graphs
2252+
sage: # needs sage.graphs
2253+
sage: list(CartanType(["A", 1, 1]).translation_factors())
22462254
[1, 1]
2247-
sage: list(CartanType(["A", 5, 1]).translation_factors()) # needs sage.graphs
2255+
sage: list(CartanType(["A", 5, 1]).translation_factors())
22482256
[1, 1, 1, 1, 1, 1]
2249-
sage: list(CartanType(["B", 5, 1]).translation_factors()) # needs sage.graphs
2257+
sage: list(CartanType(["B", 5, 1]).translation_factors())
22502258
[1, 1, 1, 1, 1, 2]
2251-
sage: list(CartanType(["C", 5, 1]).translation_factors()) # needs sage.graphs
2259+
sage: list(CartanType(["C", 5, 1]).translation_factors())
22522260
[1, 2, 2, 2, 2, 1]
2253-
sage: list(CartanType(["D", 5, 1]).translation_factors()) # needs sage.graphs
2261+
sage: list(CartanType(["D", 5, 1]).translation_factors())
22542262
[1, 1, 1, 1, 1, 1]
2255-
sage: list(CartanType(["E", 6, 1]).translation_factors()) # needs sage.graphs
2263+
sage: list(CartanType(["E", 6, 1]).translation_factors())
22562264
[1, 1, 1, 1, 1, 1, 1]
2257-
sage: list(CartanType(["E", 7, 1]).translation_factors()) # needs sage.graphs
2265+
sage: list(CartanType(["E", 7, 1]).translation_factors())
22582266
[1, 1, 1, 1, 1, 1, 1, 1]
2259-
sage: list(CartanType(["E", 8, 1]).translation_factors()) # needs sage.graphs
2267+
sage: list(CartanType(["E", 8, 1]).translation_factors())
22602268
[1, 1, 1, 1, 1, 1, 1, 1, 1]
2261-
sage: list(CartanType(["F", 4, 1]).translation_factors()) # needs sage.graphs
2269+
sage: list(CartanType(["F", 4, 1]).translation_factors())
22622270
[1, 1, 1, 2, 2]
2263-
sage: list(CartanType(["G", 2, 1]).translation_factors()) # needs sage.graphs
2271+
sage: list(CartanType(["G", 2, 1]).translation_factors())
22642272
[1, 3, 1]
2265-
sage: list(CartanType(["A", 2, 2]).translation_factors()) # needs sage.graphs
2273+
sage: list(CartanType(["A", 2, 2]).translation_factors())
22662274
[1, 1/2]
2267-
sage: list(CartanType(["A", 2, 2]).dual().translation_factors()) # needs sage.graphs
2275+
sage: list(CartanType(["A", 2, 2]).dual().translation_factors())
22682276
[1/2, 1]
2269-
sage: list(CartanType(["A", 10, 2]).translation_factors()) # needs sage.graphs
2277+
sage: list(CartanType(["A", 10, 2]).translation_factors())
22702278
[1, 1, 1, 1, 1, 1/2]
2271-
sage: list(CartanType(["A", 10, 2]).dual().translation_factors()) # needs sage.graphs
2279+
sage: list(CartanType(["A", 10, 2]).dual().translation_factors())
22722280
[1/2, 1, 1, 1, 1, 1]
2273-
sage: list(CartanType(["A", 9, 2]).translation_factors()) # needs sage.graphs
2281+
sage: list(CartanType(["A", 9, 2]).translation_factors())
22742282
[1, 1, 1, 1, 1, 1]
2275-
sage: list(CartanType(["D", 5, 2]).translation_factors()) # needs sage.graphs
2283+
sage: list(CartanType(["D", 5, 2]).translation_factors())
22762284
[1, 1, 1, 1, 1]
2277-
sage: list(CartanType(["D", 4, 3]).translation_factors()) # needs sage.graphs
2285+
sage: list(CartanType(["D", 4, 3]).translation_factors())
22782286
[1, 1, 1]
2279-
sage: list(CartanType(["E", 6, 2]).translation_factors()) # needs sage.graphs
2287+
sage: list(CartanType(["E", 6, 2]).translation_factors())
22802288
[1, 1, 1, 1, 1]
22812289
22822290
We conclude with a discussion of the appropriate value for
@@ -2312,11 +2320,11 @@ def translation_factors(self):
23122320
23132321
The projections of the simple roots can be read off::
23142322
2315-
sage: alpha[0]
2323+
sage: alpha[0] # needs sage.graphs
23162324
2*Lambda[0] - Lambda[1]
2317-
sage: alpha[1]
2325+
sage: alpha[1] # needs sage.graphs
23182326
-2*Lambda[0] + 2*Lambda[1] - Lambda[2]
2319-
sage: alpha[2]
2327+
sage: alpha[2] # needs sage.graphs
23202328
-2*Lambda[1] + 2*Lambda[2]
23212329
23222330
Namely `\alpha_0 = -\omega_1`, `\alpha_1 = 2\omega_1 -

src/sage/combinat/root_system/coxeter_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=No
114114
115115
TESTS::
116116
117-
sage: W = groups.misc.CoxeterGroup(["H",3])
117+
sage: W = groups.misc.CoxeterGroup(["H",3]) # needs sage.groups
118118
"""
119119
if implementation not in ["permutation", "matrix", "coxeter3", "reflection", "chevie", None]:
120120
raise ValueError("invalid type implementation")

src/sage/combinat/root_system/coxeter_type.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,17 @@ def bilinear_form(self, R=None):
357357
358358
EXAMPLES::
359359
360-
sage: CoxeterType(['A', 2, 1]).bilinear_form() # needs sage.graphs sage.rings.number_field
360+
sage: # needs sage.graphs sage.rings.number_field
361+
sage: CoxeterType(['A', 2, 1]).bilinear_form()
361362
[ 1 -1/2 -1/2]
362363
[-1/2 1 -1/2]
363364
[-1/2 -1/2 1]
364-
sage: CoxeterType(['H', 3]).bilinear_form() # needs sage.graphs sage.rings.number_field
365+
sage: CoxeterType(['H', 3]).bilinear_form()
365366
[ 1 -1/2 0]
366367
[ -1/2 1 1/2*E(5)^2 + 1/2*E(5)^3]
367368
[ 0 1/2*E(5)^2 + 1/2*E(5)^3 1]
368-
sage: C = CoxeterMatrix([[1,-1,-1],[-1,1,-1],[-1,-1,1]]) # needs sage.graphs sage.rings.number_field
369-
sage: C.bilinear_form() # needs sage.graphs sage.rings.number_field
369+
sage: C = CoxeterMatrix([[1,-1,-1],[-1,1,-1],[-1,-1,1]])
370+
sage: C.bilinear_form()
370371
[ 1 -1 -1]
371372
[-1 1 -1]
372373
[-1 -1 1]

src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,14 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors):
411411
412412
sage: def eig(l): return E.eigenvalues(KL0.from_polynomial(NS.E(l)))
413413
414-
sage: eig([1,0,0]) # needs sage.combinat sage.groups
414+
sage: # needs sage.combinat sage.groups
415+
sage: eig([1,0,0])
415416
[t, (-1)/(-q*t^2), t]
416-
sage: eig([2,0,0]) # needs sage.combinat sage.groups
417+
sage: eig([2,0,0])
417418
[q*t, (-1)/(-q^2*t^2), t]
418-
sage: eig([3,0,0]) # needs sage.combinat sage.groups
419+
sage: eig([3,0,0])
419420
[q^2*t, (-1)/(-q^3*t^2), t]
420-
sage: eig([2,0,4]) # needs sage.combinat sage.groups
421+
sage: eig([2,0,4])
421422
[(-1)/(-q^3*t), 1/(q^2*t), q^4*t^2]
422423
423424
Next we check explicitly that they agree with the current implementation::
@@ -1863,16 +1864,17 @@ def symmetric_macdonald_polynomial(self, mu):
18631864
We compare with the type `A` Macdonald polynomials
18641865
coming from symmetric functions::
18651866
1866-
sage: P = SymmetricFunctions(K).macdonald().P() # needs sage.combinat
1867-
sage: g = P[2,1].expand(3); g # needs sage.combinat
1867+
sage: # needs sage.combinat
1868+
sage: P = SymmetricFunctions(K).macdonald().P()
1869+
sage: g = P[2,1].expand(3); g
18681870
x0^2*x1 + x0*x1^2 + x0^2*x2
18691871
+ (2*q*t^2 - q*t - q + t^2 + t - 2)/(q*t^2 - 1)*x0*x1*x2
18701872
+ x1^2*x2 + x0*x2^2 + x1*x2^2
1871-
sage: fe = f.expand(g.parent().gens()); fe # needs sage.combinat
1873+
sage: fe = f.expand(g.parent().gens()); fe
18721874
x0^2*x1 + x0*x1^2 + x0^2*x2
18731875
+ (2*q*v^4 - q*v^2 - q + v^4 + v^2 - 2)/(q*v^4 - 1)*x0*x1*x2
18741876
+ x1^2*x2 + x0*x2^2 + x1*x2^2
1875-
sage: g.map_coefficients(lambda x: x.subs(t=v*v)) == fe # needs sage.combinat
1877+
sage: g.map_coefficients(lambda x: x.subs(t=v*v)) == fe
18761878
True
18771879
18781880
sage: E = NonSymmetricMacdonaldPolynomials(['C',3,1], q, v, -1/v)

src/sage/combinat/root_system/reflection_group_c.pyx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,20 @@ cdef class Iterator():
150150
"""
151151
EXAMPLES::
152152
153+
sage: # optional - gap3
153154
sage: from sage.combinat.root_system.reflection_group_c import Iterator
154-
sage: W = ReflectionGroup(["B", 4]) # optional - gap3
155-
sage: N = W.number_of_reflections() # optional - gap3
156-
sage: I = Iterator(W, N) # optional - gap3
157-
sage: len(list(I)) == W.cardinality() # optional - gap3
155+
sage: W = ReflectionGroup(["B", 4])
156+
sage: N = W.number_of_reflections()
157+
sage: I = Iterator(W, N)
158+
sage: len(list(I)) == W.cardinality()
158159
True
159160
160-
sage: I = Iterator(W, N, "breadth", False) # optional - gap3
161-
sage: len(list(I)) == W.cardinality() # optional - gap3
161+
sage: # optional - gap3
162+
sage: I = Iterator(W, N, "breadth", False)
163+
sage: len(list(I)) == W.cardinality()
162164
True
163-
sage: I = Iterator(W, N, "parabolic") # optional - gap3
164-
sage: len(list(I)) == W.cardinality() # optional - gap3
165+
sage: I = Iterator(W, N, "parabolic")
166+
sage: len(list(I)) == W.cardinality()
165167
True
166168
"""
167169
# the breadth search iterator is ~2x slower as it

0 commit comments

Comments
 (0)