def __init__(self, crystals, weight, P): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.KirillovReshetikhin(['A',2,1], 1,1) sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights() sage: C = crystals.KyotoPathModel(B, La[0]) sage: TestSuite(C).run() # long time """ Parent.__init__(self, category=(HighestWeightCrystals(), InfiniteEnumeratedSets())) self._cartan_type = crystals[0].cartan_type() self._weight = weight if weight.parent().is_extended(): # public for TensorProductOfCrystals self.crystals = tuple([C.affinization() for C in crystals]) self._epsilon_dicts = [{ b.Epsilon(): self.crystals[i](b, 0) for b in B } for i, B in enumerate(crystals)] self._phi_dicts = [{b.Phi(): self.crystals[i](b, 0) for b in B} for i, B in enumerate(crystals)] else: # public for TensorProductOfCrystals self.crystals = tuple(crystals) self._epsilon_dicts = [{b.Epsilon(): b for b in B} for B in crystals] self._phi_dicts = [{b.Phi(): b for b in B} for B in crystals] self.module_generators = (self.element_class( self, [self._phi_dicts[0][weight]]), )
def __init__(self, wt, WLR): r""" Initialize ``self``. EXAMPLES:: sage: La = RootSystem(['A', 2]).weight_lattice().fundamental_weights() sage: RC = crystals.RiggedConfigurations(La[1] + La[2]) sage: TestSuite(RC).run() sage: La = RootSystem(['A', 2, 1]).weight_lattice().fundamental_weights() sage: RC = crystals.RiggedConfigurations(La[0]) sage: TestSuite(RC).run() # long time """ self._cartan_type = WLR.cartan_type() self._wt = wt self._rc_index = self._cartan_type.index_set() self._rc_index_inverse = {i: ii for ii, i in enumerate(self._rc_index)} # We store the Cartan matrix for the vacancy number calculations for speed self._cartan_matrix = self._cartan_type.cartan_matrix() if self._cartan_type.is_finite(): category = ClassicalCrystals() else: category = (RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets()) Parent.__init__(self, category=category) n = self._cartan_type.rank() #== len(self._cartan_type.index_set()) self.module_generators = (self.element_class( self, partition_list=[[] for i in range(n)]), )
def __init__(self, Binf): r""" Initialize ``self``. EXAMPLES:: sage: B = crystals.infinity.Tableaux(['A',2]) sage: Bstar = crystals.infinity.Star(B) sage: TestSuite(Bstar).run(max_runs=40) sage: TestSuite(Bstar).run(max_runs=1000) # long time """ self._Binf = Binf self._cartan_type = Binf.cartan_type() Parent.__init__(self, category=HighestWeightCrystals().Infinite()) self.module_generators = (self(self._Binf.module_generators[0]), ) t0 = Binf.highest_weight_vector() B = { i: ElementaryCrystal(Binf.cartan_type(), i) for i in self.index_set() } self._tens = {i: B[i].tensor(Binf) for i in self.index_set()} gens = {i: self._tens[i](B[i](0), t0) for i in self.index_set()} self._embedding = { i: Binf.crystal_morphism({t0: gens[i]}) for i in self.index_set() } self._pullback = { i: self._tens[i].crystal_morphism({gens[i]: t0}) for i in self.index_set() }
def __init__(self, ct, La): r""" EXAMPLES:: sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights() sage: M = crystals.NakajimaMonomials(['A',2], La[1]+La[2]) sage: TestSuite(M).run() sage: La = RootSystem(['C',2,1]).weight_lattice(extended=True).fundamental_weights() sage: M = crystals.NakajimaMonomials(['C',2,1], La[0]) sage: TestSuite(M).run(max_runs=100) """ if ct.is_finite(): cat = ClassicalCrystals() else: cat = (RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets()) InfinityCrystalOfNakajimaMonomials.__init__( self, ct, cat, CrystalOfNakajimaMonomialsElement) self._cartan_type = ct self.hw = La gen = {} for j in range(len(La.support())): gen[(La.support()[j], 0)] = La.coefficients()[j] self.module_generators = (self.element_class(self, gen), )
def __init__(self, cartan_type): r""" Initialize ``self``. EXAMPLES:: sage: RC = crystals.infinity.RiggedConfigurations(['A', 2]) sage: TestSuite(RC).run() sage: RC = crystals.infinity.RiggedConfigurations(['A', 2, 1]) sage: TestSuite(RC).run() # long time sage: RC = crystals.infinity.RiggedConfigurations(['C', 2]) sage: TestSuite(RC).run() # long time sage: RC = crystals.infinity.RiggedConfigurations(['C', 2, 1]) sage: TestSuite(RC).run() # long time """ self._cartan_type = cartan_type Parent.__init__(self, category=HighestWeightCrystals().Infinite()) self._rc_index = self._cartan_type.index_set() self._rc_index_inverse = {i: ii for ii, i in enumerate(self._rc_index)} # We store the Cartan matrix for the vacancy number # calculations for speed self._cartan_matrix = self._cartan_type.cartan_matrix() self.module_generators = (self.element_class(self, rigging_list=[[]] * cartan_type.rank()), )
def super_categories(self): r""" EXAMPLES:: sage: ClassicalCrystals().super_categories() [Category of finite crystals, Category of highest weight crystals] """ return [FiniteCrystals(), HighestWeightCrystals()]
def __init__(self, n): r""" EXAMPLES:: sage: Yinf = CrystalOfGeneralizedYoungWalls(3) sage: TestSuite(Yinf).run() """ self._cartan_type = CartanType(['A', n, 1]) Parent.__init__(self, category=HighestWeightCrystals()) self.module_generators = [self.element_class(self, [])]
def __init__(self, n, category): r""" EXAMPLES:: sage: Yinf = crystals.infinity.GeneralizedYoungWalls(3) sage: TestSuite(Yinf).run() """ self._cartan_type = CartanType(['A', n, 1]) if category is None: category = (HighestWeightCrystals(), InfiniteEnumeratedSets()) Parent.__init__(self, category=category) self.module_generators = (self.element_class(self, []), )
def __init__(self, starting_weight): """ EXAMPLES:: sage: C = crystals.LSPaths(['A',2,1],[-1,0,1]); C The crystal of LS paths of type ['A', 2, 1] and weight -Lambda[0] + Lambda[2] sage: C.R Root system of type ['A', 2, 1] sage: C.weight -Lambda[0] + Lambda[2] sage: C.weight.parent() Extended weight space over the Rational Field of the Root system of type ['A', 2, 1] sage: C.module_generators [(-Lambda[0] + Lambda[2],)] TESTS:: sage: C = crystals.LSPaths(['A',2,1], [-1,0,1]) sage: TestSuite(C).run() # long time sage: C = crystals.LSPaths(['E',6], [1,0,0,0,0,0]) sage: TestSuite(C).run() """ cartan_type = starting_weight.parent().cartan_type() self.R = RootSystem(cartan_type) self.weight = starting_weight if not self.weight.parent().base_ring().has_coerce_map_from(QQ): raise ValueError( "Please use the weight space, rather than weight lattice for your weights" ) self._cartan_type = cartan_type self._name = "The crystal of LS paths of type %s and weight %s" % ( cartan_type, starting_weight) if cartan_type.is_affine(): if all(i >= 0 for i in starting_weight.coefficients()): Parent.__init__(self, category=(RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets())) elif starting_weight.parent().is_extended(): Parent.__init__(self, category=(RegularCrystals(), InfiniteEnumeratedSets())) else: Parent.__init__(self, category=(RegularCrystals(), FiniteCrystals())) else: Parent.__init__(self, category=ClassicalCrystals()) if starting_weight == starting_weight.parent().zero(): initial_element = self(tuple([])) else: initial_element = self(tuple([starting_weight])) self.module_generators = [initial_element]
def __init__(self, cartan_type): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.infinity.Tableaux(['A',2]) sage: TestSuite(B).run() # long time """ Parent.__init__( self, category=(HighestWeightCrystals(), InfiniteEnumeratedSets()) ) self._cartan_type = cartan_type self.letters = CrystalOfLetters(cartan_type) self.module_generators = (self.module_generator(),)
def __init__(self, n, La): r""" EXAMPLES:: sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()[1] sage: YLa = crystals.GeneralizedYoungWalls(2,La) We skip the two tests because they take a very long time:: sage: TestSuite(YLa).run(skip=["_test_enumerated_set_contains","_test_stembridge_local_axioms"]) # long time """ InfinityCrystalOfGeneralizedYoungWalls.__init__( self, n, category=(RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets()) ) self.hw = La
def __init__(self, cartan_type, weight): r""" Initialize ``self``. EXAMPLES:: sage: la = RootSystem("A2").weight_lattice().fundamental_weights() sage: B = crystals.elementary.R("A2",5*la[2]) sage: TestSuite(B).run() """ Parent.__init__(self, category = (FiniteCrystals(),HighestWeightCrystals())) self._weight = weight self._cartan_type = cartan_type self.module_generators = (self.element_class(self),)
def __init__(self, ct, category, elt_class): r""" EXAMPLES:: sage: Minf = crystals.infinity.NakajimaMonomials(['A',3]) sage: TestSuite(Minf).run() # long time """ self._cartan_type = ct self.Element = elt_class if category is None: category = (HighestWeightCrystals(), InfiniteEnumeratedSets()) Parent.__init__(self, category=category) self.module_generators = (self.element_class(self, {}), )
def __init__(self, n): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.infinity.Multisegments(2) sage: TestSuite(B).run() """ self._cartan_type = CartanType(['A', n, 1]) self._Zn = IntegerModRing(n + 1) Parent.__init__(self, category=(HighestWeightCrystals(), InfiniteEnumeratedSets())) self.module_generators = (self.highest_weight_vector(), )
def __init__(self, ct, La): r""" EXAMPLES:: sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights() sage: M = crystals.NakajimaMonomials(['A',2],La[1]+La[2]) sage: TestSuite(M).run() """ InfinityCrystalOfNakajimaMonomials.__init__( self, ct, (RegularCrystals(), HighestWeightCrystals()), CrystalOfNakajimaMonomialsElement ) self._cartan_type = ct self.hw = La gen = {} for j in range(len(La.support())): gen[(La.support()[j],0)] = La.coefficients()[j] self.module_generators = (self.element_class(self,gen),)
def __init__(self, cartan_type, P): r""" Initialize ``self``. EXAMPLES:: sage: B = crystals.elementary.Component("D4") sage: TestSuite(B).run() """ self._weight_lattice_realization = P self._cartan_type = cartan_type if self._cartan_type.type() == 'Q': category = RegularSuperCrystals() else: category = (RegularCrystals().Finite(), HighestWeightCrystals()) Parent.__init__(self, category=category) self.module_generators = (self.element_class(self), )
def __init__(self, cartan_type, starting_weight): """ EXAMPLES:: sage: C = CrystalOfLSPaths(['A',2,1],[-1,0,1]); C The crystal of LS paths of type ['A', 2, 1] and weight (-1, 0, 1) sage: C.R Root system of type ['A', 2, 1] sage: C.weight -Lambda[0] + Lambda[2] sage: C.weight.parent() Extended weight space over the Rational Field of the Root system of type ['A', 2, 1] sage: C.module_generators [(-Lambda[0] + Lambda[2],)] """ self._cartan_type = CartanType(cartan_type) self.R = RootSystem(cartan_type) self._name = "The crystal of LS paths of type %s and weight %s" % ( cartan_type, starting_weight) if self._cartan_type.is_affine(): self.extended = True if all(i >= 0 for i in starting_weight): Parent.__init__(self, category=HighestWeightCrystals()) else: Parent.__init__(self, category=Crystals()) else: self.extended = False Parent.__init__(self, category=FiniteCrystals()) Lambda = self.R.weight_space(extended=self.extended).basis() offset = self.R.index_set()[Integer(0)] zero_weight = self.R.weight_space(extended=self.extended).zero() self.weight = sum([zero_weight] + [ starting_weight[j - offset] * Lambda[j] for j in self.R.index_set() ]) if self.weight == zero_weight: initial_element = self(tuple([])) else: initial_element = self(tuple([self.weight])) self.module_generators = [initial_element]
def __init__(self, cartan_type, seq): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.infinity.PathModel(['A',2]) sage: TestSuite(B).run() # long time """ cat = (HighestWeightCrystals(), InfiniteEnumeratedSets()) Parent.__init__(self, category=cat) self._cartan_type = cartan_type self._seq = seq # These are the additional factors we add as necessary self._factors = tuple([ElementaryCrystal(cartan_type, i) for i in seq]) # public for TensorProductOfCrystals self.crystals = self._factors self._tp = [C.module_generators[0] for C in self.crystals] self.module_generators = (self.element_class(self, self._tp), )
def __init__(self, crystals, weight): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.KirillovReshetikhin(['A',2,1], 1,1) sage: L = RootSystem(['A',2,1]).weight_space() sage: C = crystals.KyotoPathModel(B, L.fundamental_weight(0)) sage: TestSuite(C).run() # long time """ Parent.__init__(self, category=(HighestWeightCrystals(), InfiniteEnumeratedSets())) self._cartan_type = crystals[0].cartan_type() self.crystals = crystals # public for TensorProductOfCrystals self._weight = weight self._epsilon_dicts = [{b.Epsilon():b for b in B} for B in crystals] self._phi_dicts = [{b.Phi():b for b in B} for B in crystals] self.module_generators = (self.element_class(self, [self._phi_dicts[0][weight]]),)
def __init__(self, cartan_type): """ Initialize ``self``. EXAMPLES:: sage: B = crystals.infinity.PBW(['B', 2]) sage: TestSuite(B).run() """ self._cartan_type = cartan_type self._pbw_datum_parent = PBWData(self._cartan_type) category = (HighestWeightCrystals(), InfiniteEnumeratedSets()) Parent.__init__(self, category=category) # There must be a better way to do the following i = self._cartan_type.index_set()[0] self._default_word = self._pbw_datum_parent._long_word_begin_with(i) zero_lusztig_datum = [0] * len(self._default_word) self.module_generators = (self.element_class(self, zero_lusztig_datum, self._default_word), )
def __init__(self, ct, La, c): r""" EXAMPLES:: sage: La = RootSystem(['A',2]).weight_lattice().fundamental_weights() sage: M = crystals.NakajimaMonomials(['A',2], La[1]+La[2]) sage: TestSuite(M).run() sage: La = RootSystem(['C',2,1]).weight_lattice(extended=True).fundamental_weights() sage: M = crystals.NakajimaMonomials(['C',2,1], La[0]) sage: TestSuite(M).run(max_runs=100) """ if ct.is_finite(): cat = ClassicalCrystals() else: cat = (RegularCrystals(), HighestWeightCrystals(), InfiniteEnumeratedSets()) InfinityCrystalOfNakajimaMonomials.__init__(self, ct, c, cat) self._cartan_type = ct self.hw = La gen = {(i,0): c for i,c in La} self.module_generators = (self.element_class(self, gen, {}),)
def to_lowest_weight(self, index_set = None): r""" Yields the lowest weight element `u` and a list `[i_1,...,i_k]` such that `self = e_{i_1} ... e_{i_k} u`, where `i_1,...,i_k` are elements in `index_set`. By default the index set is assumed to be the full index set of self. EXAMPLES:: sage: T = crystals.Tableaux(['A',3], shape = [1]) sage: t = T(rows = [[3]]) sage: t.to_lowest_weight() [[[4]], [3]] sage: T = crystals.Tableaux(['A',3], shape = [2,1]) sage: t = T(rows = [[1,2],[4]]) sage: t.to_lowest_weight() [[[3, 4], [4]], [1, 2, 2, 3]] sage: t.to_lowest_weight(index_set = [3]) [[[1, 2], [4]], []] sage: K = crystals.KirillovReshetikhin(['A',3,1],2,1) sage: t = K.module_generator(); t [[1], [2]] sage: t.to_lowest_weight(index_set=[1,2,3]) [[[3], [4]], [2, 1, 3, 2]] sage: t.to_lowest_weight() Traceback (most recent call last): ... ValueError: This is not a highest weight crystals! """ from sage.categories.highest_weight_crystals import HighestWeightCrystals if index_set is None: if HighestWeightCrystals() not in self.parent().categories(): raise ValueError("This is not a highest weight crystals!") index_set = self.index_set() for i in index_set: next = self.f(i) if next is not None: lw = next.to_lowest_weight(index_set = index_set) return [lw[0], [i] + lw[1]] return [self, []]
def to_highest_weight(self, index_set = None): r""" Yields the highest weight element `u` and a list `[i_1,...,i_k]` such that `self = f_{i_1} ... f_{i_k} u`, where `i_1,...,i_k` are elements in `index_set`. By default the index set is assumed to be the full index set of self. EXAMPLES:: sage: T = CrystalOfTableaux(['A',3], shape = [1]) sage: t = T(rows = [[3]]) sage: t.to_highest_weight() [[[1]], [2, 1]] sage: T = CrystalOfTableaux(['A',3], shape = [2,1]) sage: t = T(rows = [[1,2],[4]]) sage: t.to_highest_weight() [[[1, 1], [2]], [1, 3, 2]] sage: t.to_highest_weight(index_set = [3]) [[[1, 2], [3]], [3]] sage: K = KirillovReshetikhinCrystal(['A',3,1],2,1) sage: t = K(rows=[[2],[3]]); t.to_highest_weight(index_set=[1]) [[[1], [3]], [1]] sage: t.to_highest_weight() Traceback (most recent call last): ... ValueError: This is not a highest weight crystals! """ from sage.categories.highest_weight_crystals import HighestWeightCrystals if index_set is None: if HighestWeightCrystals() not in self.parent().categories(): raise ValueError, "This is not a highest weight crystals!" index_set = self.index_set() for i in index_set: if self.epsilon(i) <> 0: self = self.e(i) hw = self.to_highest_weight(index_set = index_set) return [hw[0], [i] + hw[1]] return [self, []]