Ticket #3664: trac_3664-3.patch

File trac_3664-3.patch, 5.3 kB (added by mhansen, 4 months ago)
  • a/sage/combinat/crystals/crystals.py

    old new  
    145145        EXAMPLES: 
    146146            sage: C = CrystalOfLetters(['A', 5]) 
    147147            sage: C.weight_lattice_realization() 
    148             Ambient space for the Root system of type ['A', 5] 
     148            Ambient space of the Root system of type ['A', 5] 
    149149        """ 
    150150        return self.cartan_type.root_system().ambient_space() 
    151151 
     
    157157        EXAMPLES: 
    158158            sage: C = CrystalOfLetters(['A', 5]) 
    159159            sage: C.Lambda() 
    160             [(1, 0, 0, 0, 0, 0), 
    161              (1, 1, 0, 0, 0, 0), 
    162              (1, 1, 1, 0, 0, 0), 
    163              (1, 1, 1, 1, 0, 0), 
    164              (1, 1, 1, 1, 1, 0)] 
    165  
     160            Finite family {1: (1, 0, 0, 0, 0, 0), 2: (1, 1, 0, 0, 0, 0), 3: (1, 1, 1, 0, 0, 0), 4: (1, 1, 1, 1, 0, 0), 5: (1, 1, 1, 1, 1, 0)} 
     161  
    166162        """ 
    167163        return self.weight_lattice_realization().fundamental_weights() 
    168164 
     
    247243    def character(self, R): 
    248244        """ 
    249245        INPUT: R, a WeylCharacterRing. Produces the character of the crystal. 
     246 
    250247        EXAMPLES: 
    251248           sage: C = CrystalOfLetters(['A',2]) 
    252249           sage: T = TensorProductOfCrystals(C, C) 
     
    261258            raise ValueError, "ring does not have the right Cartan type" 
    262259        hlist = {} 
    263260        mlist = {} 
    264 #        for x in self.module_generators: 
     261 
    265262        for x in self.highest_weight_vectors(): 
    266             k = tuple(x.weight()
     263            k = x.weight(
    267264            if k in hlist: 
    268265                hlist[k] += 1 
    269266            else: 
    270267                hlist[k] = 1 
    271268        for x in self.list(): 
    272             k = tuple(x.weight()
     269            k = x.weight(
    273270            if k in mlist: 
    274271                mlist[k] += 1 
    275272            else: 
     
    669666            sage: C(2).Epsilon() 
    670667            (1, 0, 0, 0, 0, 0) 
    671668        """ 
    672         return sum(self.epsilon(i) * self._parent.Lambda()[i-1] for i in self.index_set()) 
     669        return sum(self.epsilon(i) * self._parent.Lambda()[i] for i in self.index_set()) 
    673670 
    674671    def Phi(self): 
    675672        """ 
     
    683680            (1, 1, 0, 0, 0, 0) 
    684681 
    685682        """ 
    686         return sum(self.phi(i) * self._parent.Lambda()[i-1] for i in self.index_set()) 
     683        return sum(self.phi(i) * self._parent.Lambda()[i] for i in self.index_set()) 
    687684 
    688685    def s(self, i): 
    689686        r""" 
  • a/sage/combinat/crystals/letters.py

    old new  
    364364        elif self.value < 0: 
    365365            return -self._parent.weight_lattice_realization()._term(-self.value-1) 
    366366        else: 
    367             return self._parent.weight_lattice_realization()._free_module(0) 
     367            return self._parent.weight_lattice_realization()(0) 
    368368 
    369369    def e(self, i): 
    370370        r""" 
     
    461461        elif self.value < 0: 
    462462            return -self._parent.weight_lattice_realization()._term(-self.value-1) 
    463463        else: 
    464             return self._parent.weight_lattice_realization()._free_module(0) 
     464            return self._parent.weight_lattice_realization()(0) 
    465465 
    466466    def e(self, i): 
    467467        r""" 
     
    546546        elif self.value < 0: 
    547547            return -self._parent.weight_lattice_realization()._term(-self.value-1) 
    548548        else: 
    549             return self._parent.weight_lattice_realization()._free_module(0) 
     549            return self._parent.weight_lattice_realization()(0) 
    550550 
    551551    def e(self, i): 
    552552        r""" 
     
    637637            [(1, 0, -1), (1, -1, 0), (0, 1, -1), (0, 0, 0), (0, -1, 1), (-1, 1, 0), (-1, 0, 1)] 
    638638        """ 
    639639        if self.value == 1: 
    640             return self._parent.weight_lattice_realization()._free_module((1, 0, -1)) 
     640            return self._parent.weight_lattice_realization()((1, 0, -1)) 
    641641        elif self.value == 2: 
    642             return self._parent.weight_lattice_realization()._free_module((1, -1, 0)) 
     642            return self._parent.weight_lattice_realization()((1, -1, 0)) 
    643643        elif self.value == 3: 
    644             return self._parent.weight_lattice_realization()._free_module((0, 1, -1)) 
     644            return self._parent.weight_lattice_realization()((0, 1, -1)) 
    645645        elif self.value == 0: 
    646             return self._parent.weight_lattice_realization()._free_module((0, 0, 0)) 
     646            return self._parent.weight_lattice_realization()((0, 0, 0)) 
    647647        elif self.value == -3: 
    648             return self._parent.weight_lattice_realization()._free_module((0, -1, 1)) 
     648            return self._parent.weight_lattice_realization()((0, -1, 1)) 
    649649        elif self.value == -2: 
    650             return self._parent.weight_lattice_realization()._free_module((-1, 1, 0)) 
     650            return self._parent.weight_lattice_realization()((-1, 1, 0)) 
    651651        elif self.value == -1: 
    652             return self._parent.weight_lattice_realization()._free_module((-1, 0, 1)) 
     652            return self._parent.weight_lattice_realization()((-1, 0, 1)) 
    653653        else: 
    654654            raise RuntimeError, "G2 crystal of letters element %d not valid"%self.value 
    655655