AUTHORS:
Return the Dynkin diagram corresponding to the input.
INPUT:
The input can be one of the following:
Also one can input an index_set by
The edge multiplicities are encoded as edge labels. This uses the
convention in Hong and Kang, Kac, Fulton Harris, and crystals. This is the
opposite convention in Bourbaki and Wikipedia’s Dynkin diagram
(Wikipedia article Dynkin_diagram). That is for :
i <--k-- j <==> a_ij = -k
<==> -scalar(coroot[i], root[j]) = k
<==> multiple arrows point from the longer root
to the shorter one
For example, in type , we have:
sage: C2 = DynkinDiagram(['C',2]); C2
O=<=O
1 2
C2
sage: C2.cartan_matrix()
[ 2 -2]
[-1 2]
However Bourbaki would have the Cartan matrix as:
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
sage: R = RootSystem("A2xB2xF4")
sage: CM = R.cartan_matrix(); CM
[ 2 -1| 0 0| 0 0 0 0]
[-1 2| 0 0| 0 0 0 0]
[-----+-----+-----------]
[ 0 0| 2 -1| 0 0 0 0]
[ 0 0|-2 2| 0 0 0 0]
[-----+-----+-----------]
[ 0 0| 0 0| 2 -1 0 0]
[ 0 0| 0 0|-1 2 -1 0]
[ 0 0| 0 0| 0 -2 2 -1]
[ 0 0| 0 0| 0 0 -1 2]
sage: DD = DynkinDiagram(CM); DD
O---O
1 2
O=>=O
3 4
O---O=>=O---O
5 6 7 8
A2xB2xF4
sage: DD.cartan_matrix()
[ 2 -1 0 0 0 0 0 0]
[-1 2 0 0 0 0 0 0]
[ 0 0 2 -1 0 0 0 0]
[ 0 0 -2 2 0 0 0 0]
[ 0 0 0 0 2 -1 0 0]
[ 0 0 0 0 -1 2 -1 0]
[ 0 0 0 0 0 -2 2 -1]
[ 0 0 0 0 0 0 -1 2]
We can also create Dynkin diagrams from arbitrary Cartan matrices:
sage: C = CartanMatrix([[2, -3], [-4, 2]])
sage: DynkinDiagram(C)
Dynkin diagram of rank 2
sage: C.index_set()
(0, 1)
sage: CI = CartanMatrix([[2, -3], [-4, 2]], [3, 5])
sage: DI = DynkinDiagram(CI)
sage: DI.index_set()
(3, 5)
sage: CII = CartanMatrix([[2, -3], [-4, 2]])
sage: DII = DynkinDiagram(CII, ('y', 'x'))
sage: DII.index_set()
('x', 'y')
See also
CartanType() for a general discussion on Cartan types and in particular node labeling conventions.
TESTS:
Check that trac ticket #15277 is fixed by not having edges from 0’s:
sage: CM = CartanMatrix([[2,-1,0,0],[-3,2,-2,-2],[0,-1,2,-1],[0,-1,-1,2]])
sage: CM
[ 2 -1 0 0]
[-3 2 -2 -2]
[ 0 -1 2 -1]
[ 0 -1 -1 2]
sage: CM.dynkin_diagram().edges()
[(0, 1, 3),
(1, 0, 1),
(1, 2, 1),
(1, 3, 1),
(2, 1, 2),
(2, 3, 1),
(3, 1, 2),
(3, 2, 1)]
Bases: sage.graphs.digraph.DiGraph, sage.combinat.root_system.cartan_type.CartanType_abstract
A Dynkin diagram.
See also
INPUT:
EXAMPLES:
sage: DynkinDiagram(['A', 3])
O---O---O
1 2 3
A3
sage: C = CartanMatrix([[2, -3], [-4, 2]])
sage: DynkinDiagram(C)
Dynkin diagram of rank 2
sage: C.dynkin_diagram().cartan_matrix() == C
True
TESTS:
Check that the correct type is returned when copied:
sage: d = DynkinDiagram(['A', 3])
sage: type(copy(d))
<class 'sage.combinat.root_system.dynkin_diagram.DynkinDiagram_class'>
We check that trac ticket #14655 is fixed:
sage: cd = copy(d)
sage: cd.add_vertex(4)
sage: d.vertices() != cd.vertices()
True
Implementation note: if a Cartan type is given, then the nodes are initialized from the index set of this Cartan type.
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 an example of Dynkin diagram
EXAMPLES:
sage: from sage.combinat.root_system.dynkin_diagram import DynkinDiagram_class
sage: g = DynkinDiagram_class.an_instance()
sage: g
Dynkin diagram of rank 3
sage: g.cartan_matrix()
[ 2 -1 -1]
[-2 2 -1]
[-1 -1 2]
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
A0
sage: D.edges()
[]
sage: D.dual()
A0
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)
Check if self corresponds to an affine root system.
EXAMPLES:
sage: CartanType(['F',4]).dynkin_diagram().is_affine()
False
sage: D = DynkinDiagram(CartanMatrix([[2, -4], [-3, 2]]))
sage: D.is_affine()
False
Implements CartanType_abstract.is_crystallographic()
A Dynkin diagram always corresponds to a crystallographic root system.
EXAMPLES:
sage: CartanType(['F',4]).dynkin_diagram().is_crystallographic()
True
TESTS:
sage: CartanType(['G',2]).dynkin_diagram().is_crystalographic()
doctest:...: DeprecationWarning: is_crystalographic is deprecated. Please use is_crystallographic instead.
See http://trac.sagemath.org/14673 for details.
True
Deprecated: Use is_crystallographic() instead. See trac ticket #14673 for details.
Check if self corresponds to a finite root system.
EXAMPLES:
sage: CartanType(['F',4]).dynkin_diagram().is_finite()
True
sage: D = DynkinDiagram(CartanMatrix([[2, -4], [-3, 2]]))
sage: D.is_finite()
False
Check if self corresponds to an irreducible root system.
EXAMPLES:
sage: CartanType(['F',4]).dynkin_diagram().is_irreducible()
True
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)]
EXAMPLES:
sage: from sage.combinat.root_system.dynkin_diagram import precheck
sage: ct = CartanType(['A',4])
sage: precheck(ct, letter='C')
Traceback (most recent call last):
...
ValueError: t[0] must be = 'C'
sage: precheck(ct, affine=1)
Traceback (most recent call last):
...
ValueError: t[2] must be = 1
sage: precheck(ct, length=3)
Traceback (most recent call last):
...
ValueError: len(t) must be = 3
sage: precheck(ct, n=3)
Traceback (most recent call last):
...
ValueError: t[1] must be = 3
sage: precheck(ct, n_ge=5)
Traceback (most recent call last):
...
ValueError: t[1] must be >= 5