INPUT:
The edge multiplicities are encoded as edge labels. This uses the convention in Kac / Fulton Harris Representation theory wikipedia http://en.wikipedia.org/wiki/Dynkin_diagram, that is for i != j:
j --k--> i <==> a_ij = -k
<==> -scalar(coroot[i], root[j]) = k
<==> multiple arrows point from the longer root
to the shorter one
TODO: say something about the node labelling conventions.
EXAMPLES:
sage: DynkinDiagram(['A', 4])
O---O---O---O
1 2 3 4
A4
sage: DynkinDiagram(['A',1],['A',1])
O
1
O
2
A1xA1
sage: R = RootSystem("A2xB2xF4")
sage: DynkinDiagram(R)
O---O
1 2
O=>=O
3 4
O---O=>=O---O
5 6 7 8
A2xB2xF4
With a tuple (i,j) as argument, returns the scalar product `langle
alpha^vee_i, alpha_jrangle`.
Otherwise, behaves as the usual DiGraph.__getitem__
EXAMPLES: We use the dynkin diagram as a cartan
matrix:
sage: g = DynkinDiagram(['C',4])
sage: matrix([[g[i,j] for j in range(1,5)] for i in range(1,5)])
[ 2 -1 0 0]
[-1 2 -1 0]
[ 0 -1 2 -2]
[ 0 0 -1 2]
The neighbors of a node can still be obtained in the usual way:
sage: [g[i] for i in range(1,5)]
[[2], [1, 3], [2, 4], [3]]
EXAMPLES:
sage: d = DynkinDiagram(["A", 3])
sage: d == loads(dumps(d))
True
EXAMPLES:
sage: DynkinDiagram(['G',2])
3
O=<=O
1 2
G2
EXAMPLES:
sage: from sage.combinat.root_system.dynkin_diagram import DynkinDiagram_class
sage: d = DynkinDiagram_class(CartanType(['A',3]))
sage: list(sorted(d.edges()))
[]
sage: d.add_edge(2, 3)
sage: list(sorted(d.edges()))
[(2, 3, 1), (3, 2, 1)]
returns the Cartan matrix for this Dynkin diagram
EXAMPLES:
sage: DynkinDiagram(['C',3]).cartan_matrix()
[ 2 -1 0]
[-1 2 -2]
[ 0 -1 2]
EXAMPLES:
sage: DynkinDiagram("A2","B2","F4").cartan_type()
A2xB2xF4
Returns the column
of the
Cartan matrix corresponding to this Dynkin diagram, as a container
(or iterator) of tuples
EXAMPLES:
sage: g = DynkinDiagram(["B",4])
sage: [ (i,a) for (i,a) in g.column(3) ]
[(3, 2), (2, -1), (4, -2)]
Returns the dual Dynkin diagram, obtained by reversing all edges.
EXAMPLES:
sage: D = DynkinDiagram(['C',3])
sage: D.edges()
[(1, 2, 1), (2, 1, 1), (2, 3, 1), (3, 2, 2)]
sage: D.dual()
O---O=>=O
1 2 3
B3
sage: D.dual().edges()
[(1, 2, 1), (2, 1, 1), (2, 3, 2), (3, 2, 1)]
sage: D.dual() == DynkinDiagram(['B',3])
True
TESTS:
sage: D = DynkinDiagram(['A',0]); D
Dynkin diagram of type ['A', 0]
sage: D.edges()
[]
sage: D.dual()
Dynkin diagram of type ['A', 0]
sage: D.dual().edges()
[]
sage: D = DynkinDiagram(['A',1])
sage: D.edges()
[]
sage: D.dual()
O
1
A1
sage: D.dual().edges()
[]
EXAMPLES:
sage: DynkinDiagram(['C',3]).dynkin_diagram()
O---O=<=O
1 2 3
C3
EXAMPLES:
sage: DynkinDiagram(['C',3]).index_set()
[1, 2, 3]
sage: DynkinDiagram("A2","B2","F4").index_set()
[1, 2, 3, 4, 5, 6, 7, 8]
Returns the index set for this Dynkin diagram
EXAMPLES:
sage: DynkinDiagram(['C',3]).rank()
3
sage: DynkinDiagram("A2","B2","F4").rank()
8
Returns the row
of the
Cartan matrix corresponding to this Dynkin diagram, as a container
(or iterator) of tuples
EXAMPLES:
sage: g = DynkinDiagram(["C",4])
sage: [ (i,a) for (i,a) in g.row(3) ]
[(3, 2), (2, -1), (4, -2)]
Returns the Dynkin diagram of type t.
Note that this function is deprecated, and that you should use DynkinDiagram instead as this will be disappearing in the near future.
EXAMPLES:
sage: dynkin_diagram(["A", 3])
doctest:1: DeprecationWarning: dynkin_diagram is deprecated, use DynkinDiagram instead!
O---O---O
1 2 3
A3
Returns ascii art representing a Dynkin diagram of a finite Cartan type. Accessed through the __repr__ method of DynkinDiagram.
The optional parameter shift causes the indices to be shifted by that amount, for use in Dynkin diagrams of reducible types. The parameter nolabel, if set, inhibits the printing of the Cartan type name as part of the ascii art.
EXAMPLES:
sage: DynkinDiagram("E6")
O 2
|
|
O---O---O---O---O
1 3 4 5 6
E6
Returns ascii art representing the extended Dynkin diagram of a finite Cartan type. This is also the Dynkin diagram of the associated untwisted affine root system.
EXAMPLES:
sage: DynkinDiagram(['E',6,1])
O 0
|
|
O 2
|
|
O---O---O---O---O
1 3 4 5 6
E6~
EXAMPLES:
sage: from sage.combinat.root_system.dynkin_diagram import precheck
sage: ct = CartanType(['A',4])
sage: precheck(ct, letter='C')
...
ValueError: t[0] must be = 'C'
sage: precheck(ct, affine=1)
...
ValueError: t[2] must be = 1
sage: precheck(ct, length=3)
...
ValueError: len(t) must be = 3
sage: precheck(ct, n=3)
...
ValueError: t[1] must be = 3
sage: precheck(ct, n_ge=5)
...
ValueError: t[1] must be >= 5