Skip to content

Commit 3300fb6

Browse files
author
Matthias Koeppe
committed
src/sage/combinat/root_system: Add # optional
1 parent 8f2ab5d commit 3300fb6

File tree

12 files changed

+108
-93
lines changed

12 files changed

+108
-93
lines changed

src/sage/combinat/root_system/type_A.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
2222
sage: R = RootSystem(["A",3])
2323
sage: e = R.ambient_space(); e
2424
Ambient space of the Root system of type ['A', 3]
25-
sage: TestSuite(e).run()
25+
sage: TestSuite(e).run() # optional - sage.graphs
2626
2727
By default, this ambient space uses the barycentric projection for plotting::
2828

src/sage/combinat/root_system/type_C.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
3131
3232
TESTS::
3333
34-
sage: TestSuite(e).run()
34+
sage: TestSuite(e).run() # optional - sage.graphs
3535
"""
3636

3737
def dimension(self):

src/sage/combinat/root_system/type_F.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, root_system, base_ring):
3737
3838
TESTS::
3939
40-
sage: TestSuite(e).run()
40+
sage: TestSuite(e).run() # optional - sage.graphs
4141
"""
4242
ambient_space.AmbientSpace.__init__(self, root_system, base_ring)
4343
v = ZZ(1)/ZZ(2)

