# Ticket #5794: trac_5794-revised.patch

File trac_5794-revised.patch, 71.4 KB (added by bump, 13 years ago)
• ## sage/combinat/crystals/crystals.py

# HG changeset patch
# User Daniel Bump <bump@match.stanford.edu>
# Date 1241641059 25200
# Parent  11e58081efbf19a8f073d4c08c4f3f913d62de35
Reducible root system fixes and branching rule improvements

diff --git a/sage/combinat/crystals/crystals.py b/sage/combinat/crystals/crystals.py
 a sage: C = CrystalOfLetters(['A',2]) sage: T = TensorProductOfCrystals(C, C) sage: A2 = WeylCharacterRing(C.cartan_type()); A2 The Weyl Character Ring of Type [A,2] with Integer Ring coefficients The Weyl Character Ring of Type ['A', 2] with Integer Ring coefficients sage: chi = T.character(A2); chi A2(1,1,0) + A2(2,0,0) sage: chi.check(verbose = true)
• ## sage/combinat/root_system/cartan_type.py

diff --git a/sage/combinat/root_system/cartan_type.py b/sage/combinat/root_system/cartan_type.py
 a assert(len(t) == 2) assert(t[0] in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']) assert(t[1] in ZZ and t[1] >= 0) if t[0] in ['B', 'C']: if t[0] == 'D': assert(t[1] >= 2) if t[0] == 'D': assert(t[1] >= 3) if t[0] == 'E': assert(t[1] <= 8) assert(t[1] <= 8 and t[1] >= 6) if t[0] == 'F': assert(t[1] <= 4) assert(t[1] == 4) if t[0] == 'G': assert(t[1] <= 2) assert(t[1] == 2) if t[0] == 'H': assert(t[1] <= 4)
• ## sage/combinat/root_system/type_A.py

diff --git a/sage/combinat/root_system/type_A.py b/sage/combinat/root_system/type_A.py
 a """ return self.sum(self.term(j) for j in range(i)) def det(self, k=1): """ returns the vector (1, ... ,1) which in the ['A',r] weight lattice, interpreted as a weight of GL(r+1,CC) is the determinant. If the optional parameter k is given, returns (k, ... ,k), the k-th power of the determinant. EXAMPLES: sage: e = RootSystem(['A',3]).ambient_space() sage: e.det(1/2) (1/2, 1/2, 1/2, 1/2) """ return self.sum(self.term(j)*k for j in range(self.n)) def dynkin_diagram(t): """ Returns the graph corresponding to the Dynkin diagram
• ## sage/combinat/root_system/type_reducible.py

diff --git a/sage/combinat/root_system/type_reducible.py b/sage/combinat/root_system/type_reducible.py
 a from sage.matrix.constructor import block_diagonal_matrix from ambient_space import AmbientSpace import sage.combinat.root_system as root_system from sage.combinat.family import Family class CartanType(CartanType_abstract): r""" self.affine = False self._spaces = [t.root_system().ambient_space() for t in types] self._shifts = [sum(l.n for l in self._spaces[:k]) for k in range(len(types))] # fails for dual root systems try: self._shifts.append(sum(t.root_system().ambient_space().dimension() for t in types)) except: pass self._rshifts = [sum(l[1] for l in types[:k]) for k in range(len(types))] self.tools = root_system.type_reducible EXAMPLES: sage: RootSystem("A2xB2").ambient_space() Ambient space of the Root system of type A2xB2 """ def cartan_type(self): """ def simple_roots(self): """ EXAMPLES: sage: RootSystem("A1xA2").ambient_space().simple_roots() [(1, -1, 0, 0, 0), (0, 0, 1, -1, 0), (0, 0, 0, 1, -1)] sage: RootSystem("A1xB2").ambient_space().simple_roots() Finite family {1: (1, -1, 0, 0), 2: (0, 0, 1, -1), 3: (0, 0, 0, 1)} """ res = [] for i, ambient_space in enumerate(self.ambient_spaces()): res.extend(self.inject_weights(i, v) for v in ambient_space.simple_roots()) return res return Family(dict([i,res[i-1]] for i in range(1,len(res)+1))) def simple_coroots(self): """ EXAMPLES: sage: RootSystem("A1xB2").ambient_space().simple_coroots() Finite family {1: (1, -1, 0, 0), 2: (0, 0, 1, -1), 3: (0, 0, 0, 2)} """ cr = [] for i, ambient_space in enumerate(self.ambient_spaces()): cr.extend(self.inject_weights(i, v) for v in ambient_space.simple_coroots()) return Family(dict([i,cr[i-1]] for i in range(1,len(cr)+1))) def positive_roots(self): """ """ EXAMPLES: sage: RootSystem("A2xB2").ambient_space().fundamental_weights() [(1, 0, 0, 0, 0), (1, 1, 0, 0, 0), (0, 0, 0, 1, 0), (0, 0, 0, 1/2, 1/2)] Finite family {1: (1, 0, 0, 0, 0), 2: (1, 1, 0, 0, 0), 3: (0, 0, 0, 1, 0), 4: (0, 0, 0, 1/2, 1/2)} """ ret = [] fw = [] for i, ambient_space in enumerate(self.ambient_spaces()): ret.extend(self.inject_weights(i, v) for v in ambient_space.fundamental_weights()) return ret fw.extend(self.inject_weights(i, v) for v in ambient_space.fundamental_weights()) return Family(dict([i,fw[i-1]] for i in range(1,len(fw)+1))) def dynkin_diagram(t): """
• ## sage/combinat/root_system/weyl_characters.py

diff --git a/sage/combinat/root_system/weyl_characters.py b/sage/combinat/root_system/weyl_characters.py