# Ticket #3660: trac_3660-2.patch

File trac_3660-2.patch, 10.8 KB (added by mhansen, 11 years ago)
• ## sage/combinat/crystals/crystals.py

# HG changeset patch
# User Anne Schilling <anne@math.ucdavis.edu>
# Date 1216239421 18000
# Node ID 3b5980d6f1b8366cc4ea2c5525f11311d679de98
# Parent  feee783bc62a44f2d3af2ec82969f7a222285af1
diff -r feee783bc62a -r 3b5980d6f1b8 sage/combinat/crystals/crystals.py
 a Let $T$ be a CartanType with index set $I$, and $W$ be a realization of the type $T$ weight lattice. A type $T$ crystal $C$ is an oriented graph equipped with a weight function the nodes to some realization of the type $T$ weight lattice A type $T$ crystal $C$ is a colored oriented graph equipped with a weight function from the nodes to some realization of the type $T$ weight lattice such that: \begin{itemize} \item each edge has a label in $I$ \item for each $i$ in $I$, each node $x$ has: \item Each edge is colored with a label in $i \in I$. \item For each $i\in I$, each node $x$ has: \begin{itemize} \item at most one $i$-successor $f_i(x)$ \item at most one $i$-predecessor $e_i(x)$ \item at most one $i$-successor $f_i(x)$; \item at most one $i$-predecessor $e_i(x)$. \end{itemize} Furthermore, when the exists, Furthermore, when they exist, \begin{itemize} \item $f_i(x)$.weight() = x.weight() - $\alpha_i$ \item $e_i(x)$.weight() = x.weight() + $\alpha_i$ \item $f_i(x)$.weight() = x.weight() - $\alpha_i$; \item $e_i(x)$.weight() = x.weight() + $\alpha_i$. \end{itemize} \end{itemize} This crystal actually models a representation of a Lie algebra if it satisfies some further local conditions due to Stembridge. satisfies some further local conditions due to Stembridge, see J. Stembridge, \textit{A local characterization of simply-laced crystals}, Trans. Amer. Math. Soc. 355 (2003), no. 12, 4807--4823. EXAMPLES: We construct the type $A_5$ crystal on letters We construct the type $A_5$ crystal on letters (or in representation theoretic terms, the highest weight crystal of type $A_5$ corresponding to the highest weight $\Lambda_1$) sage: C = CrystalOfLetters(['A',5]); C The crystal of letters for type ['A', 5] It has a single highest weight element: sage: C.module_generators sage: C.highest_weight_vectors() [1] A crystal is a CombinatorialClass; and we can count and list its elements sage: Tab.plot() For rank two crystals, there is an alternative method of getting metapost pictures. For more information see C.metapost? \item RestrictionOfCrystal / DirectSumOfCrystals \item Crystal.crystal_morphism \item Affine crystals \item Kirillov--Reshetikhin crystals \end{itemize} Most of the above features (except Littelmann/alcove paths) are in \item index_set the index set of the cartan type \item module_generators a list (or container) of distinct elements which generate the crystal a list (or container) of distinct elements which generate the crystal using $f_i$ \item weight_lattice_realization \end{itemize} """ Returns a dot_tex version of self. EXAMPLES: sage: C = CrystalOfLetters(['A',2]) sage: C.dot_tex() 'digraph G { \n  node [ shape=plaintext ];\n  N_0 [ label = " ", texlbl = "$\\text{1}$" ];\n  N_1 [ label = " ", texlbl = "$\\text{2}$" ];\n  N_2 [ label = " ", texlbl = "$\\text{3}$" ];\n  N_0 -> N_1 [ label = " ", texlbl = "1" ];\n  N_1 -> N_2 [ label = " ", texlbl = "2" ];\n}' sage: C = CrystalOfLetters(['A',2]) sage: C.dot_tex() 'digraph G { \n  node [ shape=plaintext ];\n  N_0 [ label = " ", texlbl = "$\\text{1}$" ];\n  N_1 [ label = " ", texlbl = "$\\text{2}$" ];\n  N_2 [ label = " ", texlbl = "$\\text{3}$" ];\n  N_0 -> N_1 [ label = " ", texlbl = "1" ];\n  N_1 -> N_2 [ label = " ", texlbl = "2" ];\n}' """ import re