src/sage/combinat/root_system/type_affine.py

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AmbientSpace(CombinatorialFreeModule):
3737
In type `BC`, the null root is in fact::
3838
3939
sage: R = RootSystem(["BC",3,2]).ambient_space()
40-
sage: R.null_root()
40+
sage: R.null_root() # optional - sage.graphs
4141
2*e['delta']
4242
4343
.. WARNING::
@@ -54,16 +54,16 @@ class AmbientSpace(CombinatorialFreeModule):
5454
are identified::
5555
5656
sage: L = RootSystem(["A",3,1]).ambient_space()
57-
sage: Lambda = L.fundamental_weights()
58-
sage: Lambda[0]
57+
sage: Lambda = L.fundamental_weights() # optional - sage.graphs
58+
sage: Lambda[0] # optional - sage.graphs
5959
e['deltacheck']
60-
sage: L.null_coroot()
60+
sage: L.null_coroot() # optional - sage.graphs
6161
e['deltacheck']
6262
6363
Therefore the scalar product of the null coroot with itself
6464
differs from the larger ambient space::
6565
66-
sage: L.null_coroot().scalar(L.null_coroot())
66+
sage: L.null_coroot().scalar(L.null_coroot()) # optional - sage.graphs
6767
1
6868
6969
In general, scalar products between two elements that do not
@@ -108,7 +108,7 @@ class AmbientSpace(CombinatorialFreeModule):
108108
109109
TESTS::
110110
111-
sage: Lambda[1]
111+
sage: Lambda[1] # optional - sage.graphs
112112
e[0] + e['deltacheck']
113113
"""
114114
@classmethod
@@ -247,36 +247,43 @@ def fundamental_weight(self, i):
247247
248248
EXAMPLES::
249249
250-
sage: RootSystem(['A',3,1]).ambient_space().fundamental_weight(2)
250+
sage: RootSystem(['A',3,1]).ambient_space().fundamental_weight(2) # optional - sage.graphs
251251
e[0] + e[1] + e['deltacheck']
252-
sage: RootSystem(['A',3,1]).ambient_space().fundamental_weights()
253-
Finite family {0: e['deltacheck'], 1: e[0] + e['deltacheck'],
254-
2: e[0] + e[1] + e['deltacheck'], 3: e[0] + e[1] + e[2] + e['deltacheck']}
252+
sage: RootSystem(['A',3,1]).ambient_space().fundamental_weights() # optional - sage.graphs
253+
Finite family {0: e['deltacheck'],
254+
1: e[0] + e['deltacheck'],
255+
2: e[0] + e[1] + e['deltacheck'],
256+
3: e[0] + e[1] + e[2] + e['deltacheck']}
255257
sage: RootSystem(['A',3]).ambient_space().fundamental_weights()
256258
Finite family {1: (1, 0, 0, 0), 2: (1, 1, 0, 0), 3: (1, 1, 1, 0)}
257-
sage: RootSystem(['A',3,1]).weight_lattice().fundamental_weights().map(attrcall("level"))
259+
sage: A31wl = RootSystem(['A',3,1]).weight_lattice()
260+
sage: A31wl.fundamental_weights().map(attrcall("level")) # optional - sage.graphs
258261
Finite family {0: 1, 1: 1, 2: 1, 3: 1}
259262
260-
sage: RootSystem(['B',3,1]).ambient_space().fundamental_weights()
261-
Finite family {0: e['deltacheck'], 1: e[0] + e['deltacheck'],
262-
2: e[0] + e[1] + 2*e['deltacheck'], 3: 1/2*e[0] + 1/2*e[1] + 1/2*e[2] + e['deltacheck']}
263+
sage: RootSystem(['B',3,1]).ambient_space().fundamental_weights() # optional - sage.graphs
264+
Finite family {0: e['deltacheck'],
265+
1: e[0] + e['deltacheck'],
266+
2: e[0] + e[1] + 2*e['deltacheck'],
267+
3: 1/2*e[0] + 1/2*e[1] + 1/2*e[2] + e['deltacheck']}
263268
sage: RootSystem(['B',3]).ambient_space().fundamental_weights()
264269
Finite family {1: (1, 0, 0), 2: (1, 1, 0), 3: (1/2, 1/2, 1/2)}
265-
sage: RootSystem(['B',3,1]).weight_lattice().fundamental_weights().map(attrcall("level"))
270+
sage: B31wl = RootSystem(['B',3,1]).weight_lattice().
271+
sage: B31wlfundamental_weights().map(attrcall("level")) # optional - sage.graphs
266272
Finite family {0: 1, 1: 1, 2: 2, 3: 1}
267273
268274
In type `BC` dual, the coefficient of '\delta^\vee' is the level
269275
divided by `2` to take into account that the null coroot is
270276
`2\delta^\vee`::
271277
272278
sage: R = CartanType(['BC',3,2]).dual().root_system()
273-
sage: R.ambient_space().fundamental_weights()
274-
Finite family {0: e['deltacheck'], 1: e[0] + e['deltacheck'],
279+
sage: R.ambient_space().fundamental_weights() # optional - sage.graphs
280+
Finite family {0: e['deltacheck'],
281+
1: e[0] + e['deltacheck'],
275282
2: e[0] + e[1] + e['deltacheck'],
276283
3: 1/2*e[0] + 1/2*e[1] + 1/2*e[2] + 1/2*e['deltacheck']}
277-
sage: R.weight_lattice().fundamental_weights().map(attrcall("level"))
284+
sage: R.weight_lattice().fundamental_weights().map(attrcall("level")) # optional - sage.graphs
278285
Finite family {0: 2, 1: 2, 2: 2, 3: 1}
279-
sage: R.ambient_space().null_coroot()
286+
sage: R.ambient_space().null_coroot() # optional - sage.graphs
280287
2*e['deltacheck']
281288
282289
By a slight naming abuse this function also accepts "delta" as
@@ -314,22 +321,26 @@ def simple_root(self, i):
314321
315322
sage: RootSystem(["A",3]).ambient_space().simple_roots()
316323
Finite family {1: (1, -1, 0, 0), 2: (0, 1, -1, 0), 3: (0, 0, 1, -1)}
317-
sage: RootSystem(["A",3,1]).ambient_space().simple_roots()
318-
Finite family {0: -e[0] + e[3] + e['delta'], 1: e[0] - e[1], 2: e[1] - e[2], 3: e[2] - e[3]}
324+
sage: RootSystem(["A",3,1]).ambient_space().simple_roots() # optional - sage.graphs
325+
Finite family {0: -e[0] + e[3] + e['delta'], 1: e[0] - e[1],
326+
2: e[1] - e[2], 3: e[2] - e[3]}
319327
320328
Here is a twisted affine example::
321329
322-
sage: RootSystem(CartanType(["B",3,1]).dual()).ambient_space().simple_roots()
323-
Finite family {0: -e[0] - e[1] + e['delta'], 1: e[0] - e[1], 2: e[1] - e[2], 3: 2*e[2]}
330+
sage: B31ᵛ = RootSystem(CartanType(["B",3,1]).dual())
331+
sage: B31ᵛ.ambient_space().simple_roots() # optional - sage.graphs
332+
Finite family {0: -e[0] - e[1] + e['delta'], 1: e[0] - e[1],
333+
2: e[1] - e[2], 3: 2*e[2]}
324334
325335
In fact `\delta` is really `1/a_0` times the null root (see
326336
the discussion in :class:`~sage.combinat.root_system.weight_space.WeightSpace`)
327337
but this only makes a difference in type `BC`::
328338
329339
sage: L = RootSystem(CartanType(["BC",3,2])).ambient_space()
330-
sage: L.simple_roots()
331-
Finite family {0: -e[0] + e['delta'], 1: e[0] - e[1], 2: e[1] - e[2], 3: 2*e[2]}
332-
sage: L.null_root()
340+
sage: L.simple_roots() # optional - sage.graphs
341+
Finite family {0: -e[0] + e['delta'], 1: e[0] - e[1],
342+
2: e[1] - e[2], 3: 2*e[2]}
343+
sage: L.null_root() # optional - sage.graphs
333344
2*e['delta']
334345
335346
.. NOTE::
@@ -367,10 +378,12 @@ def simple_coroot(self, i):
367378
It is built as the coroot associated to the simple root
368379
`\alpha_i`::
369380
370-
sage: RootSystem(["B",3,1]).ambient_space().simple_roots()
371-
Finite family {0: -e[0] - e[1] + e['delta'], 1: e[0] - e[1], 2: e[1] - e[2], 3: e[2]}
372-
sage: RootSystem(["B",3,1]).ambient_space().simple_coroots()
373-
Finite family {0: -e[0] - e[1] + e['deltacheck'], 1: e[0] - e[1], 2: e[1] - e[2], 3: 2*e[2]}
381+
sage: RootSystem(["B",3,1]).ambient_space().simple_roots() # optional - sage.graphs
382+
Finite family {0: -e[0] - e[1] + e['delta'], 1: e[0] - e[1],
383+
2: e[1] - e[2], 3: e[2]}
384+
sage: RootSystem(["B",3,1]).ambient_space().simple_coroots() # optional - sage.graphs
385+
Finite family {0: -e[0] - e[1] + e['deltacheck'], 1: e[0] - e[1],
386+
2: e[1] - e[2], 3: 2*e[2]}
374387
375388
.. TODO:: Factor out this code with the classical ambient space.
376389
"""
@@ -475,14 +488,14 @@ def associated_coroot(self):
475488
476489
EXAMPLES::
477490
478-
sage: alpha = RootSystem(['C',2,1]).ambient_space().simple_roots()
479-
sage: alpha
491+
sage: alpha = RootSystem(['C',2,1]).ambient_space().simple_roots() # optional - sage.graphs
492+
sage: alpha # optional - sage.graphs
480493
Finite family {0: -2*e[0] + e['delta'], 1: e[0] - e[1], 2: 2*e[1]}
481-
sage: alpha[0].associated_coroot()
494+
sage: alpha[0].associated_coroot() # optional - sage.graphs
482495
-e[0] + e['deltacheck']
483-
sage: alpha[1].associated_coroot()
496+
sage: alpha[1].associated_coroot() # optional - sage.graphs
484497
e[0] - e[1]
485-
sage: alpha[2].associated_coroot()
498+
sage: alpha[2].associated_coroot() # optional - sage.graphs
486499
e[1]
487500
"""
488501
# CHECKME: does it make any sense to not rescale the delta term?

src/sage/combinat/root_system/type_dual.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
379379
sage: ct = sage.combinat.root_system.type_dual.CartanType(CartanType(['F',4]))
380380
sage: L = ct.root_system().ambient_space(); L
381381
Ambient space of the Root system of type ['F', 4]^*
382-
sage: TestSuite(L).run(skip=["_test_elements","_test_pickling"])
382+
sage: TestSuite(L).run(skip=["_test_elements","_test_pickling"]) # optional - sage.graphs
383383
"""
384384

