Path: blob/master/src/sage/combinat/crystals/elementary_crystals.py
8817 views
r"""1Elementary Crystals23Let `\lambda` be a weight. The crystals `T_{\lambda}`, `R_{\lambda}`, `B_i`,4and `C` are important objects in the tensor category of crystals.5For example, the crystal `T_0` is the neutral object in this category; i.e.,6`T_0 \otimes B \cong B \otimes T_0 \cong B` for any crystal `B`. We list7some other properties of these crystals:89- The crystal `T_{\lambda} \otimes B(\infty)` is the crystal of the Verma10module with highest weight `\lambda`, where `\lambda` is a dominant integral11weight.1213- Let `u_{\infty}` be the highest weight vector of `B(\infty)` and `\lambda`14be a dominant integral weight. There is an embedding of crystals `B(\lambda)15\longrightarrow T_{\lambda} \otimes B(\infty)` sending `u_{\lambda} \mapsto16t_{\lambda} \otimes u_{\infty}` which is not strict, but the embedding17`B(\lambda) \longrightarrow C \otimes T_{\lambda} \otimes B(\infty)` by18`u_{\lambda} \mapsto c \otimes t_{\lambda} \otimes u_{\infty}` is a strict19embedding.2021- For any dominant integral weight `\lambda`, there is a surjective crystal22morphism `\Psi_{\lambda} \colon R_{\lambda} \otimes B(\infty) \longrightarrow23B(\lambda)`. More precisely, if `B = \{r_{\lambda} \otimes b \in R_{\lambda}24\otimes B(\infty) : \Psi_{\lambda}(r_{\lambda} \otimes b) \neq 0 \}`, then25`B \cong B(\lambda)` as crystals.2627- For all Cartan types and all weights `\lambda`, we have `R_{\lambda} \cong C28\otimes T_{\lambda}` as crystals.2930- For each `i`, there is a strict crystal morphism `\Psi_i \colon B(\infty)31\longrightarrow B_i \otimes B(\infty)` defined by `u_{\infty} \mapsto32b_i(0) \otimes u_{\infty}`, where `u_\infty` is the highest weight vector33of `B(\infty)`.3435For more information on `B(\infty)`, see :class:`InfinityCrystalOfTableaux`.3637.. NOTE::3839As with :class:`TensorProductOfCrystals`, we are using the opposite of40Kashiwara's convention.4142AUTHORS:4344- Ben Salisbury: Initial version4546REFERENCES:4748.. [Kashiwara93] M. Kashiwara.49The Crystal Base and Littelmann's Refined Demazure Character Formula.50Duke Math. J. **71** (3), pp. 839--858, 1993.5152.. [NZ97] T. Nakashima and A. Zelevinsky.53Polyhedral Realizations of Crystal Bases for Quantized Kac-Moody Algebras.54Adv. Math. **131**, pp. 253--278, 1997.55"""5657#*****************************************************************************58# Copyright (C) 2013 Ben Salisbury <benjamin_salisbury at brown dot edu>59#60# Distributed under the terms of the GNU General Public License (GPL)61#62# This code is distributed in the hope that it will be useful,63# but WITHOUT ANY WARRANTY; without even the implied warranty of64# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU65# General Public License for more details.66#67# The full text of the GPL is available at:68#69# http://www.gnu.org/licenses/70#****************************************************************************7172from sage.categories.crystals import Crystals73from sage.categories.finite_crystals import FiniteCrystals74from sage.categories.highest_weight_crystals import HighestWeightCrystals75from sage.categories.classical_crystals import ClassicalCrystals76from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets77from sage.structure.element import Element78from sage.structure.parent import Parent79from sage.structure.unique_representation import UniqueRepresentation80from sage.combinat.root_system.cartan_type import CartanType81from sage.combinat.root_system.root_system import RootSystem82from sage.rings.integer import Integer83from sage.rings.infinity import Infinity8485class AbstractSingleCrystalElement(Element):86r"""87Abstract base class for elements in crystals with a single element.88"""89def __lt__(self,other):90r"""91EXAMPLES::9293sage: La = RootSystem("D4").ambient_space().fundamental_weights()94sage: T = TCrystal("D4",La[3]+La[4])95sage: t = T.highest_weight_vector()96sage: t < t.e(1)97False98sage: t < t99False100"""101return False102103def __eq__(self,other):104r"""105EXAMPLES::106107sage: La = RootSystem("A2").weight_lattice().fundamental_weights()108sage: T = TCrystal("A2",La[1])109sage: U = TCrystal("A2",La[2])110sage: la = RootSystem("B2").weight_lattice().fundamental_weights()111sage: V = TCrystal("B2",la[1])112sage: t = T.highest_weight_vector()113sage: u = U.highest_weight_vector()114sage: v = V.highest_weight_vector()115sage: [t == t, u == u, v == v]116[True, True, True]117sage: [t == u, u == v, t == v]118[False, False, False]119120sage: C = ComponentCrystal("D7")121sage: c = C.highest_weight_vector()122sage: c == c123True124sage: c == c.f(7)125False126"""127if isinstance(other, AbstractSingleCrystalElement):128return self.parent() is other.parent()129return False130131def __ne__(self,other):132r"""133EXAMPLES::134135sage: La = RootSystem("A2").weight_lattice().fundamental_weights()136sage: T = TCrystal("A2",La[1])137sage: T.highest_weight_vector() != T.highest_weight_vector()138False139sage: T.highest_weight_vector() != T.highest_weight_vector().e(1)140True141"""142return not self.__eq__(other)143144def e(self,i):145r"""146Return `e_i` of ``self``, which is ``None`` for all `i`.147148INPUT:149150- ``i`` -- An element of the index set151152EXAMPLES::153154sage: ct = CartanType(['A',2])155sage: la = RootSystem(ct).weight_lattice().fundamental_weights()156sage: T = TCrystal(ct,la[1])157sage: t = T.highest_weight_vector()158sage: t.e(1)159sage: t.e(2)160"""161return None162163def f(self,i):164r"""165Return `f_i` of ``self``, which is ``None`` for all `i`.166167INPUT:168169- ``i`` -- An element of the index set170171EXAMPLES::172173sage: ct = CartanType(['A',2])174sage: la = RootSystem(ct).weight_lattice().fundamental_weights()175sage: T = TCrystal(ct,la[1])176sage: t = T.highest_weight_vector()177sage: t.f(1)178sage: t.f(2)179"""180return None181182class TCrystal(Parent, UniqueRepresentation):183r"""184The crystal `T_{\lambda}`.185186Let `\lambda` be a weight. As defined in [Kashiwara93]_ the crystal187`T_{\lambda} = \{ t_{\lambda} \}` is a single element crystal with the188crystal structure defined by189190.. MATH::191192\mathrm{wt}(t_\lambda) = \lambda, \quad193e_i t_{\lambda} = f_i t_{\lambda} = 0, \quad194\varepsilon_i(t_{\lambda}) = \varphi_i(t_{\lambda}) = -\infty.195196The crystal `T_{\lambda}` shifts the weights of the vertices in a crystal197`B` by `\lambda` when tensored with `B`, but leaves the graph structure of198`B` unchanged. That is to say, for all `b \in B`, we have `\mathrm{wt}(b199\otimes t_{\lambda}) = \mathrm{wt}(b) + \lambda`.200201INPUT:202203- ``cartan_type`` -- A Cartan type204205- ``weight`` -- An element of the weight lattice of type ``cartan_type``206207EXAMPLES::208209sage: ct = CartanType(['A',2])210sage: C = CrystalOfTableaux(ct, shape=[1])211sage: for x in C: x.weight()212(1, 0, 0)213(0, 1, 0)214(0, 0, 1)215sage: La = RootSystem(ct).ambient_space().fundamental_weights()216sage: TLa = TCrystal(ct, 3*(La[1] + La[2]))217sage: TP = TensorProductOfCrystals(TLa, C)218sage: for x in TP: x.weight()219(7, 3, 0)220(6, 4, 0)221(6, 3, 1)222sage: G = C.digraph()223sage: H = TP.digraph()224sage: G.is_isomorphic(H,edge_labels=True)225True226"""227228@staticmethod229def __classcall_private__(cls, cartan_type, weight):230r"""231Normalize input to ensure a unique representation.232233EXAMPLES::234235sage: ct = CartanType(['A',3])236sage: la = RootSystem(ct).weight_lattice().fundamental_weights()237sage: wts = RootSystem(ct).ambient_space().fundamental_weights()238sage: X = TCrystal(['A',3], la[1])239sage: Y = TCrystal(ct, wts[1])240sage: X is Y241True242"""243cartan_type = CartanType(cartan_type)244La = RootSystem(cartan_type).ambient_space()(weight)245return super(TCrystal, cls).__classcall__(cls, cartan_type, La)246247def __init__(self, cartan_type, weight):248r"""249Initialize ``self``.250251EXAMPLES::252253sage: la = RootSystem("A2").weight_lattice().fundamental_weights()254sage: B = TCrystal("A2", 5*la[2])255sage: TestSuite(B).run()256"""257Parent.__init__(self, category = (FiniteCrystals(), HighestWeightCrystals()))258self._weight = weight259self._cartan_type = cartan_type260self.module_generators = (self.element_class(self),)261262def _repr_(self):263r"""264Return a string representation of ``self``.265266EXAMPLES::267268sage: la = RootSystem(['E',6]).weight_lattice().fundamental_weights()269sage: B = TCrystal(['E',6], la[6])270sage: B271The T crystal of type ['E', 6] and weight (0, 0, 0, 0, 1, -1/3, -1/3, 1/3)272"""273return "The T crystal of type {1!s} and weight {0!s}".format(self._weight,self._cartan_type)274275def _element_constructor_(self, weight):276r"""277Construct an element of ``self`` from ``weight``.278279INPUT:280281- ``weight`` -- An element of the weight lattice282283EXAMPLES::284285sage: la = RootSystem("E8").weight_lattice().fundamental_weights()286sage: T = TCrystal("E8",la[7]+la[8])287sage: T(la[7]+la[8])288(0, 0, 0, 0, 0, 1, 2, 3)289"""290if weight != self._weight:291raise ValueError("Only element is t(%s)"%self._weight)292return self.element_class(self)293294def cardinality(self):295r"""296Return the cardinality of ``self``, which is always `1`.297298EXAMPLES::299300sage: La = RootSystem(['C',12]).weight_lattice().fundamental_weights()301sage: T = TCrystal(['C',12], La[9])302sage: T.cardinality()3031304"""305return Integer(1)306307class Element(AbstractSingleCrystalElement):308r"""309Element of a `T_{\lambda}` crystal.310"""311def _repr_(self):312r"""313EXAMPLES::314315sage: ct = CartanType(['F',4])316sage: la = RootSystem(ct).weight_lattice().fundamental_weights()317sage: T = TCrystal(ct,2*la[1]-3*la[3])318sage: t = T.highest_weight_vector()319sage: t320(-5/2, 1/2, -3/2, -3/2)321"""322return repr(self.parent()._weight)323324def _latex_(self):325r"""326Return a LaTeX representation of ``self``.327328EXAMPLES::329330sage: ct = CartanType(['B',5,1])331sage: la = RootSystem(ct).ambient_space().fundamental_weights()332sage: T = TCrystal(ct, 2*la[1]-3*la[3]+la[0])333sage: t = T.highest_weight_vector()334sage: latex(t)335{t_{-e_{0} - 3e_{1} - 3e_{2} - 3e_{deltacheck}}}336"""337return "{t_{"+self.parent()._weight._latex_()+"}}"338339def epsilon(self,i):340r"""341Return `\varepsilon_i` of ``self``, which is `-\infty` for all `i`.342343INPUT:344345- ``i`` -- An element of the index set346347EXAMPLES::348349sage: ct = CartanType(['C',5])350sage: la = RootSystem(ct).weight_lattice().fundamental_weights()351sage: T = TCrystal(ct,la[4]+la[5]-la[1]-la[2])352sage: t = T.highest_weight_vector()353sage: [t.epsilon(i) for i in T.index_set()]354[-inf, -inf, -inf, -inf, -inf]355"""356return float("-inf")357358def phi(self,i):359r"""360Return `\varphi_i` of ``self``, which is `-\infty` for all `i`.361362INPUT:363364- ``i`` -- An element of the index set365366EXAMPLES::367368sage: ct = CartanType(['C',5])369sage: la = RootSystem(ct).weight_lattice().fundamental_weights()370sage: T = TCrystal(ct,la[4]+la[5]-la[1]-la[2])371sage: t = T.highest_weight_vector()372sage: [t.phi(i) for i in T.index_set()]373[-inf, -inf, -inf, -inf, -inf]374"""375return float("-inf")376377def weight(self):378r"""379Return the weight of ``self``, which is always `\lambda`.380381EXAMPLES::382383sage: ct = CartanType(['C',5])384sage: la = RootSystem(ct).weight_lattice().fundamental_weights()385sage: T = TCrystal(ct,la[4]+la[5]-la[1]-la[2])386sage: t = T.highest_weight_vector()387sage: t.weight()388(0, 1, 2, 2, 1)389"""390return self.parent()._weight391392class RCrystal(Parent, UniqueRepresentation):393r"""394The crystal `R_{\lambda}`.395396For a fixed weight `\lambda`, the crystal `R_{\lambda} = \{ r_{\lambda} \}`397is a single element crystal with the crystal structure defined by398399.. MATH::400401\mathrm{wt}(r_{\lambda}) = \lambda, \quad402e_i r_{\lambda} = f_i r_{\lambda} = 0, \quad403\varepsilon_i(r_{\lambda}) = -\langle h_i, \lambda\rangle, \quad404\varphi_i(r_{\lambda}) = 0,405406where `\{h_i\}` are the simple coroots.407408Tensoring `R_{\lambda}` with a crystal `B` results in shifting the weights409of the vertices in `B` by `\lambda` and may also cut a subset out of the410original graph of `B`. That is, `\mathrm{wt}(r_{\lambda} \otimes b) =411\mathrm{wt}(b) + \lambda`, where `b \in B`, provided `r_{\lambda} \otimes412b \neq 0`. For example, the crystal graph of `B(\lambda)` is the same as413the crystal graph of `R_{\lambda} \otimes B(\infty)` generated from the414component `r_{\lambda} \otimes u_{\infty}`.415416INPUT:417418- ``cartan_type`` -- A Cartan type419420- ``weight`` -- An element of the weight lattice of type ``cartan_type``421422EXAMPLES:423424We check by tensoring `R_{\lambda}` with `B(\infty)` results in a425component of `B(\lambda)`::426427sage: B = InfinityCrystalOfTableaux("A2")428sage: R = RCrystal("A2", B.Lambda()[1]+B.Lambda()[2])429sage: T = TensorProductOfCrystals(R, B)430sage: mg = T(R.highest_weight_vector(), B.highest_weight_vector())431sage: S = T.subcrystal(generators=[mg])432sage: for x in S: x.weight()433(2, 1, 0)434(2, 0, 1)435(1, 2, 0)436(1, 1, 1)437(1, 1, 1)438(1, 0, 2)439(0, 2, 1)440(0, 1, 2)441sage: C = CrystalOfTableaux("A2", shape=[2,1])442sage: for x in C: x.weight()443(2, 1, 0)444(1, 2, 0)445(1, 1, 1)446(1, 0, 2)447(0, 1, 2)448(2, 0, 1)449(1, 1, 1)450(0, 2, 1)451sage: GT = T.digraph(subset=S)452sage: GC = C.digraph()453sage: GT.is_isomorphic(GC, edge_labels=True)454True455"""456457@staticmethod458def __classcall_private__(cls, cartan_type, weight):459r"""460Normalize input to ensure a unique representation.461462EXAMPLES::463464sage: ct = CartanType(['A',3])465sage: la = RootSystem(ct).weight_lattice().fundamental_weights()466sage: wts = RootSystem(ct).ambient_space().fundamental_weights()467sage: X = RCrystal(['A',3], la[1])468sage: Y = RCrystal(ct, wts[1])469sage: X is Y470True471"""472cartan_type = CartanType(cartan_type)473La = RootSystem(cartan_type).ambient_space()(weight)474return super(RCrystal, cls).__classcall__(cls, cartan_type, La)475476def __init__(self, cartan_type, weight):477r"""478Initialize ``self``.479480EXAMPLES::481482sage: la = RootSystem("A2").weight_lattice().fundamental_weights()483sage: B = RCrystal("A2",5*la[2])484sage: TestSuite(B).run()485"""486Parent.__init__(self, category = (FiniteCrystals(),HighestWeightCrystals()))487self._weight = weight488self._cartan_type = cartan_type489self.module_generators = (self.element_class(self),)490491def _repr_(self):492r"""493Return a string representation of ``self``.494495EXAMPLES::496497sage: la = RootSystem(['E',6]).weight_lattice().fundamental_weights()498sage: B = RCrystal(['E',6],la[6])499sage: B500The R crystal of weight (0, 0, 0, 0, 1, -1/3, -1/3, 1/3) and type ['E', 6]501"""502return "The R crystal of weight {0!s} and type {1!s}".format(self._weight,self._cartan_type)503504def _element_constructor_(self, weight):505r"""506Construct an element of ``self`` from ``weight``.507508INPUT:509510- ``weight`` -- An element of the weight lattice511512EXAMPLES::513514sage: la = RootSystem("E8").weight_lattice().fundamental_weights()515sage: R = RCrystal("E8",la[7]+la[8])516sage: R(la[7]+la[8])517(0, 0, 0, 0, 0, 1, 2, 3)518"""519if weight != self._weight:520raise ValueError("Only element is r(%s)"%self._weight)521return self.element_class(self)522523def cardinality(self):524r"""525Return the cardinality of ``self``, which is always `1`.526527EXAMPLES::528529sage: La = RootSystem(['C',12]).weight_lattice().fundamental_weights()530sage: R = RCrystal(['C',12],La[9])531sage: R.cardinality()5321533"""534return Integer(1)535536class Element(AbstractSingleCrystalElement):537r"""538Element of a `R_{\lambda}` crystal.539"""540def _repr_(self):541r"""542EXAMPLES::543544sage: ct = CartanType(['F',4])545sage: la = RootSystem(ct).weight_lattice().fundamental_weights()546sage: T = TCrystal(ct,2*la[1]-3*la[3])547sage: t = T.highest_weight_vector()548sage: t549(-5/2, 1/2, -3/2, -3/2)550"""551return repr(self.parent()._weight)552553def _latex_(self):554r"""555Return a LaTeX representation of ``self``.556557EXAMPLES::558559sage: la = RootSystem("G2").weight_lattice().fundamental_weights()560sage: R = RCrystal("G2",la[1])561sage: r = R.highest_weight_vector()562sage: latex(r)563{r_{e_{0} - e_{2}}}564"""565return "{r_{"+self.parent()._weight._latex_()+"}}"566567def epsilon(self, i):568r"""569Return `\varepsilon_i` of ``self``.570571We have `\varepsilon_i(r_{\lambda}) = -\langle h_i, \lambda572\rangle` for all `i`, where `h_i` is a simple coroot.573574INPUT:575576- ``i`` -- An element of the index set577578EXAMPLES::579580sage: la = RootSystem(['A',2]).weight_lattice().fundamental_weights()581sage: R = RCrystal("A2",la[1])582sage: r = R.highest_weight_vector()583sage: [r.epsilon(i) for i in R.index_set()]584[-1, 0]585"""586P = self.cartan_type().root_system().ambient_space()587h = P.simple_coroots()588return -1*P(self.weight()).scalar(h[i])589590def phi(self,i):591r"""592Return `\varphi_i` of ``self``, which is `0` for all `i`.593594INPUT:595596- ``i`` -- An element of the index set597598EXAMPLES::599600sage: la = RootSystem("C5").weight_lattice().fundamental_weights()601sage: R = RCrystal("C5",la[4]+la[5])602sage: r = R.highest_weight_vector()603sage: [r.phi(i) for i in R.index_set()]604[0, 0, 0, 0, 0]605"""606return 0607608def weight(self):609r"""610Return the weight of ``self``, which is always `\lambda`.611612EXAMPLES::613614sage: ct = CartanType(['C',5])615sage: la = RootSystem(ct).weight_lattice().fundamental_weights()616sage: T = TCrystal(ct,la[4]+la[5]-la[1]-la[2])617sage: t = T.highest_weight_vector()618sage: t.weight()619(0, 1, 2, 2, 1)620"""621return self.parent()._weight622623class ElementaryCrystal(Parent, UniqueRepresentation):624r"""625The elementary crystal `B_i`.626627For `i` an element of the index set of type `X`, the crystal `B_i` of type628`X` is the set629630.. MATH::631632B_i = \{ b_i(m) : m \in \ZZ \},633634where the crystal stucture is given by635636.. MATH::637638\begin{aligned}639\mathrm{wt}\bigl(b_i(m)\bigr) &= m\alpha_i \\640\varphi_j\bigl(b_i(m)\bigr) &= \begin{cases}641m & \text{ if } j=i, \\642-\infty & \text{ if } j\neq i,643\end{cases} \\644\varepsilon_j\bigl(b_i(m)\bigr) &= \begin{cases}645-m & \text{ if } j=i, \\646-\infty & \text{ if } j\neq i,647\end{cases} \\648e_j b_i(m) &= \begin{cases}649b_i(m+1) & \text{ if } j=i, \\6500 & \text{ if } j\neq i,651\end{cases} \\652f_j b_i(m) &= \begin{cases}653b_i(m-1) & \text{ if } j=i, \\6540 & \text{ if } j\neq i.655\end{cases}656\end{aligned}657658The *Kashiwara embedding theorem* asserts there is a unique strict crystal659embedding of crystals660661.. MATH::662663B(\infty) \hookrightarrow B_i \otimes B(\infty),664665satisfying certain properties (see [Kashiwara93]_). The above embedding666may be iterated to obtain a new embedding667668.. MATH::669670B(\infty) \hookrightarrow B_{i_N} \otimes B_{i_{N-1}}671\otimes \cdots \otimes B_{i_2} \otimes B_{i_1} \otimes B(\infty),672673which is a foundational object in the study of *polyhedral realizations of674crystals* (see, for example, [NZ97]_).675"""676677@staticmethod678def __classcall_private__(cls, cartan_type, i):679r"""680Normalize input to ensure a unique representation.681682EXAMPLES::683684sage: B = ElementaryCrystal(['A',4], 3)685sage: C = ElementaryCrystal(CartanType("A4"), int(3))686sage: B is C687True688"""689cartan_type = CartanType(cartan_type)690if i not in cartan_type.index_set():691raise ValueError('i must an element of the index set.')692return super(ElementaryCrystal, cls).__classcall__(cls, cartan_type, i)693694def __init__(self, cartan_type, i):695r"""696Initialize ``self``.697698EXAMPLES::699700sage: B = ElementaryCrystal("D4",3)701sage: TestSuite(B).run()702"""703Parent.__init__(self, category = (Crystals(), InfiniteEnumeratedSets()))704self._i = i705self._cartan_type = cartan_type706self.module_generators = (self.element_class(self,0),)707708def _repr_(self):709r"""710Return a string representation of ``self``.711712EXAMPLES::713714sage: B = ElementaryCrystal(['B',5,1], 4)715sage: B716The 4-elementary crystal of type ['B', 5, 1]717"""718return "The {0!s}-elementary crystal of type {1!s}".format(self._i,self._cartan_type)719720def _element_constructor_(self, m):721r"""722Construct an element of ``self`` from ``weight``.723724INPUT:725726- ``m`` -- An integer727728EXAMPLES::729730sage: B = ElementaryCrystal(['F',4], 2)731sage: B(0)7320733sage: B(-15)734-15735sage: B(721)736721737"""738return self.element_class(self, m)739740class Element(Element):741r"""742Element of a `B_i` crystal.743"""744def __init__(self, parent, m):745r"""746EXAMPLES::747748sage: B = ElementaryCrystal(['B',7],7)749sage: elt = B(17); elt75017751"""752self._m = m753Element.__init__(self, parent)754755def _repr_(self):756r"""757EXAMPLES::758759sage: B = ElementaryCrystal(['A',4],3)760sage: B(-47)761-47762"""763return repr(self._m)764765def __lt__(self,other):766r"""767EXAMPLES::768769sage: B = ElementaryCrystal("D4",3)770sage: b = B(1)771sage: c = B(-1)772sage: b.__lt__(c)773False774sage: c.__lt__(b)775True776"""777if self.parent() is not other.parent():778return False779else:780if Integer(self._m) < Integer(other._m):781return True782else:783return False784785def __eq__(self,other):786r"""787EXAMPLES::788789sage: B = ElementaryCrystal("A2",1)790sage: C = ElementaryCrystal("A2",2)791sage: D = ElementaryCrystal("B2",1)792sage: [B(0) == B(1), B(0) == C(0), B(0) == D(0), C(0) == D(0)]793[False, False, False, False]794sage: [B(1) == B(1), C(12) == C(12), D(-1) == D(-1)]795[True, True, True]796"""797if isinstance(other, ElementaryCrystal.Element):798return self.parent() is other.parent() and self._m == other._m799return False800801def __ne__(self,other):802r"""803EXAMPLES::804805sage: B = ElementaryCrystal("A2",1)806sage: B(0) != B(2)807True808sage: B(0) != B(0)809False810"""811return not self.__eq__(other)812813def _latex_(self):814r"""815Return a LaTeX representation of ``self``.816817EXAMPLES::818819sage: B = ElementaryCrystal(['B',11,1],6)820sage: latex(B(26))821{b_{6}(26)}822"""823return "{b_{%s}(%s)}"%(self.parent()._i, self._m)824825def e(self,i):826r"""827Return the action of `e_i` on ``self``.828829INPUT:830831- ``i`` -- An element of the index set832833EXAMPLES::834835sage: B = ElementaryCrystal(['E',7],1)836sage: B(3).e(1)8374838sage: B(172).e_string([1]*171)839343840sage: B(0).e(2)841"""842if i == self.parent()._i:843return self.__class__(self.parent(), self._m+1)844else:845return None846847def f(self, i):848r"""849Return the action of `f_i` on ``self``.850851INPUT:852853- ``i`` -- An element of the index set854855EXAMPLES::856857sage: B = ElementaryCrystal(['E',7],1)858sage: B(3).f(1)8592860sage: B(172).f_string([1]*171)8611862sage: B(0).e(2)863"""864if i == self.parent()._i:865return self.__class__(self.parent(), self._m-1)866else:867return None868869def epsilon(self, i):870r"""871Return `\varepsilon_i` of ``self``.872873INPUT:874875- ``i`` -- An element of the index set876877EXAMPLES::878879sage: B = ElementaryCrystal(['F',4],3)880sage: [[B(j).epsilon(i) for i in B.index_set()] for j in range(5)]881[[-inf, -inf, 0, -inf],882[-inf, -inf, -1, -inf],883[-inf, -inf, -2, -inf],884[-inf, -inf, -3, -inf],885[-inf, -inf, -4, -inf]]886"""887if i == self.parent()._i:888return -self._m889else:890return float("-inf")891892def phi(self, i):893r"""894Return `\varphi_i` of ``self``.895896INPUT:897898- ``i`` -- An element of the index set899900EXAMPLES::901902sage: B = ElementaryCrystal(['E',8,1],4)903sage: [[B(m).phi(j) for j in B.index_set()] for m in range(44,49)]904[[-inf, -inf, -inf, -inf, 44, -inf, -inf, -inf, -inf],905[-inf, -inf, -inf, -inf, 45, -inf, -inf, -inf, -inf],906[-inf, -inf, -inf, -inf, 46, -inf, -inf, -inf, -inf],907[-inf, -inf, -inf, -inf, 47, -inf, -inf, -inf, -inf],908[-inf, -inf, -inf, -inf, 48, -inf, -inf, -inf, -inf]]909"""910if i == self.parent()._i:911return self._m912else:913return float("-inf")914915def weight(self):916r"""917Return the weight of ``self``.918919EXAMPLES::920921sage: B = ElementaryCrystal(['C',14],12)922sage: B(-385).weight()923-385*alpha[12]924"""925Q = self.parent().cartan_type().root_system().root_lattice()926return self._m * Q.simple_root(self.parent()._i)927928class ComponentCrystal(Parent,UniqueRepresentation):929r"""930The component crystal.931932Defined in [Kashiwara93]_, the component crystal `C = \{c\}` is the single933element crystal whose crystal structure is defined by934935.. MATH::936937\mathrm{wt}(c) = 0, \quad938e_i c = f_i c = 0, \quad939\varepsilon_i(c) = \varphi_i(c) = 0.940941Note `C \cong B(0)`, where `B(0)` is the highest weight crystal of highest942weight `0`.943944INPUT:945946- ``cartan_type`` -- A Cartan type947"""948949@staticmethod950def __classcall_private__(cls, cartan_type):951r"""952Normalize input to ensure a unique representation.953954EXAMPLES::955956sage: C = ComponentCrystal("A2")957sage: D = ComponentCrystal(CartanType(['A',2]))958sage: C is D959True960"""961cartan_type = CartanType(cartan_type)962return super(ComponentCrystal, cls).__classcall__(cls, cartan_type)963964def __init__(self, cartan_type):965r"""966Initialize ``self``.967968EXAMPLES::969970sage: B = ComponentCrystal("D4")971sage: TestSuite(B).run()972"""973Parent.__init__(self, category = ClassicalCrystals())974self._cartan_type = cartan_type975self.module_generators = (self.element_class(self),)976977def _repr_(self):978r"""979Return a string representation of ``self``.980981EXAMPLES::982983sage: C = ComponentCrystal("D4")984sage: C985The component crystal of type ['D', 4]986"""987return "The component crystal of type {0!s}".format(self._cartan_type)988989def _element_constructor_(self, weight):990r"""991Construct an element of ``self``.992993EXAMPLES::994995sage: C = ComponentCrystal("E6")996sage: c = C.highest_weight_vector()997sage: c998c999"""1000if weight != self._weight:1001raise ValueError("Only element is c")1002return self.element_class(self)10031004def cardinality(self):1005r"""1006Return the cardinality of ``self``, which is always `1`.10071008EXAMPLES::10091010sage: C = ComponentCrystal("E6")1011sage: c = C.highest_weight_vector()1012sage: C.cardinality()101311014"""1015return Integer(1)10161017class Element(AbstractSingleCrystalElement):1018r"""1019Element of a component crystal.1020"""1021def _repr_(self):1022r"""1023EXAMPLES::10241025sage: C = ComponentCrystal("F4")1026sage: c = C.highest_weight_vector()1027sage: c1028c1029"""1030return 'c'10311032def _latex_(self):1033r"""1034Return a LaTeX representation of ``self``.10351036EXAMPLES::10371038sage: C = ComponentCrystal("E7")1039sage: c = C.highest_weight_vector()1040sage: latex(c)1041{c}1042"""1043return "{c}"10441045def epsilon(self,i):1046r"""1047Return `\varepsilon_i` of ``self``, which is `0` for all `i`.10481049INPUT:10501051- ``i`` -- An element of the index set10521053EXAMPLES::10541055sage: C = ComponentCrystal("C5")1056sage: c = C.highest_weight_vector()1057sage: [c.epsilon(i) for i in C.index_set()]1058[0, 0, 0, 0, 0]1059"""1060return 010611062def phi(self,i):1063r"""1064Return `\varphi_i` of ``self``, which is `0` for all `i`.10651066INPUT:10671068- ``i`` -- An element of the index set10691070EXAMPLES::10711072sage: C = ComponentCrystal("C5")1073sage: c = C.highest_weight_vector()1074sage: [c.phi(i) for i in C.index_set()]1075[0, 0, 0, 0, 0]1076"""1077return 010781079def weight(self):1080r"""1081Return the weight of ``self``, which is always `0`.10821083EXAMPLES::10841085sage: C = ComponentCrystal("F4")1086sage: c = C.highest_weight_vector()1087sage: c.weight()1088(0, 0, 0, 0)1089"""1090return self.parent().weight_lattice_realization().zero()1091109210931094