Ticket #2853: 2853.1.patch
| File 2853.1.patch, 5.9 KB (added by bump, 2 years ago) |
|---|
-
sage/combinat/crystals/letters.py
diff -r 2b672817103a sage/combinat/crystals/letters.py
a b 142 142 """ 143 143 return self._digraph 144 144 145 146 145 def __contains__(self, x): 147 146 """ 148 147 EXAMPLES: … … 287 286 288 287 sage: C.check() 289 288 True 290 """ 289 290 """ 291 292 def weight(self): 293 """ 294 Returns the weight of self. 295 296 EXAMPLES: 297 sage: [v.weight() for v in CrystalOfLetters(['A',3])] 298 [(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)] 299 """ 300 return self._parent.weight_lattice_realization()._term(self.value-1) 301 291 302 def e(self, i): 292 303 r""" 293 304 Returns the action of $e_i$ on self. … … 331 342 sage: C.check() 332 343 True 333 344 """ 345 346 def weight(self): 347 """ 348 Returns the weight of self. 349 350 EXAMPLES: 351 sage: [v.weight() for v in CrystalOfLetters(['B',3])] 352 [(1, 0, 0), 353 (0, 1, 0), 354 (0, 0, 1), 355 (0, 0, 0), 356 (0, 0, -1), 357 (0, -1, 0), 358 (-1, 0, 0)] 359 """ 360 if self.value > 0: 361 return self._parent.weight_lattice_realization()._term(self.value-1) 362 elif self.value < 0: 363 return -self._parent.weight_lattice_realization()._term(-self.value-1) 364 else: 365 return self._parent.weight_lattice_realization()._free_module(0) 366 334 367 def e(self, i): 335 368 r""" 336 369 Returns the action of $e_i$ on self. … … 410 443 [False, False, False, False, False, False]] 411 444 sage: C.check() 412 445 True 413 414 """ 446 """ 447 448 def weight(self): 449 """ 450 Returns the weight of self. 451 452 EXAMPLES: 453 sage: [v.weight() for v in CrystalOfLetters(['C',3])] 454 [(1, 0, 0), (0, 1, 0), (0, 0, 1), (0, 0, -1), (0, -1, 0), (-1, 0, 0)] 455 456 """ 457 if self.value > 0: 458 return self._parent.weight_lattice_realization()._term(self.value-1) 459 elif self.value < 0: 460 return -self._parent.weight_lattice_realization()._term(-self.value-1) 461 else: 462 return self._parent.weight_lattice_realization()._free_module(0) 463 415 464 def e(self, i): 416 465 r""" 417 466 Returns the action of $e_i$ on self. … … 472 521 [1, 2, 3, 4, -4, -3, -2, -1] 473 522 sage: C.check() 474 523 True 475 """ 524 525 """ 526 527 def weight(self): 528 """ 529 Returns the weight of self. 530 531 EXAMPLES: 532 sage: [v.weight() for v in CrystalOfLetters(['D',4])] 533 [(1, 0, 0, 0), 534 (0, 1, 0, 0), 535 (0, 0, 1, 0), 536 (0, 0, 0, 1), 537 (0, 0, 0, -1), 538 (0, 0, -1, 0), 539 (0, -1, 0, 0), 540 (-1, 0, 0, 0)] 541 """ 542 if self.value > 0: 543 return self._parent.weight_lattice_realization()._term(self.value-1) 544 elif self.value < 0: 545 return -self._parent.weight_lattice_realization()._term(-self.value-1) 546 else: 547 return self._parent.weight_lattice_realization()._free_module(0) 548 476 549 def e(self, i): 477 550 r""" 478 551 Returns the action of $e_i$ on self. … … 552 625 sage: C.check() 553 626 True 554 627 """ 628 629 def weight(self): 630 """ 631 Returns the weight of self. 632 633 EXAMPLES: 634 sage: [v.weight() for v in CrystalOfLetters(['G',2])] 635 [(1, 0, -1), (1, -1, 0), (0, 1, -1), (0, 0, 0), (0, -1, 1), (-1, 1, 0), (-1, 0, 1)] 636 """ 637 if self.value == 1: 638 return self._parent.weight_lattice_realization()._free_module((1, 0, -1)) 639 elif self.value == 2: 640 return self._parent.weight_lattice_realization()._free_module((1, -1, 0)) 641 elif self.value == 3: 642 return self._parent.weight_lattice_realization()._free_module((0, 1, -1)) 643 elif self.value == 0: 644 return self._parent.weight_lattice_realization()._free_module((0, 0, 0)) 645 elif self.value == -3: 646 return self._parent.weight_lattice_realization()._free_module((0, -1, 1)) 647 elif self.value == -2: 648 return self._parent.weight_lattice_realization()._free_module((-1, 1, 0)) 649 elif self.value == -1: 650 return self._parent.weight_lattice_realization()._free_module((-1, 0, 1)) 651 else: 652 raise RuntimeError, "G2 crystal of letters element %d not valid"%self.value 653 555 654 def e(self, i): 556 655 r""" 557 656 Returns the action of $e_i$ on self. -
sage/combinat/crystals/tensor_product.py
diff -r 2b672817103a sage/combinat/crystals/tensor_product.py
a b 235 235 else: 236 236 self.module_generators = [ self(*x) for x in options['generators']] 237 237 238 239 238 def __call__(self, *args): 240 239 """ 241 240 EXAMPLES: … … 272 271 k = position[0] 273 272 return self.set_index(k, self[k].e(i)) 274 273 274 def weight(self): 275 """ 276 Returns the weight of self. 277 278 EXAMPLES: 279 sage: C = CrystalOfLetters(['A',3]) 280 sage: T = TensorProductOfCrystals(C,C) 281 sage: T(C(1),C(2)).weight() 282 (1, 1, 0, 0) 283 """ 284 return sum(self[j].weight() for j in range(len(self))) 285 275 286 def f(self, i): 276 287 """ 277 288 Returns the action of $f_i$ on self.