385385
@lazy_attribute
@@ -472,7 +472,7 @@ def fundamental_weights(self):
472472
473473
sage: ct = sage.combinat.root_system.type_dual.CartanType(CartanType(['F',4]))
474474
sage: L = ct.root_system().ambient_space()
475-
sage: L.fundamental_weights()
475+
sage: L.fundamental_weights() # optional - sage.graphs
476476
Finite family {1: (1, 1, 0, 0), 2: (2, 1, 1, 0), 3: (3, 1, 1, 1), 4: (2, 0, 0, 0)}
477477
478478
Note that this ambient space is isomorphic, but not equal, to

src/sage/combinat/root_system/type_folded.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class CartanTypeFolded(UniqueRepresentation, SageObject):
116116
117117
sage: fct = CartanType(['C',4,1]).as_folding(); fct
118118
['C', 4, 1] as a folding of ['A', 7, 1]
119-
sage: fct.scaling_factors()
119+
sage: fct.scaling_factors() # optional - sage.graphs
120120
Finite family {0: 2, 1: 1, 2: 1, 3: 1, 4: 2}
121121
sage: fct.folding_orbit()
122122
Finite family {0: (0,), 1: (1, 7), 2: (2, 6), 3: (3, 5), 4: (4,)}
@@ -126,7 +126,7 @@ class CartanTypeFolded(UniqueRepresentation, SageObject):
126126
127127
sage: fct = CartanType(['A',4,1]).as_folding(); fct
128128
['A', 4, 1] as a folding of ['A', 4, 1]
129-
sage: fct.scaling_factors()
129+
sage: fct.scaling_factors() # optional - sage.graphs
130130
Finite family {0: 1, 1: 1, 2: 1, 3: 1, 4: 1}
131131
sage: fct.folding_orbit()
132132
Finite family {0: (0,), 1: (1,), 2: (2,), 3: (3,), 4: (4,)}
@@ -271,15 +271,15 @@ def scaling_factors(self):
271271
EXAMPLES::
272272
273273
sage: fct = CartanType(['C', 4, 1]).as_folding()
274-
sage: fct.scaling_factors()
274+
sage: fct.scaling_factors() # optional - sage.graphs
275275
Finite family {0: 2, 1: 1, 2: 1, 3: 1, 4: 2}
276276
sage: fct = CartanType(['BC', 4, 2]).as_folding()
277-
sage: fct.scaling_factors()
277+
sage: fct.scaling_factors() # optional - sage.graphs
278278
Finite family {0: 1, 1: 1, 2: 1, 3: 1, 4: 2}
279279
sage: fct = CartanType(['BC', 4, 2]).dual().as_folding()
280-
sage: fct.scaling_factors()
280+
sage: fct.scaling_factors() # optional - sage.graphs
281281
Finite family {0: 2, 1: 1, 2: 1, 3: 1, 4: 1}
282-
sage: CartanType(['BC', 4, 2]).relabel({0:4, 1:3, 2:2, 3:1, 4:0}).as_folding().scaling_factors()
282+
sage: CartanType(['BC', 4, 2]).relabel({0:4, 1:3, 2:2, 3:1, 4:0}).as_folding().scaling_factors() # optional - sage.graphs
283283
Finite family {0: 2, 1: 1, 2: 1, 3: 1, 4: 1}
284284
"""
285285
if self._cartan_type.is_finite():

src/sage/combinat/root_system/type_marked.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ def _repr_(self, compact=False):
166166
1 2
167167
A2 with node 1 marked
168168
169-
sage: CM = CartanMatrix([[2,-4],[-5,2]])
170-
sage: CM.marked_nodes([1])
169+
sage: CM = CartanMatrix([[2,-4],[-5,2]]) # optional - sage.graphs
170+
sage: CM.marked_nodes([1]) # optional - sage.graphs
171171
[ 2 -4]
172172
[-5 2] with node 1 marked
173173
"""
@@ -425,7 +425,7 @@ def _default_folded_cartan_type(self):
425425
Finite family {0: (0,), 1: (2,), 2: (1, 3, 4)}
426426
sage: CartanType(['G',2,1]).dual()._default_folded_cartan_type().folding_orbit()
427427
Finite family {0: (0,), 1: (1, 3, 4), 2: (2,)}
428-
sage: CartanType(['C',3,1]).relabel({0:1, 1:0, 2:3, 3:2}).as_folding().scaling_factors()
428+
sage: CartanType(['C',3,1]).relabel({0:1, 1:0, 2:3, 3:2}).as_folding().scaling_factors() # optional - sage.graphs
429429
Finite family {0: 1, 1: 2, 2: 2, 3: 1}
430430
"""
431431
from sage.combinat.root_system.type_folded import CartanTypeFolded
@@ -461,7 +461,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
461461
462462
sage: L = CartanType(["F",4]).marked_nodes([1,3]).root_system().ambient_space(); L
463463
Ambient space of the Root system of type ['F', 4] with nodes (1, 3) marked
464-
sage: TestSuite(L).run()
464+
sage: TestSuite(L).run() # optional - sage.graphs
465465
"""
466466
@lazy_attribute
467467
def _space(self):