diff -r feee783bc62a -r 3b5980d6f1b8 sage/combinat/crystals/letters.py
 a For classical types, this is a combinatorial model for the crystal with highest weight Lambda_1 (the first fundamental weight). Any irreducible classical crystal appears as irreducible component Any irreducible classical crystal appears as the irreducible component of the tensor product of several copies of this crystal (plus possibly one copy of the spin crystal, see CrystalOfSpins). See M. Kashiwara, T. Nakashima, \textit{Crystal graphs for representations of the $q$-analogue of classical Lie algebras}, J. Algebra \textbf{165} (1994), no. 2, 295--345. Elements of this irreducible component have a fixed shape, and can be fit inside a tableau shape. Otherwise said, any irreducible classical crystal is isomorphic to a crystal of tableaux with All classical crystals of letters should be instances of this class or of subclasses. To define a new crystal of letters, one only need to implement a class for the elements (which subclasses needs to implement a class for the elements (which subclasses Letter and CrystalElement), with appropriate e and f operations. If the module generator is not 1, one also need to operations. If the module generator is not 1, one also needs to define the subclass ClassicalCrystalOfLetters for the crystal itself. The basic assumption is that crystals of letters are small, but
diff -r feee783bc62a -r 3b5980d6f1b8 sage/combinat/crystals/tensor_product.py
 a r""" Tensor products of crystals Tensor product of crystals. EXAMPLES: We construct the type $A_2$-crystal generated by $2\otimes 1\otimes 1$: sage: C = CrystalOfLetters(['A',2]) sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)]]) It has $8$ elements sage: T.list() [[2, 1, 1], [2, 1, 2], [2, 1, 3], [3, 1, 3], [3, 2, 3], [3, 1, 1], [3, 1, 2], [3, 2, 2]] sage: C = CrystalOfTableaux(['A',3], shape=[1,1,0]) sage: D = CrystalOfTableaux(['A',3], shape=[1,0,0]) sage: T = TensorProductOfCrystals(C,D, generators=[[C(rows=[[1], [2]]), D(rows=[[1]])], [C(rows=[[2], [3]]), D(rows=[[1]])]]) sage: T.count() 24 sage: T.check() True sage: T.module_generators [[[[1], [2]], [[1]]], [[[2], [3]], [[1]]]] sage: [x.weight() for x in T.module_generators] [(2, 1, 0, 0), (1, 1, 1, 0)] If no module generators are specified, we obtain the full tensor product: sage: C=CrystalOfLetters(['A',2]) sage: T=TensorProductOfCrystals(C,C) sage: T.list() [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]] sage: T.count() 9 For a tensor product of crystals without module generators, the default implementation of module_generators contains all elements in the tensor product of the crystals. If there is a subset of elements in the tensor product that still generates the crystal, this needs to be implemented for the specific crystal separately: sage: T.module_generators.list() [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]] For classical highest weight crystals, it is also possible to list all highest weight elements: sage: C = CrystalOfLetters(['A',2]) sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)],[C(1),C(2),C(1)]]) sage: T.highest_weight_vectors() [[2, 1, 1], [1, 2, 1]] """ #***************************************************************************** return self.sibling(l) def TensorProductOfCrystals(*crystals, **options): r""" Tensor product of crystals. EXAMPLES: We construct the type $A_2$-crystal generated by $2\otimes 1\otimes 1$: sage: C = CrystalOfLetters(['A',2]) sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)]]) It has $8$ elements sage: T.list() [[2, 1, 1], [2, 1, 2], [2, 1, 3], [3, 1, 3], [3, 2, 3], [3, 1, 1], [3, 1, 2], [3, 2, 2]] sage: C = CrystalOfTableaux(['A',3], shape=[1,1,0]) sage: D = CrystalOfTableaux(['A',3], shape=[1,0,0]) sage: T = TensorProductOfCrystals(C,D, generators=[[C(rows=[[1], [2]]), D(rows=[[1]])], [C(rows=[[2], [3]]), D(rows=[[1]])]]) sage: T.count() 24 sage: T.check() True sage: T.module_generators [[[[1], [2]], [[1]]], [[[2], [3]], [[1]]]] sage: [x.weight() for x in T.module_generators] [(2, 1, 0, 0), (1, 1, 1, 0)] If no module generators are specified, we obtain the full tensor product: sage: C=CrystalOfLetters(['A',2]) sage: T=TensorProductOfCrystals(C,C) sage: T.list() [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]] sage: T.count() 9 For a tensor product of crystals without module generators, the default implementation of module_generators contains all elements in the tensor product of the crystals. If there is a subset of elements in the tensor product that still generates the crystal, this needs to be implemented for the specific crystal separately: sage: T.module_generators.list() [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]] For classical highest weight crystals, it is also possible to list all highest weight elements: sage: C = CrystalOfLetters(['A',2]) sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)],[C(1),C(2),C(1)]]) sage: T.highest_weight_vectors() [[2, 1, 1], [1, 2, 1]] """ if options.has_key('generators'): if all(isinstance(crystal,ClassicalCrystal) for crystal in crystals): return TensorProductOfClassicalCrystalsWithGenerators(generators=options['generators'], *crystals) #        sage: Tab.latex() # random See sage.combinat.crystals? for general help on using crystals See sage.combinat.crystals.crystals? for general help on using crystals Internally, a tableau of a given Cartan type is represented as a tensor product of letters of the same type. The order in which the tensor factors appear is by reading the columns of the tableaux left to right, top to bottom. As an example: appear is by reading the columns of the tableaux left to right, top to bottom (in French notation). As an example: sage: T = CrystalOfTableaux(['A',2], shape = [3,2]) sage: T.module_generators[0] [[1, 1, 1], [2, 2]]