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 145 145 EXAMPLES: 146 146 sage: C = CrystalOfLetters(['A', 5]) 147 147 sage: C.weight_lattice_realization() 148 Ambient space forthe Root system of type ['A', 5]148 Ambient space of the Root system of type ['A', 5] 149 149 """ 150 150 return self.cartan_type.root_system().ambient_space() 151 151 … … 157 157 EXAMPLES: 158 158 sage: C = CrystalOfLetters(['A', 5]) 159 159 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 166 162 """ 167 163 return self.weight_lattice_realization().fundamental_weights() 168 164 … … 247 243 def character(self, R): 248 244 """ 249 245 INPUT: R, a WeylCharacterRing. Produces the character of the crystal. 246 250 247 EXAMPLES: 251 248 sage: C = CrystalOfLetters(['A',2]) 252 249 sage: T = TensorProductOfCrystals(C, C) … … 261 258 raise ValueError, "ring does not have the right Cartan type" 262 259 hlist = {} 263 260 mlist = {} 264 # for x in self.module_generators: 261 265 262 for x in self.highest_weight_vectors(): 266 k = tuple(x.weight())263 k = x.weight() 267 264 if k in hlist: 268 265 hlist[k] += 1 269 266 else: 270 267 hlist[k] = 1 271 268 for x in self.list(): 272 k = tuple(x.weight())269 k = x.weight() 273 270 if k in mlist: 274 271 mlist[k] += 1 275 272 else: … … 669 666 sage: C(2).Epsilon() 670 667 (1, 0, 0, 0, 0, 0) 671 668 """ 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()) 673 670 674 671 def Phi(self): 675 672 """ … … 683 680 (1, 1, 0, 0, 0, 0) 684 681 685 682 """ 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()) 687 684 688 685 def s(self, i): 689 686 r""" -
a/sage/combinat/crystals/letters.py
old new 364 364 elif self.value < 0: 365 365 return -self._parent.weight_lattice_realization()._term(-self.value-1) 366 366 else: 367 return self._parent.weight_lattice_realization() ._free_module(0)367 return self._parent.weight_lattice_realization()(0) 368 368 369 369 def e(self, i): 370 370 r""" … … 461 461 elif self.value < 0: 462 462 return -self._parent.weight_lattice_realization()._term(-self.value-1) 463 463 else: 464 return self._parent.weight_lattice_realization() ._free_module(0)464 return self._parent.weight_lattice_realization()(0) 465 465 466 466 def e(self, i): 467 467 r""" … … 546 546 elif self.value < 0: 547 547 return -self._parent.weight_lattice_realization()._term(-self.value-1) 548 548 else: 549 return self._parent.weight_lattice_realization() ._free_module(0)549 return self._parent.weight_lattice_realization()(0) 550 550 551 551 def e(self, i): 552 552 r""" … … 637 637 [(1, 0, -1), (1, -1, 0), (0, 1, -1), (0, 0, 0), (0, -1, 1), (-1, 1, 0), (-1, 0, 1)] 638 638 """ 639 639 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)) 641 641 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)) 643 643 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)) 645 645 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)) 647 647 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)) 649 649 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)) 651 651 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)) 653 653 else: 654 654 raise RuntimeError, "G2 crystal of letters element %d not valid"%self.value 655 655