src/sage/combinat/root_system/type_reducible.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,18 @@ def cartan_matrix(self, subdivide=True):
256256
EXAMPLES::
257257
258258
sage: ct = CartanType("A2","B2")
259-
sage: ct.cartan_matrix()
259+
sage: ct.cartan_matrix() # optional - sage.graphs
260260
[ 2 -1| 0 0]
261261
[-1 2| 0 0]
262262
[-----+-----]
263263
[ 0 0| 2 -1]
264264
[ 0 0|-2 2]
265-
sage: ct.cartan_matrix(subdivide=False)
265+
sage: ct.cartan_matrix(subdivide=False) # optional - sage.graphs
266266
[ 2 -1 0 0]
267267
[-1 2 0 0]
268268
[ 0 0 2 -1]
269269
[ 0 0 -2 2]
270-
sage: ct.index_set() == ct.cartan_matrix().index_set()
270+
sage: ct.index_set() == ct.cartan_matrix().index_set() # optional - sage.graphs
271271
True
272272
"""
273273
from sage.combinat.root_system.cartan_matrix import CartanMatrix

src/sage/combinat/root_system/type_relabel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@ def __init__(self, type, relabelling):
149149
Check for the original issues of :trac:`13724`::
150150
151151
sage: A3 = CartanType("A3")
152-
sage: A3.cartan_matrix()
152+
sage: A3.cartan_matrix() # optional - sage.graphs
153153
[ 2 -1 0]
154154
[-1 2 -1]
155155
[ 0 -1 2]
156156
sage: A3r = A3.relabel({1:2,2:3,3:1})
157-
sage: A3r.cartan_matrix()
157+
sage: A3r.cartan_matrix() # optional - sage.graphs
158158
[ 2 0 -1]
159159
[ 0 2 -1]
160160
[-1 -1 2]
161161
162162
sage: ct = CartanType(["D",4,3]).classical(); ct
163163
['G', 2]
164-
sage: ct.symmetrizer()
164+
sage: ct.symmetrizer() # optional - sage.graphs
165165
Finite family {1: 1, 2: 3}
166166
167167
Check the underlying issue of :trac:`24892`, that the root system
@@ -384,7 +384,7 @@ def _default_folded_cartan_type(self):
384384
Finite family {0: (0,), 1: (2,), 2: (1, 3, 4)}
385385
sage: CartanType(['G',2,1]).dual()._default_folded_cartan_type().folding_orbit()
386386
Finite family {0: (0,), 1: (1, 3, 4), 2: (2,)}
387-
sage: CartanType(['C',3,1]).relabel({0:1, 1:0, 2:3, 3:2}).as_folding().scaling_factors()
387+
sage: CartanType(['C',3,1]).relabel({0:1, 1:0, 2:3, 3:2}).as_folding().scaling_factors() # optional - sage.graphs
388388
Finite family {0: 1, 1: 2, 2: 2, 3: 1}
389389
"""
390390
from sage.combinat.root_system.type_folded import CartanTypeFolded
@@ -436,7 +436,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
436436
sage: cycle = {1:2, 2:3, 3:4, 4:1}
437437
sage: L = CartanType(["F",4]).relabel(cycle).root_system().ambient_space(); L
438438
Ambient space of the Root system of type ['F', 4] relabelled by {1: 2, 2: 3, 3: 4, 4: 1}
439-
sage: TestSuite(L).run()
439+
sage: TestSuite(L).run() # optional - sage.graphs
440440
"""
441441

442442
@lazy_attribute

0 commit comments

Comments
 (0)