Skip to content

Commit 8f2ab5d

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

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

src/sage/combinat/root_system/root_system.py

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RootSystem(UniqueRepresentation, SageObject):
3333
3434
We construct the root system for type `B_3`::
3535
36-
sage: R=RootSystem(['B',3]); R
36+
sage: R = RootSystem(['B',3]); R
3737
Root system of type ['B', 3]
3838
3939
``R`` models the root system abstractly. It comes equipped with various
@@ -156,7 +156,7 @@ class RootSystem(UniqueRepresentation, SageObject):
156156
In finite type `A`, we recover the natural representation of the
157157
symmetric group as group of permutation matrices::
158158
159-
sage: RootSystem(["A",2]).ambient_space().weyl_group().simple_reflections()
159+
sage: RootSystem(["A",2]).ambient_space().weyl_group().simple_reflections() # optional - sage.libs.pari
160160
Finite family {1: [0 1 0]
161161
[1 0 0]
162162
[0 0 1],
@@ -167,7 +167,7 @@ class RootSystem(UniqueRepresentation, SageObject):
167167
In type `B`, `C`, and `D`, we recover the natural representation
168168
of the Weyl group as groups of signed permutation matrices::
169169
170-
sage: RootSystem(["B",3]).ambient_space().weyl_group().simple_reflections()
170+
sage: RootSystem(["B",3]).ambient_space().weyl_group().simple_reflections() # optional - sage.libs.pari
171171
Finite family {1: [0 1 0]
172172
[1 0 0]
173173
[0 0 1],
@@ -187,29 +187,29 @@ class RootSystem(UniqueRepresentation, SageObject):
187187
188188
Define the "identity" by an appropriate vector at level `-3`::
189189
190-
sage: e = L.basis(); Lambda = L.fundamental_weights()
191-
sage: id = e[0] + 2*e[1] + 3*e[2] - 3*Lambda[0]
190+
sage: e = L.basis(); Lambda = L.fundamental_weights() # optional - sage.graphs
191+
sage: id = e[0] + 2*e[1] + 3*e[2] - 3*Lambda[0] # optional - sage.graphs
192192
193193
The corresponding permutation is obtained by projecting it onto
194194
the classical ambient space::
195195
196196
sage: L.classical()
197197
Ambient space of the Root system of type ['A', 2]
198-
sage: L.classical()(id)
198+
sage: L.classical()(id) # optional - sage.graphs
199199
(1, 2, 3)
200200
201201
Here is the orbit of the identity under the action of the finite
202202
group::
203203
204-
sage: W = L.weyl_group()
205-
sage: S3 = [ w.action(id) for w in W.classical() ]
206-
sage: [L.classical()(x) for x in S3]
204+
sage: W = L.weyl_group() # optional - sage.libs.pari
205+
sage: S3 = [ w.action(id) for w in W.classical() ] # optional - sage.libs.pari
206+
sage: [L.classical()(x) for x in S3] # optional - sage.libs.pari
207207
[(1, 2, 3), (3, 1, 2), (2, 3, 1), (2, 1, 3), (1, 3, 2), (3, 2, 1)]
208208
209209
And the action of `s_0` on these yields::
210210
211-
sage: s = W.simple_reflections()
212-
sage: [L.classical()(s[0].action(x)) for x in S3]
211+
sage: s = W.simple_reflections() # optional - sage.libs.pari
212+
sage: [L.classical()(s[0].action(x)) for x in S3] # optional - sage.libs.pari
213213
[(0, 2, 4), (-1, 1, 6), (-2, 3, 5), (0, 1, 5), (-1, 3, 4), (-2, 2, 6)]
214214
215215
We can also plot various components of the ambient spaces::
@@ -263,11 +263,11 @@ class RootSystem(UniqueRepresentation, SageObject):
263263
TESTS::
264264
265265
sage: R = RootSystem(['C',3])
266-
sage: TestSuite(R).run()
266+
sage: TestSuite(R).run() # optional - sage.graphs
267267
sage: L = R.ambient_space()
268268
sage: s = L.simple_reflections() # this used to break the testsuite below due to caching an unpicklable method
269269
sage: s = L.simple_projections() # todo: not implemented
270-
sage: TestSuite(L).run()
270+
sage: TestSuite(L).run() # optional - sage.graphs
271271
sage: L = R.root_space()
272272
sage: s = L.simple_reflections()
273273
sage: TestSuite(L).run()
@@ -342,7 +342,7 @@ def _test_root_lattice_realizations(self, **options):
342342
343343
EXAMPLES::
344344
345-
sage: RootSystem(["A",3])._test_root_lattice_realizations()
345+
sage: RootSystem(["A",3])._test_root_lattice_realizations() # optional - sage.graphs
346346
347347
.. SEEALSO:: :class:`TestSuite`.
348348
"""
@@ -376,7 +376,7 @@ def _repr_(self):
376376

377377
def cartan_type(self):
378378
"""
379-
Returns the Cartan type of the root system.
379+
Return the Cartan type of the root system.
380380
381381
EXAMPLES::
382382
@@ -389,7 +389,7 @@ def cartan_type(self):
389389
@cached_method
390390
def dynkin_diagram(self):
391391
"""
392-
Returns the Dynkin diagram of the root system.
392+
Return the Dynkin diagram of the root system.
393393
394394
EXAMPLES::
395395
@@ -406,7 +406,7 @@ def cartan_matrix(self):
406406
"""
407407
EXAMPLES::
408408
409-
sage: RootSystem(['A',3]).cartan_matrix()
409+
sage: RootSystem(['A',3]).cartan_matrix() # optional - sage.graphs
410410
[ 2 -1 0]
411411
[-1 2 -1]
412412
[ 0 -1 2]
@@ -426,7 +426,7 @@ def index_set(self):
426426
@cached_method
427427
def is_finite(self):
428428
"""
429-
Returns True if self is a finite root system.
429+
Return ``True`` if ``self`` is a finite root system.
430430
431431
EXAMPLES::
432432
@@ -440,7 +440,7 @@ def is_finite(self):
440440
@cached_method
441441
def is_irreducible(self):
442442
"""
443-
Returns True if self is an irreducible root system.
443+
Return ``True`` if ``self`` is an irreducible root system.
444444
445445
EXAMPLES::
446446
@@ -453,7 +453,7 @@ def is_irreducible(self):
453453

454454
def root_lattice(self):
455455
"""
456-
Returns the root lattice associated to self.
456+
Return the root lattice associated to ``self``.
457457
458458
EXAMPLES::
459459
@@ -532,7 +532,7 @@ def coroot_space(self, base_ring=QQ):
532532
@cached_method
533533
def weight_lattice(self, extended=False):
534534
"""
535-
Returns the weight lattice associated to self.
535+
Return the weight lattice associated to ``self``.
536536
537537
.. SEEALSO::
538538
@@ -545,15 +545,16 @@ def weight_lattice(self, extended=False):
545545
sage: RootSystem(['A',3]).weight_lattice()
546546
Weight lattice of the Root system of type ['A', 3]
547547
548-
sage: RootSystem(['A',3,1]).weight_space(extended = True)
549-
Extended weight space over the Rational Field of the Root system of type ['A', 3, 1]
548+
sage: RootSystem(['A',3,1]).weight_space(extended=True)
549+
Extended weight space over the Rational Field
550+
of the Root system of type ['A', 3, 1]
550551
"""
551552
return WeightSpace(self, ZZ, extended=extended)
552553

553554
@cached_method
554555
def weight_space(self, base_ring=QQ, extended=False):
555556
"""
556-
Returns the weight space associated to self.
557+
Returns the weight space associated to ``self``.
557558
558559
.. SEEALSO::
559560
@@ -566,14 +567,15 @@ def weight_space(self, base_ring=QQ, extended=False):
566567
sage: RootSystem(['A',3]).weight_space()
567568
Weight space over the Rational Field of the Root system of type ['A', 3]
568569
569-
sage: RootSystem(['A',3,1]).weight_space(extended = True)
570-
Extended weight space over the Rational Field of the Root system of type ['A', 3, 1]
570+
sage: RootSystem(['A',3,1]).weight_space(extended=True)
571+
Extended weight space over the Rational Field
572+
of the Root system of type ['A', 3, 1]
571573
"""
572574
return WeightSpace(self, base_ring, extended=extended)
573575

574576
def coweight_lattice(self, extended=False):
575577
"""
576-
Returns the coweight lattice associated to self.
578+
Return the coweight lattice associated to ``self``.
577579
578580
This is the weight lattice of the dual root system.
579581
@@ -588,14 +590,14 @@ def coweight_lattice(self, extended=False):
588590
sage: RootSystem(['A',3]).coweight_lattice()
589591
Coweight lattice of the Root system of type ['A', 3]
590592
591-
sage: RootSystem(['A',3,1]).coweight_lattice(extended = True)
593+
sage: RootSystem(['A',3,1]).coweight_lattice(extended=True)
592594
Extended coweight lattice of the Root system of type ['A', 3, 1]
593595
"""
594596
return self.dual.weight_lattice(extended=extended)
595597

596598
def coweight_space(self, base_ring=QQ, extended=False):
597599
"""
598-
Returns the coweight space associated to self.
600+
Return the coweight space associated to ``self``.
599601
600602
This is the weight space of the dual root system.
601603
@@ -611,7 +613,8 @@ def coweight_space(self, base_ring=QQ, extended=False):
611613
Coweight space over the Rational Field of the Root system of type ['A', 3]
612614
613615
sage: RootSystem(['A',3,1]).coweight_space(extended=True)
614-
Extended coweight space over the Rational Field of the Root system of type ['A', 3, 1]
616+
Extended coweight space over the Rational Field
617+
of the Root system of type ['A', 3, 1]
615618
"""
616619
return self.dual.weight_space(base_ring, extended=extended)
617620

@@ -719,7 +722,7 @@ def ambient_space(self, base_ring=QQ):
719722
An alternative base ring can be provided as an option::
720723
721724
sage: e = RootSystem(['B',3]).ambient_space(RR)
722-
sage: TestSuite(e).run()
725+
sage: TestSuite(e).run() # optional - sage.graphs
723726
724727
It should contain the smallest ring over which the ambient
725728
space can be defined (`\ZZ` in type `A` or `\QQ` otherwise).
@@ -732,7 +735,7 @@ def ambient_space(self, base_ring=QQ):
732735
you are welcome to experiment::
733736
734737
sage: e = RootSystem(['G',2]).ambient_space(RR)
735-
sage: TestSuite(e).run()
738+
sage: TestSuite(e).run() # optional - sage.graphs
736739
Failure in _test_root_lattice_realization:
737740
Traceback (most recent call last):
738741
...
@@ -786,9 +789,9 @@ def WeylDim(ct, coeffs):
786789
INPUT:
787790
788791
789-
- ``type`` - a Cartan type
792+
- ``ct`` -- a Cartan type
790793
791-
- ``coeffs`` - a list of nonnegative integers
794+
- ``coeffs`` -- a list of nonnegative integers
792795
793796
794797
The length of the list must equal the rank type[1]. A dominant
@@ -801,17 +804,20 @@ def WeylDim(ct, coeffs):
801804
802805
For `SO(7)`, the Cartan type is `B_3`, so::
803806
804-
sage: WeylDim(['B',3],[1,0,0]) # standard representation of SO(7)
807+
sage: WeylDim(['B',3],[1,0,0]) # standard representation of SO(7)
805808
7
806-
sage: WeylDim(['B',3],[0,1,0]) # exterior square
809+
sage: WeylDim(['B',3],[0,1,0]) # exterior square
807810
21
808-
sage: WeylDim(['B',3],[0,0,1]) # spin representation of spin(7)
811+
sage: WeylDim(['B',3],[0,0,1]) # spin representation of spin(7)
809812
8
810-
sage: WeylDim(['B',3],[1,0,1]) # sum of the first and third fundamental weights
813+
sage: WeylDim(['B',3],[1,0,1]) # sum of the first and third fundamental weights
811814
48
812815
sage: [WeylDim(['F',4],x) for x in ([1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1])]
813816
[52, 1274, 273, 26]
814-
sage: [WeylDim(['E', 6], x) for x in ([0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 2], [0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1], [2, 0, 0, 0, 0, 0])]
817+
sage: [WeylDim(['E', 6], x)
818+
....: for x in ([0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1],
819+
....: [0, 0, 0, 0, 0, 2], [0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0],
820+
....: [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1], [2, 0, 0, 0, 0, 0])]
815821
[1, 78, 27, 351, 351, 351, 27, 650, 351]
816822
"""
817823
ct = CartanType(ct)

0 commit comments

Comments
 (0)