Path: blob/master/src/sage/combinat/crystals/monomial_crystals.py
8817 views
r"""1Crystals of Modified Nakajima Monomials23AUTHORS:45- Arthur Lubovsky: Initial version67- Ben Salisbury: Initial version89Let `Y_{i,k}`, for `i \in I` and `k \in \ZZ`, be a commuting set of10variables, and let `\boldsymbol{1}` be a new variable which commutes with11each `Y_{i,k}`. (Here, `I` represents the index set of a Cartan datum.) One12may endow the structure of a crystal on the set `\widehat{\mathcal{M}}` of13monomials of the form1415.. MATH::1617M = \prod_{(i,k) \in I\times \ZZ_{\ge0}} Y_{i,k}^{y_i(k)}\boldsymbol{1}.1819Elements of `\widehat{\mathcal{M}}` are called *modified Nakajima monomials*.20We will omit the `\boldsymbol{1}` from the end of a monomial if there exists21at least one `y_i(k) \neq 0`. The crystal structure on this set is defined by2223.. MATH::2425\begin{aligned}26\mathrm{wt}(M) &= \sum_{i\in I} \Bigl( \sum_{k\ge 0} y_i(k) \Bigr) \Lambda_i, \\27\varphi_i(M) &= \max\Bigl\{ \sum_{0\le j \le k} y_i(j) : k\ge 0 \Bigr\}, \\28\varepsilon_i(M) &= \varphi_i(M) - \langle h_i, \mathrm{wt}(M) \rangle, \\29k_f = k_f(M) &= \min\Bigl\{ k\ge 0 : \varphi_i(M) = \sum_{0\le j\le k} y_i(j) \Bigr\}, \\30k_e = k_e(M) &= \max\Bigl\{ k\ge 0 : \varphi_i(M) = \sum_{0\le j\le k} y_i(j) \Bigr\},31\end{aligned}3233where `\{h_i : i \in I\}` and `\{\Lambda_i : i \in I \}` are the simple34coroots and fundamental weights, respectively. With a chosen set of integers35`C = (c_{ij})_{i\neq j}` such that `c_{ij}+c{ji} =1`, one defines3637.. MATH::3839A_{i,k} = Y_{i,k} Y_{i,k+1} \prod_{j\neq i} Y_{j,k+c_{ji}}^{a_{ji}},4041where `(a_{ij})` is a Cartan matrix. Then4243.. MATH::4445\begin{aligned}46e_iM &= \begin{cases} 0 & \text{if } \varepsilon_i(M) = 0, \\47A_{i,k_e}M & \text{if } \varepsilon_i(M) > 0, \end{cases} \\48f_iM &= A_{i,k_f}^{-1} M.49\end{aligned}5051It is shown in [KKS07]_ that the connected component of `\widehat{\mathcal{M}}`52containing the element `\boldsymbol{1}`, which we denote by53`\mathcal{M}(\infty)`, is crystal isomorphic to the crystal `B(\infty)`.5455Let `\widetilde{\mathcal{M}}` be `\widehat{\mathcal{M}}` as a set, and with56crystal structure defined as on `\widehat{\mathcal{M}}` with the exception57that5859.. MATH::6061f_iM = \begin{cases} 0 & \text{if } \varphi_i(M) = 0, \\62A_{i,k_f}^{-1}M & \text{if } \varphi_i(M) > 0. \end{cases}6364Then Kashiwara [Kash03]_ showed that the connected component in65`\widetilde{\mathcal{M}}` containing a monomial `M` such that `e_iM = 0`, for66all `i \in I`, is crystal isomorphic to the irreducible highest weight67crystal `B(\mathrm{wt}(M))`.6869WARNING:7071Monomial crystals depend on the choice of positive integers72`C = (c_{ij})_{i\neq j}` satisfying the condition `c_{ij}+c_{ji}=1`.73We have chosen such integers uniformly such that `c_{ij} = 1` if74`i < j` and `c_{ij} = 0` if `i>j`.7576REFERENCES:7778.. [KKS07] S.-J. Kang, J.-A. Kim, and D.-U. Shin.79Modified Nakajima Monomials and the Crystal `B(\infty)`.80J. Algebra **308**, pp. 524--535, 2007.8182.. [Kash03] M. Kashiwara.83Realizations of Crystals.84Combinatorial and geometric representation theory (Seoul, 2001),85Contemp. Math. **325**, Amer. Math. Soc., pp. 133--139, 2003.86"""8788#******************************************************************************89# Copyright (C) 201390#91# Arthur Lubovsky (alubovsky at albany dot edu)92# Ben Salisbury (ben dot salisbury at cmich dot edu)93#94# Distributed under the terms of the GNU General Public License (GPL)95# http://www.gnu.org/licenses/96#******************************************************************************9798from copy import copy99from sage.structure.element import Element100from sage.structure.parent import Parent101from sage.structure.unique_representation import UniqueRepresentation102from sage.combinat.combinat import CombinatorialObject103from sage.categories.highest_weight_crystals import HighestWeightCrystals104from sage.categories.regular_crystals import RegularCrystals105from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets106from sage.combinat.root_system.cartan_type import CartanType107from sage.combinat.root_system.root_system import RootSystem108from sage.rings.infinity import Infinity109110class NakajimaYMonomial(Element):111r"""112Monomials of the form `Y_{i_1,k_1}^{a_1}\cdots Y_{i_t,k_t}^{y_t}`, where113`i_1,\dots,i_t` are elements of the index set, `k_1,\dots,k_t` are114nonnegative integers, and `y_1,\dots,y_t` are integers.115116EXAMPLES::117118sage: M = InfinityCrystalOfNakajimaMonomials(['B',3,1])119sage: mg = M.module_generators[0]120sage: mg1211122sage: mg.f_string([1,3,2,0,1,2,3,0,0,1])123Y(0,0)^-1 Y(0,1)^-1 Y(0,2)^-1 Y(0,3)^-1 Y(1,0)^-3 Y(1,1)^-2 Y(1,2) Y(2,0)^3 Y(2,2) Y(3,0) Y(3,2)^-1124"""125126def __init__(self,parent,dict):127r"""128INPUT:129130- ``dict`` -- a dictionary of with pairs of the form ``{(i,k):y}``131132EXAMPLES::133134sage: M = InfinityCrystalOfNakajimaMonomials("C5")135sage: mg = M.module_generators[0]136sage: TestSuite(mg).run()137"""138self._dict = dict139Element.__init__(self, parent)140141def _repr_(self):142r"""143Return a string representation of ``self``.144145EXAMPLES::146147sage: M = InfinityCrystalOfNakajimaMonomials(['A',5,2])148sage: M({(1,0):1,(2,2):-2,(0,5):10})149Y(0,5)^10 Y(1,0) Y(2,2)^-2150"""151if self._dict == {}:152return "1"153else:154L = sorted(self._dict.iteritems(), key=lambda x:(x[0][0],x[0][1]))155return_str = ''156for x in range(len(L)):157if L[x][1] != 1:158return_str += "Y(%s,%s)"%(L[x][0][0],L[x][0][1]) + "^%s "%L[x][1]159else:160return_str += "Y(%s,%s) "%(L[x][0][0],L[x][0][1])161return return_str162163def __eq__(self,other):164r"""165EXAMPLES::166167sage: M = InfinityCrystalOfNakajimaMonomials(['C',5])168sage: m1 = M.module_generators[0].f(1)169sage: m2 = M.module_generators[0].f(2)170sage: m1.__eq__(m2)171False172sage: m1.__eq__(m1)173True174"""175if isinstance(other, NakajimaYMonomial):176return self._dict == other._dict177return self._dict == other178179def __ne__(self,other):180r"""181EXAMPLES::182183sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights()184sage: M = CrystalOfNakajimaMonomials(['A',2],La[1]+La[2])185sage: m0 = M.module_generators[0]186sage: m = M.module_generators[0].f(1).f(2).f(2).f(1)187sage: m.__ne__(m0)188True189sage: m.__ne__(m)190False191"""192return not self.__eq__(other)193194def __lt__(self,other):195r"""196EXAMPLES::197198sage: M = InfinityCrystalOfNakajimaMonomials(['F',4])199sage: mg = M.module_generators[0]200sage: m = mg.f(4)201sage: m.__lt__(mg)202False203sage: mg.__lt__(m)204False205"""206return False207208def _latex_(self):209r"""210Return a `\LaTeX` representation of ``self``.211212EXAMPLES::213214sage: M = InfinityCrystalOfNakajimaMonomials(['G',2,1])215sage: M.module_generators[0].f_string([1,0,2])._latex_()216'Y_{0,0}^{-1} Y_{1,0}^{-1} Y_{1,1}^{2} Y_{2,0} Y_{2,1}^{-1} '217"""218if self._dict == {}:219return "\\boldsymbol{1}"220else:221L = sorted(self._dict.iteritems(), key=lambda x:(x[0][0],x[0][1]))222return_str = ''223for x in range(len(L)):224if L[x][1] != 1:225return_str += "Y_{%s,%s}"%(L[x][0][0],L[x][0][1]) + "^{%s} "%L[x][1]226else:227return_str += "Y_{%s,%s} "%(L[x][0][0],L[x][0][1])228return return_str229230def weight(self):231r"""232Return the weight of ``self`` as an element of233``self.parent().weight_lattice_realization``.234235EXAMPLES::236237sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,2])238sage: m = M.module_generators[0].f_string([0,3,2,0,1])239sage: m.weight()240-2*Lambda[0] + Lambda[1]241242sage: M = InfinityCrystalOfNakajimaMonomials(['E',6])243sage: m = M.module_generators[0].f_string([1,5,2,6,3])244sage: m.weight()245(-1/2, -3/2, 3/2, 1/2, -1/2, 1/2, 1/2, -1/2)246"""247P = self.parent().weight_lattice_realization()248La = P.fundamental_weights()249return P(sum(v*La[k[0]] for k,v in self._dict.iteritems()))250251def weight_in_root_lattice(self):252r"""253Return the weight of ``self`` as an element of the root lattice.254255EXAMPLES::256257sage: M = InfinityCrystalOfNakajimaMonomials(['F',4])258sage: m = M.module_generators[0].f_string([3,3,1,2,4])259sage: m.weight_in_root_lattice()260-alpha[1] - alpha[2] - 2*alpha[3] - alpha[4]261262sage: M = InfinityCrystalOfNakajimaMonomials(['B',3,1])263sage: mg = M.module_generators[0]264sage: m = mg.f_string([1,3,2,0,1,2,3,0,0,1])265sage: m.weight_in_root_lattice()266-3*alpha[0] - 3*alpha[1] - 2*alpha[2] - 2*alpha[3]267"""268Q = RootSystem(self.parent().cartan_type()).root_lattice()269alpha = Q.simple_roots()270path = self.to_highest_weight()271return Q(sum(-alpha[j] for j in path[1]))272273def epsilon(self,i):274r"""275Return the value of `\varepsilon_i` on ``self``.276277INPUT:278279- ``i`` -- an element of the index set280281EXAMPLES::282283sage: M = InfinityCrystalOfNakajimaMonomials(['G',2,1])284sage: m = M.module_generators[0].f(2)285sage: [m.epsilon(i) for i in M.index_set()]286[0, 0, 1]287"""288if i not in self.parent().index_set():289raise ValueError("i must be an element of the index set")290h = self.parent().weight_lattice_realization().simple_coroots()291return self.phi(i) - self.weight().scalar(h[i])292293def phi(self,i):294r"""295Return the value of `\varphi_i` on ``self``.296297INPUT:298299- ``i`` -- an element of the index set300301EXAMPLES::302303sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,3])304sage: m = M.module_generators[0].f(1)305sage: [m.phi(i) for i in M.index_set()]306[1, -1, 1]307"""308if i not in self.parent().index_set():309raise ValueError("i must be an element of the index set")310dict = self._dict311if dict == {}:312return 0313else:314L = [x[0] for x in dict.keys()]315if i not in L:316return 0317else:318d = copy(dict)319K = max(x[1] for x in list(d) if x[0] ==i)320for a in range(K):321if d.has_key((i,a)):322continue323else:324d[(i,a)] = 0325S = sorted(filter(lambda x: x[0][0]==i, d.iteritems()), key=lambda x: x[0][1])326return max(sum(S[k][1] for k in range(s)) for s in range(1,len(S)+1))327328def _ke(self,i):329r"""330Return the value `k_e` with respect to ``i`` and ``self``.331332INPUT:333334- ``i`` -- an element of the index set335336EXAMPLES::337338sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,3])339sage: m = M.module_generators[0].f(1)340sage: [m._ke(i) for i in M.index_set()]341[+Infinity, 0, +Infinity]342"""343dict = self._dict344sum = 0345L = []346phi = self.phi(i)347if self.epsilon(i) == 0:348return Infinity349else:350d = copy(dict)351K = max(x[1] for x in list(d) if x[0] ==i)352for a in range(K):353if d.has_key((i,a)):354continue355else:356d[(i,a)] = 0357S = sorted(filter(lambda x: x[0][0]==i, d.iteritems()), key=lambda x: x[0][1])358for var,exp in S:359sum += exp360if sum == phi:361L.append(var[1])362if L == []:363return 0364else:365return max(L)366367def _kf(self,i):368r"""369Return the value `k_f` with respect to ``i`` and ``self``.370371INPUT:372373- ``i`` -- an element of the index set374375EXAMPLES::376377sage: M = InfinityCrystalOfNakajimaMonomials(['F',4,1])378sage: m = M.module_generators[0].f_string([0,1,4,3])379sage: [m._kf(i) for i in M.index_set()]380[0, 0, 2, 0, 0]381"""382d = copy(self._dict)383I = [x[0] for x in d]384if i not in I:385return 0386else:387K = max(x[1] for x in list(d) if x[0] ==i)388for a in range(K):389if d.has_key((i,a)):390continue391else:392d[(i,a)] = 0393S = sorted(filter(lambda x: x[0][0]==i, d.iteritems()), key=lambda x: x[0][1])394sum = 0395phi = self.phi(i)396L = []397for var,exp in S:398sum += exp399if sum == phi:400return var[1]401402def e(self,i):403r"""404Return the action of `e_i` on ``self``.405406INPUT:407408- ``i`` -- an element of the index set409410EXAMPLES::411412sage: M = InfinityCrystalOfNakajimaMonomials(['E',7,1])413sage: m = M.module_generators[0].f_string([0,1,4,3])414sage: [m.e(i) for i in M.index_set()]415[None,416None,417None,418Y(0,0)^-1 Y(1,1)^-1 Y(2,1) Y(3,0) Y(3,1) Y(4,0)^-1 Y(4,1)^-1 Y(5,0) ,419None,420None,421None,422None]423424sage: M = InfinityCrystalOfNakajimaMonomials("C5")425sage: m = M.module_generators[0].f_string([1,3])426sage: [m.e(i) for i in M.index_set()]427[Y(2,1) Y(3,0)^-1 Y(3,1)^-1 Y(4,0) ,428None,429Y(1,0)^-1 Y(1,1)^-1 Y(2,0) ,430None,431None]432"""433if i not in self.parent().index_set():434raise ValueError("i must be an element of the index set")435if self.epsilon(i) == 0:436return None437438newdict = copy(self._dict)439ke = self._ke(i)440Aik = {(i, ke):1, (i, ke+1):1}441ct = self.parent().cartan_type()442cm = ct.cartan_matrix()443shift = 0444if self.parent().cartan_type().is_finite():445shift = 1446for j in self.parent().index_set():447if i == j:448continue449c = 0450if i > j:451c = 1452if ct.is_affine() and ct.type() == 'A' and abs(i-j) == ct.rank() - 1:453c = 1 - c454if cm[j-shift][i-shift] != 0:455Aik[(j, ke+c)] = cm[j-shift][i-shift]456for key,value in Aik.iteritems():457if newdict.has_key(key):458newdict[key] +=value459else:460newdict[key] = value461for k in list(newdict):462if newdict[k] == 0:463newdict.pop(k)464return self.__class__(self.parent(),newdict)465466def f(self,i):467r"""468Return the action of `f_i` on ``self``.469470INPUT:471472- ``i`` -- an element of the index set473474EXAMPLES::475476sage: M = InfinityCrystalOfNakajimaMonomials("B4")477sage: m = M.module_generators[0].f_string([1,3,4])478sage: [m.f(i) for i in M.index_set()]479[Y(1,0)^-2 Y(1,1)^-2 Y(2,0)^2 Y(2,1) Y(3,0)^-1 Y(4,0) Y(4,1)^-1 ,480Y(1,0)^-1 Y(1,1)^-1 Y(1,2) Y(2,0) Y(2,2)^-1 Y(3,0)^-1 Y(3,1) Y(4,0) Y(4,1)^-1 ,481Y(1,0)^-1 Y(1,1)^-1 Y(2,0) Y(2,1)^2 Y(3,0)^-2 Y(3,1)^-1 Y(4,0)^3 Y(4,1)^-1 ,482Y(1,0)^-1 Y(1,1)^-1 Y(2,0) Y(2,1) Y(3,0)^-1 Y(3,1) Y(4,1)^-2 ]483"""484if i not in self.parent().index_set():485raise ValueError("i must be an element of the index set")486newdict = copy(self._dict)487kf = self._kf(i)488Aik = {(i, kf):-1, (i, kf+1):-1}489ct = self.parent().cartan_type()490cm = ct.cartan_matrix()491shift = 0492if ct.is_finite():493shift = 1494for j in self.parent().index_set():495if i == j:496continue497c = 0498if i > j:499c = 1500if ct.is_affine() and ct.type() == 'A' and abs(i-j) == ct.rank() - 1:501c = 1 - c502if cm[j-shift][i-shift] != 0:503Aik[(j, kf+c)] = -cm[j-shift][i-shift]504for key,value in Aik.iteritems():505if newdict.has_key(key):506newdict[key] +=value507else:508newdict[key] = value509for k in list(newdict):510if newdict[k] == 0:511newdict.pop(k)512return self.__class__(self.parent(),newdict)513514class NakajimaAMonomial(NakajimaYMonomial):515r"""516Monomials of the form `A_{i_1,k_1}^{a_1}\cdots A_{i_t,k_t}^{a_t}`, where517`i_1,\dots,i_t` are elements of the index set, `k_1,\dots,k_t` are518nonnegative integers, and `a_1,\dots,a_t` are integers.519520EXAMPLES::521522sage: M = InfinityCrystalOfNakajimaMonomials("A3",use_Y=False)523sage: mg = M.module_generators[0]524sage: mg.f_string([1,2,3,2,1])525A(1,0)^-1 A(1,1)^-1 A(2,0)^-2 A(3,0)^-1526sage: mg.f_string([3,2,1])527A(1,2)^-1 A(2,1)^-1 A(3,0)^-1528"""529530def _repr_(self):531r"""532Return a string representation of ``self``.533534EXAMPLES::535536sage: M = InfinityCrystalOfNakajimaMonomials(['B',4,1],use_Y=False)537sage: m = M.module_generators[0].f_string([4,2,1])538sage: m539A(1,1)^-1 A(2,0)^-1 A(4,0)^-1540"""541if self._dict == {}:542return "1"543else:544L = sorted(self._dict.iteritems(), key=lambda x:(x[0][0],x[0][1]))545return_str = ''546for x in range(len(L)):547if L[x][1] != 1:548return_str += "A(%s,%s)"%(L[x][0][0],L[x][0][1]) + "^%s "%L[x][1]549else:550return_str += "A(%s,%s) "%(L[x][0][0],L[x][0][1])551return return_str552553def _latex_(self):554r"""555Return a `\LaTeX` representation of ``self``.556557EXAMPLES::558559sage: M = InfinityCrystalOfNakajimaMonomials(['C',4,1],use_Y=False)560sage: m = M.module_generators[0].f_string([4,2,3])561sage: m._latex_()562'A_{2,0}^{-1} A_{3,1}^{-1} A_{4,0}^{-1} '563"""564if self._dict == {}:565return "\\boldsymbol{1}"566else:567L = sorted(self._dict.iteritems(), key=lambda x:(x[0][0],x[0][1]))568return_str = ''569for x in range(len(L)):570if L[x][1] !=1:571return_str += "A_{%s,%s}"%(L[x][0][0],L[x][0][1]) + "^{%s} "%L[x][1]572else:573return_str += "A_{%s,%s} "%(L[x][0][0],L[x][0][1])574return return_str575576def to_Y_monomial(self):577r"""578Represent `\prod_{(i,k)} A_{i,k}^{a_{i}(k)}` in the form579`\prod_{(i,k)} Y_{i,k}^{y_i(k)}` using the formula580581.. MATH::582583A_{i,k} = Y_{i,k} Y_{i,k+1} \prod_{\substack{j \in I \\ j\neq i}}584Y_{i,k+c_{ji}}^{a_{ji}}.585586EXAMPLES::587588sage: M = InfinityCrystalOfNakajimaMonomials(['A',2,1],use_Y=False)589sage: m = M.module_generators[0].f_string([2,0,1,2,1])590sage: m591A(0,0)^-1 A(1,0)^-1 A(1,1)^-1 A(2,0)^-1 A(2,1)^-1592sage: m.to_Y_monomial()593Y(0,1) Y(0,2) Y(1,1)^-1 Y(2,2)^-1594"""595Y = {}596d = self._dict597ct = self.parent().cartan_type()598cm = ct.cartan_matrix()599for k,v in d.iteritems():600Y[k] = Y.get(k,0) + v601Y[(k[0],k[1]+1)] = Y.get((k[0],k[1]+1), 0) + v602shift = 0603if ct.is_finite():604shift = 1605for j in self.parent().index_set():606if k[0] == j:607continue608c = 0609if k[0] > j:610c = 1611if ct.is_affine() and ct.type() == 'A' and abs(k[0]-j) == ct.rank() - 1:612c = 1 - c613if cm[j-shift][k[0]-shift] != 0:614Y[(j, k[1]+c)] = Y.get((j,k[1]+c),0) + v*cm[j-shift][k[0]-shift]615for k in Y.keys():616if Y[k] == 0:617Y.pop(k)618return NakajimaYMonomial(self.parent(), Y)619620def weight(self):621r"""622Return the weight of ``self`` as an element of623``self.parent().weight_lattice_realization()``.624625EXAMPLES::626627sage: M = InfinityCrystalOfNakajimaMonomials(['A',4,2],use_Y=False)628sage: m = M.module_generators[0].f_string([1,2,0,1])629sage: m.weight()6302*Lambda[0] - Lambda[1]631"""632return self.to_Y_monomial().weight()633634def weight_in_root_lattice(self):635r"""636Return the weight of ``self`` as an element of the root lattice.637638EXAMPLES::639640sage: M = InfinityCrystalOfNakajimaMonomials(['C',3,1],use_Y=False)641sage: m = M.module_generators[0].f_string([3,0,1,2,0])642sage: m.weight_in_root_lattice()643-2*alpha[0] - alpha[1] - alpha[2] - alpha[3]644"""645return self.to_Y_monomial().weight_in_root_lattice()646647def epsilon(self,i):648r"""649Return the action of `\varepsilon_i` on ``self``.650651INPUT:652653- ``i`` -- an element of the index set654655EXAMPLES::656657sage: M = InfinityCrystalOfNakajimaMonomials(['C',4,1],use_Y=False)658sage: m = M.module_generators[0].f_string([4,2,3])659sage: [m.epsilon(i) for i in M.index_set()]660[0, 0, 0, 1, 0]661"""662if i not in self.parent().index_set():663raise ValueError("i must be an element of the index set")664return self.to_Y_monomial().epsilon(i)665666def phi(self,i):667r"""668Return the action of `\varphi_i` on ``self``.669670INPUT:671672- ``i`` -- an element of the index set673674EXAMPLES::675676sage: M = InfinityCrystalOfNakajimaMonomials(['C',4,1],use_Y=False)677sage: m = M.module_generators[0].f_string([4,2,3])678sage: [m.phi(i) for i in M.index_set()]679[0, 1, -1, 2, -1]680"""681if i not in self.parent().index_set():682raise ValueError("i must be an element of the index set")683return self.to_Y_monomial().phi(i)684685def e(self,i):686r"""687Return the action of `e_i` on ``self``.688689INPUT:690691- ``i`` -- an element of the index set692693EXAMPLES::694695sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,1],use_Y=False)696sage: m = M.module_generators[0].f_string([4,2,3,0])697sage: [m.e(i) for i in M.index_set()]698[A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 ,699None,700None,701A(0,2)^-1 A(2,1)^-1 A(4,0)^-1 ,702None]703"""704if i not in self.parent().index_set():705raise ValueError("i must be an element of the index set")706if self.epsilon(i) == 0:707return None708ke = self.to_Y_monomial()._ke(i)709d = copy(self._dict)710d[(i,ke)] = d.get((i,ke),0)+1711for k in list(d):712if d[k] == 0:713d.pop(k)714return self.__class__(self.parent(), d)715716def f(self,i):717r"""718Return the action of `f_i` on ``self``.719720INPUT:721722- ``i`` -- an element of the index set723724EXAMPLES::725726sage: M = InfinityCrystalOfNakajimaMonomials("E8",use_Y=False)727sage: m = M.module_generators[0].f_string([4,2,3,8])728sage: m729A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(8,0)^-1730sage: [m.f(i) for i in M.index_set()]731[A(1,2)^-1 A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(8,0)^-1 ,732A(2,0)^-1 A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(8,0)^-1 ,733A(2,1)^-1 A(3,0)^-1 A(3,1)^-1 A(4,0)^-1 A(8,0)^-1 ,734A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(4,1)^-1 A(8,0)^-1 ,735A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(5,0)^-1 A(8,0)^-1 ,736A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(6,0)^-1 A(8,0)^-1 ,737A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(7,1)^-1 A(8,0)^-1 ,738A(2,1)^-1 A(3,1)^-1 A(4,0)^-1 A(8,0)^-2 ]739"""740if i not in self.parent().index_set():741raise ValueError("i must be an element of the index set")742kf = self.to_Y_monomial()._kf(i)743d = copy(self._dict)744d[(i,kf)] = d.get((i,kf),0) - 1745return self.__class__(self.parent(), d)746747class InfinityCrystalOfNakajimaMonomials(Parent,UniqueRepresentation):748r"""749Let `Y_{i,k}`, for `i \in I` and `k \in \ZZ`, be a commuting set of750variables, and let `\boldsymbol{1}` be a new variable which commutes with751each `Y_{i,k}`. (Here, `I` represents the index set of a Cartan datum.) One752may endow the structure of a crystal on the set `\widehat{\mathcal{M}}` of753monomials of the form754755.. MATH::756757M = \prod_{(i,k) \in I\times \ZZ_{\ge0}} Y_{i,k}^{y_i(k)}\boldsymbol{1}.758759Elements of `\widehat{\mathcal{M}}` are called *modified Nakajima monomials*.760We will omit the `\boldsymbol{1}` from the end of a monomial if there exists761at least one `y_i(k) \neq 0`. The crystal structure on this set is defined by762763.. MATH::764765\begin{aligned}766\mathrm{wt}(M) &= \sum_{i\in I} \Bigl( \sum_{k\ge 0} y_i(k) \Bigr) \Lambda_i, \\767\varphi_i(M) &= \max\Bigl\{ \sum_{0\le j \le k} y_i(j) : k\ge 0 \Bigr\}, \\768\varepsilon_i(M) &= \varphi_i(M) - \langle h_i, \mathrm{wt}(M) \rangle, \\769k_f = k_f(M) &= \min\Bigl\{ k\ge 0 : \varphi_i(M) = \sum_{0\le j\le k} y_i(j) \Bigr\}, \\770k_e = k_e(M) &= \max\Bigl\{ k\ge 0 : \varphi_i(M) = \sum_{0\le j\le k} y_i(j) \Bigr\},771\end{aligned}772773where `\{h_i : i \in I\}` and `\{\Lambda_i : i \in I \}` are the simple774coroots and fundamental weights, respectively. With a chosen set of integers775`C = (c_{ij})_{i\neq j}` such that `c_{ij}+c{ji} =1`, one defines776777.. MATH::778779A_{i,k} = Y_{i,k} Y_{i,k+1} \prod_{j\neq i} Y_{j,k+c_{ji}}^{a_{ji}},780781where `(a_{ij})` is a Cartan matrix. Then782783.. MATH::784785\begin{aligned}786e_iM &= \begin{cases} 0 & \text{if } \varepsilon_i(M) = 0, \\787A_{i,k_e}M & \text{if } \varepsilon_i(M) > 0, \end{cases} \\788f_iM &= A_{i,k_f}^{-1} M.789\end{aligned}790791It is shown in [KKS07]_ that the connected component of792`\widehat{\mathcal{M}}` containing the element `\boldsymbol{1}`, which we793denote by `\mathcal{M}(\infty)`, is crystal isomorphic to the crystal794`B(\infty)`.795796INPUT:797798- ``cartan_type`` -- A Cartan type799800- ``use_Y`` -- Choice of monomials in terms of `A` or `Y`801802EXAMPLES::803804sage: B = InfinityCrystalOfTableaux("C3")805sage: S = B.subcrystal(max_depth=4)806sage: G = B.digraph(subset=S) # long time807sage: M = InfinityCrystalOfNakajimaMonomials("C3") # long time808sage: T = M.subcrystal(max_depth=4) # long time809sage: H = M.digraph(subset=T) # long time810sage: G.is_isomorphic(H,edge_labels=True) # long time811True812813sage: M = InfinityCrystalOfNakajimaMonomials(['A',2,1])814sage: T = M.subcrystal(max_depth=3)815sage: H = M.digraph(subset=T) # long time816sage: Y = InfinityCrystalOfGeneralizedYoungWalls(2) # long time817sage: YS = Y.subcrystal(max_depth=3) # long time818sage: YG = Y.digraph(subset=YS) # long time819sage: YG.is_isomorphic(H,edge_labels=True) # long time820True821822sage: M = InfinityCrystalOfNakajimaMonomials("D4")823sage: B = InfinityCrystalOfTableaux("D4")824sage: MS = M.subcrystal(max_depth=3)825sage: BS = B.subcrystal(max_depth=3)826sage: MG = M.digraph(subset=MS) # long time827sage: BG = B.digraph(subset=BS) # long time828sage: BG.is_isomorphic(MG,edge_labels=True) # long time829True830"""831832@staticmethod833def __classcall_private__(cls, ct, category=None, use_Y=True):834r"""835Normalize input to ensure a unique representation.836837INPUT:838839- ``ct`` -- Cartan type840841EXAMPLES::842843sage: M = InfinityCrystalOfNakajimaMonomials("E8")844sage: M1 = InfinityCrystalOfNakajimaMonomials(['E',8])845sage: M2 = InfinityCrystalOfNakajimaMonomials(CartanType(['E',8]))846sage: M is M1 is M2847True848"""849if isinstance(use_Y, bool):850if use_Y:851elt_class = NakajimaYMonomial852else:853elt_class = NakajimaAMonomial854else:855elt_class = use_Y856cartan_type = CartanType(ct)857return super(InfinityCrystalOfNakajimaMonomials,cls).__classcall__(cls,cartan_type,category,elt_class)858859def __init__(self, ct, category, elt_class):860r"""861EXAMPLES::862863sage: Minf = InfinityCrystalOfNakajimaMonomials(['A',3])864sage: TestSuite(Minf).run() # long time865"""866self._cartan_type = ct867868self.Element = elt_class869if category is None:870category = (HighestWeightCrystals(), InfiniteEnumeratedSets())871Parent.__init__(self, category=category)872self.module_generators = (self.element_class(self,{}),)873874def _element_constructor_(self,dict):875r"""876Construct an element of ``self`` from ``dict``.877878INPUT:879880- ``dict`` -- a dictionary whose key is a pair and whose value is an integer881882EXAMPLES::883884sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,1])885sage: m = M({(1,0):-1,(1,1):-1,(2,0):1})886sage: m887Y(1,0)^-1 Y(1,1)^-1 Y(2,0)888"""889return self.element_class(self,dict)890891def _repr_(self):892r"""893EXAMPLES::894895sage: M = InfinityCrystalOfNakajimaMonomials(['D',4,1])896sage: m = M({(1,0):-1,(1,1):-1,(2,0):1})897sage: m898Y(1,0)^-1 Y(1,1)^-1 Y(2,0)899"""900return "Infinity Crystal of modified Nakajima monomials of type %s" % self._cartan_type901902def cardinality(self):903r"""904Return the cardinality of ``self``, which is always `\infty`.905906EXAMPLES::907908sage: M = InfinityCrystalOfNakajimaMonomials(['A',5,2])909sage: M.cardinality()910+Infinity911"""912return Infinity913914class CrystalOfNakajimaMonomialsElement(NakajimaYMonomial):915r"""916Element class for :class:`CrystalOfNakajimaMonomials`.917918The `f_i` operators need to be modified from the version in919:class:`NakajimaYMonomial` in order to create irreducible highest weight920realizations. This modified `f_i` is defined as921922.. MATH::923924f_iM = \begin{cases} 0 & \text{if } \varphi_i(M) = 0, \\925A_{i,k_f}^{-1}M & \text{if } \varphi_i(M) > 0. \end{cases}926927EXAMPLES:928"""929930def f(self,i):931r"""932Return the action of `f_i` on ``self``.933934INPUT:935936- ``i`` -- an element of the index set937938EXAMPLES::939940sage: La = RootSystem(['A',5,2]).weight_lattice().fundamental_weights()941sage: M = CrystalOfNakajimaMonomials(['A',5,2],3*La[0])942sage: m = M.module_generators[0]943sage: [m.f(i) for i in M.index_set()]944[Y(0,0)^2 Y(0,1)^-1 Y(2,0) , None, None, None]945"""946if self.phi(i) == 0:947return None948else:949return super(CrystalOfNakajimaMonomialsElement, self).f(i)950951class CrystalOfNakajimaMonomials(InfinityCrystalOfNakajimaMonomials):952r"""953Let `\widetilde{\mathcal{M}}` be `\widehat{\mathcal{M}}` as a set, and with954crystal structure defined as on `\widehat{\mathcal{M}}` with the exception955that956957.. MATH::958959f_iM = \begin{cases} 0 & \text{if } \varphi_i(M) = 0, \\960A_{i,k_f}^{-1}M & \text{if } \varphi_i(M) > 0. \end{cases}961962Then Kashiwara [Kash03]_ showed that the connected component in963`\widetilde{\mathcal{M}}` containing a monomial `M` such that `e_iM = 0`, for964all `i \in I`, is crystal isomorphic to the irreducible highest weight965crystal `B(\mathrm{wt}(M))`.966967EXAMPLES::968969sage: La = RootSystem("A2").weight_lattice().fundamental_weights()970sage: M = CrystalOfNakajimaMonomials("A2",La[1]+La[2])971sage: B = CrystalOfTableaux("A2",shape=[2,1])972sage: GM = M.digraph()973sage: GB = B.digraph()974sage: GM.is_isomorphic(GB,edge_labels=True)975True976977sage: La = RootSystem("G2").weight_lattice().fundamental_weights()978sage: M = CrystalOfNakajimaMonomials("G2",La[1]+La[2])979sage: B = CrystalOfTableaux("G2",shape=[2,1])980sage: GM = M.digraph()981sage: GB = B.digraph()982sage: GM.is_isomorphic(GB,edge_labels=True)983True984985sage: La = RootSystem("B2").weight_lattice().fundamental_weights()986sage: M = CrystalOfNakajimaMonomials(['B',2],La[1]+La[2])987sage: B = CrystalOfTableaux("B2",shape=[3/2,1/2])988sage: GM = M.digraph()989sage: GB = B.digraph()990sage: GM.is_isomorphic(GB,edge_labels=True)991True992993sage: La = RootSystem(['A',3,1]).weight_lattice().fundamental_weights()994sage: M = CrystalOfNakajimaMonomials(['A',3,1],La[0]+La[2])995sage: B = CrystalOfGeneralizedYoungWalls(3,La[0]+La[2])996sage: SM = M.subcrystal(max_depth=4)997sage: SB = B.subcrystal(max_depth=4)998sage: GM = M.digraph(subset=SM) # long time999sage: GB = B.digraph(subset=SB) # long time1000sage: GM.is_isomorphic(GB,edge_labels=True) # long time1001True10021003sage: La = RootSystem(['A',5,2]).weight_lattice().fundamental_weights()1004sage: LA = RootSystem(['A',5,2]).weight_space().fundamental_weights()1005sage: M = CrystalOfNakajimaMonomials(['A',5,2],3*La[0])1006sage: B = CrystalOfLSPaths(3*LA[0])1007sage: SM = M.subcrystal(max_depth=4)1008sage: SB = B.subcrystal(max_depth=4)1009sage: GM = M.digraph(subset=SM)1010sage: GB = B.digraph(subset=SB)1011sage: GM.is_isomorphic(GB,edge_labels=True)1012True1013"""10141015@staticmethod1016def __classcall_private__(cls, cartan_type, La):1017r"""1018Normalize input to ensure a unique representation.10191020INPUT:10211022- ``ct`` -- Cartan type10231024- ``La`` -- an element of ``weight_lattice``10251026EXAMPLES::10271028sage: La = RootSystem(['E',8,1]).weight_lattice().fundamental_weights()1029sage: M = CrystalOfNakajimaMonomials(['E',8,1],La[0]+La[8])1030sage: M1 = CrystalOfNakajimaMonomials(CartanType(['E',8,1]),La[0]+La[8])1031sage: M2 = CrystalOfNakajimaMonomials(['E',8,1],M.Lambda()[0] + M.Lambda()[8])1032sage: M is M1 is M21033True1034"""1035cartan_type = CartanType(cartan_type)1036La = RootSystem(cartan_type).weight_lattice()(La)1037return super(CrystalOfNakajimaMonomials, cls).__classcall__(cls, cartan_type, La)10381039def __init__(self, ct, La):1040r"""1041EXAMPLES::10421043sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights()1044sage: M = CrystalOfNakajimaMonomials(['A',2],La[1]+La[2])1045sage: TestSuite(M).run()1046"""1047InfinityCrystalOfNakajimaMonomials.__init__( self, ct,1048(RegularCrystals(), HighestWeightCrystals()), CrystalOfNakajimaMonomialsElement )1049self._cartan_type = ct1050self.hw = La1051gen = {}1052for j in range(len(La.support())):1053gen[(La.support()[j],0)] = La.coefficients()[j]1054self.module_generators = (self.element_class(self,gen),)10551056def _repr_(self):1057r"""1058Return a string representation of ``self``.10591060EXAMPLES::10611062sage: La = RootSystem(['C',3,1]).weight_lattice().fundamental_weights()1063sage: M = CrystalOfNakajimaMonomials(['C',3,1],La[0]+5*La[3])1064sage: M1065Highest weight crystal of modified Nakajima monomials of Cartan type ['C', 3, 1] and highest weight Lambda[0] + 5*Lambda[3].1066"""1067return "Highest weight crystal of modified Nakajima monomials of Cartan type {1!s} and highest weight {0!s}.".format(self.hw, self._cartan_type)10681069def cardinality(self):1070r"""1071Return the cardinality of ``self``.10721073EXAMPLES::10741075sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights()1076sage: M = CrystalOfNakajimaMonomials(['A',2],La[1])1077sage: M.cardinality()1078310791080sage: La = RootSystem(['D',4,2]).weight_lattice().fundamental_weights()1081sage: M = CrystalOfNakajimaMonomials(['D',4,2],La[1])1082sage: M.cardinality()1083+Infinity1084"""1085if self.cartan_type().is_affine():1086return Infinity1087else:1088return len(list(self.subcrystal(generators=[self.module_generators[0]])))10891090