def __classcall_private__(cls, cartan_type, r, s): """ Normalize the input arguments to ensure unique representation. EXAMPLES:: sage: KRT1 = KirillovReshetikhinTableaux(CartanType(['A',3,1]), 2, 3) sage: KRT2 = KirillovReshetikhinTableaux(['A',3,1], 2, 3) sage: KRT1 is KRT2 True """ ct = CartanType(cartan_type) assert ct.is_affine() if ct.is_untwisted_affine(): if ct.letter == 'D': if r == ct.n or r == ct.n - 1: return KRTableauxSpin(ct, r, s) return KRTableauxTypeVertical(ct, r, s) if ct.letter == 'B': if r == ct.n: return KRTableauxBn(ct, r, s) return KRTypeVertical(ct, r, s) if ct.letter == 'A' or (ct.letter == 'C' and r == ct.n): return KRTableauxRectangle(ct, r, s) else: if ct.dual().letter == 'B': return KRTableauxTypeVertical(ct, r, s) raise NotImplementedError
def find_cartan_type_from_matrix(CM): r""" Find a Cartan type by direct comparison of Dynkin diagrams given from the generalized Cartan matrix ``CM`` and return ``None`` if not found. INPUT: - ``CM`` -- a generalized Cartan matrix EXAMPLES:: sage: from sage.combinat.root_system.cartan_matrix import find_cartan_type_from_matrix sage: CM = CartanMatrix([[2,-1,-1], [-1,2,-1], [-1,-1,2]]) sage: find_cartan_type_from_matrix(CM) ['A', 2, 1] sage: CM = CartanMatrix([[2,-1,0], [-1,2,-2], [0,-1,2]]) sage: find_cartan_type_from_matrix(CM) ['C', 3] relabelled by {1: 0, 2: 1, 3: 2} sage: CM = CartanMatrix([[2,-1,-2], [-1,2,-1], [-2,-1,2]]) sage: find_cartan_type_from_matrix(CM) """ types = [] for S in CM.dynkin_diagram().connected_components_subgraphs(): S = DiGraph(S) # We need a simple digraph here n = S.num_verts() # Build the list to test based upon rank if n == 1: types.append(CartanType(['A', 1])) continue test = [['A', n]] if n >= 2: if n == 2: test += [['G', 2], ['A', 2, 2]] test += [['B', n], ['A', n - 1, 1]] if n >= 3: if n == 3: test.append(['G', 2, 1]) test += [['C', n], ['BC', n - 1, 2], ['C', n - 1, 1]] if n >= 4: if n == 4: test.append(['F', 4]) test += [['D', n], ['B', n - 1, 1]] if n >= 5: if n == 5: test.append(['F', 4, 1]) test.append(['D', n - 1, 1]) if n == 6: test.append(['E', 6]) elif n == 7: test += [['E', 7], ['E', 6, 1]] elif n == 8: test += [['E', 8], ['E', 7, 1]] elif n == 9: test.append(['E', 8, 1]) # Test every possible Cartan type and its dual found = False for x in test: ct = CartanType(x) T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True) if iso: types.append(ct.relabel(match)) found = True break if ct == ct.dual(): continue # self-dual, so nothing more to test ct = ct.dual() T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True) if iso: types.append(ct.relabel(match)) found = True break if not found: return None return CartanType(types)
def find_cartan_type_from_matrix(CM): """ Find a Cartan type by direct comparison of matrices given from the generalized Cartan matrix ``CM`` and return ``None`` if not found. INPUT: - ``CM`` -- A generalized Cartan matrix EXAMPLES:: sage: from sage.combinat.root_system.cartan_matrix import find_cartan_type_from_matrix sage: M = matrix([[2,-1,-1], [-1,2,-1], [-1,-1,2]]) sage: find_cartan_type_from_matrix(M) ['A', 2, 1] sage: M = matrix([[2,-1,0], [-1,2,-2], [0,-1,2]]) sage: find_cartan_type_from_matrix(M) ['C', 3] sage: M = matrix([[2,-1,-2], [-1,2,-1], [-2,-1,2]]) sage: find_cartan_type_from_matrix(M) """ n = CM.ncols() # Build the list to test based upon rank if n == 1: return CartanType(['A', 1]) test = [['A', n]] if n >= 2: if n == 2: test += [['G',2], ['A',2,2]] test += [['B',n], ['A',n-1,1]] if n >= 3: if n == 3: test += [['G',2,1], ['D',4,3]] test += [['C',n], ['BC',n-1,2], ['C',n-1,1]] if n >= 4: if n == 4: test += [['F',4], ['G',2,1], ['D',4,3]] test += [['D',n], ['B',n-1,1]] if n == 5: test += [['F',4,1], ['D',n-1,1]] elif n == 6: test.append(['E',6]) elif n == 7: test += [['E',7], ['E',6,1]] elif n == 8: test += [['E',8], ['E',7,1]] elif n == 9: test.append(['E',8,1]) # Test every possible Cartan type and its dual for x in test: ct = CartanType(x) if ct.cartan_matrix() == CM: return ct if ct == ct.dual(): continue ct = ct.dual() if ct.cartan_matrix() == CM: return ct return None
def find_cartan_type_from_matrix(CM): r""" Find a Cartan type by direct comparison of Dynkin diagrams given from the generalized Cartan matrix ``CM`` and return ``None`` if not found. INPUT: - ``CM`` -- a generalized Cartan matrix EXAMPLES:: sage: from sage.combinat.root_system.cartan_matrix import find_cartan_type_from_matrix sage: CM = CartanMatrix([[2,-1,-1], [-1,2,-1], [-1,-1,2]]) sage: find_cartan_type_from_matrix(CM) ['A', 2, 1] sage: CM = CartanMatrix([[2,-1,0], [-1,2,-2], [0,-1,2]]) sage: find_cartan_type_from_matrix(CM) ['C', 3] relabelled by {1: 0, 2: 1, 3: 2} sage: CM = CartanMatrix([[2,-1,-2], [-1,2,-1], [-2,-1,2]]) sage: find_cartan_type_from_matrix(CM) """ types = [] for S in CM.dynkin_diagram().connected_components_subgraphs(): S = DiGraph(S) # We need a simple digraph here n = S.num_verts() # Build the list to test based upon rank if n == 1: types.append(CartanType(['A', 1])) continue test = [['A', n]] if n >= 2: if n == 2: test += [['G',2], ['A',2,2]] test += [['B',n], ['A',n-1,1]] if n >= 3: if n == 3: test.append(['G',2,1]) test += [['C',n], ['BC',n-1,2], ['C',n-1,1]] if n >= 4: if n == 4: test.append(['F',4]) test += [['D',n], ['B',n-1,1]] if n >= 5: if n == 5: test.append(['F',4,1]) test.append(['D',n-1,1]) if n == 6: test.append(['E',6]) elif n == 7: test += [['E',7], ['E',6,1]] elif n == 8: test += [['E',8], ['E',7,1]] elif n == 9: test.append(['E',8,1]) # Test every possible Cartan type and its dual found = False for x in test: ct = CartanType(x) T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True) if iso: types.append(ct.relabel(match)) found = True break if ct == ct.dual(): continue # self-dual, so nothing more to test ct = ct.dual() T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True) if iso: types.append(ct.relabel(match)) found = True break if not found: return None return CartanType(types)