Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004
# create_permutation ############################################################### # input1: tuple containing one-line notation # output: the weyl group element corresponding to that one-line notation #################################################################################### def create_permutation(permutation): W = WeylGroup(['A',2]); for w in W: w1 = w.to_permutation(); if w1 == permutation: #print w1; break; return w ###################### End create_permutation ##################################################################### # monotone_increasing ############################################################################################# # This is a standard python function, checking if a list is monotonically increasing. #################################################################################################################### def monotone_increasing(lst): pairs = zip(lst, lst[1:]) return all(itertools.starmap(operator.le, pairs)) #################################################################################################################### # identify(vJ,w0) ################################################################################################## # input1: the permutation vJ # input2: the permutation w0 # output: the positions of the reduced word for vJ in w_0 #################################################################################################################### def identify(vJ,w0): list1=[]; for index2 in range(len(vJ)): list1.append([]); for index3 in range(len(w0)): #print w0[index3] if w0[index3]==vJ[index2]: list1[index2].append(index3) combinations_list=[[]] for x in list1: temp_list = [] for y in x: for i in combinations_list: temp_list.append(i+[y]) combinations_list = temp_list list2=[]; for item in combinations_list: if monotone_increasing(item) == True: list2.append(item) list2 return list2 # end identify(vJ,w0) ############################################################################################### # billeys_formula_summands(identify_output) ########################################################################## # input1: indentify_output, which is the list of positions of vJ in w0 in identify # input2: w - the permutation from p_v(w) # output: list of summands in Billey's formula for p_v(w) ###################################################################################################################### def billeys_formula_summands(identify_output,w0): prodlist=[] for index5 in range(len(identify_output)): #print "identify_output" , identify_output[index5] alphalist=[]; prodlist.append([]); for index in range(len(identify_output[index5])): alphalist.append([alpha[w0[identify_output[index5][index]]]]) for index1 in range(len(alphalist)): for index2 in range(identify_output[index5][index1]): alphalist[index1].append( s[w0[identify_output[index5][index1]-index2-1]](alphalist[index1][index2])); for index in range(len(alphalist)): #print alphalist[index][len(alphalist[index])-1] prodlist[index5].append(alphalist[index][len(alphalist[index])-1]) #print "index ", index5+1; #print " " return prodlist; # end billeys_formula_summands ########################################################################################## import itertools import operator def billeys_formula(v,w): #print R.dynkin_diagram(); # Just for kicks. It's cool that SAGE can do this! #print "longword", W.long_element().to_permutation(); #print "w0", w0 w0= create_permutation(w).reduced_word() vJ = create_permutation(v).reduced_word() #You really need to run through all reduced words all_reduced_words_for_v = create_permutation(v).reduced_words() #print "ALL REDUCED WORDS FOR V", all_reduced_words_for_v for v in all_reduced_words_for_v: #print "reduced word", v w0= create_permutation(w).reduced_word() identify_output= identify(v,w0); #print billeys_formula_summands(identify_output,w0) billeysformula = billeys_formula_summands(identify_output,w0) for index in range(len(billeysformula)): for item in billeysformula[index]: print '(', item ,')', print '-summand number', index return #print "Enter in the Lie type you would like to work in: e.g 'A', 'B', 'C', 'D' " #lie_type=input(); #print "Enter in the number of simple roots: e.g. 1,2,3,4,5," #n = input(); lie_type='A'; n = 4 W = WeylGroup([lie_type,n]) R = RootSystem([lie_type,n]) space = R.root_lattice() alpha = space.simple_roots(); s = space.simple_reflections(); #print "Enter in one-line notation for v as a tuple: e.g. v=(2,1,3,4)" v=(2,1,3,4,5); print "These are the formulas p_v(w) appearing the flow-up class of v=;", v; #billeys_formula(v,w); def flow_up_class(v): v1=list(v) for v2 in permutations(n+1): if v2==v1: break for w in v2.bruhat_greater(): w_tuple=tuple(w) print w_tuple billeys_formula(v,w_tuple) return flow_up_class(v);
WARNING: Output truncated!
These are the formulas p_v(w) appearing the flow-up class of v=; (2, 1, 3, 4, 5) (2, 1, 3, 4, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 1, 3, 5, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 1, 4, 3, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 1, 4, 5, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 1, 5, 3, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 1, 5, 4, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 1, 4, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 1, 5, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 4, 1, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 4, 5, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 5, 1, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 3, 5, 4, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 1, 3, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 1, 5, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 3, 1, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 3, 5, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 5, 1, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 4, 5, 3, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 1, 3, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 1, 4, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 3, 1, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 3, 4, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 4, 1, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (2, 5, 4, 3, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (3, 1, 2, 4, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (3, 1, 2, 5, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (3, 1, 4, 2, 5) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (3, 1, 4, 5, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (3, 1, 5, 2, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 ... (4, 5, 1, 2, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (4, 5, 1, 3, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (4, 5, 2, 1, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (4, 5, 2, 3, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (4, 5, 3, 1, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (4, 5, 3, 2, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 2, 3, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 2, 4, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 3, 2, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 3, 4, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 4, 2, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 1, 4, 3, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 1, 3, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 1, 4, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 3, 1, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 3, 4, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 4, 1, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 2, 4, 3, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 1, 2, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 1, 4, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 2, 1, 4) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 2, 4, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 4, 1, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 3, 4, 2, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 1, 2, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 1, 3, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 2, 1, 3) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 2, 3, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 3, 1, 2) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0 (5, 4, 3, 2, 1) ( alpha[2] ) ( alpha[1] + alpha[2] ) -summand number 0
# create_permutation ############################################################### # input1: tuple containing one-line notation # output: the weyl group element corresponding to that one-line notation #################################################################################### def create_permutation(permutation): W = WeylGroup(['A',2]); for w in W: w1 = w.to_permutation(); if w1 == permutation: #print w1; break; return w ###################### End create_permutation #####################################################################
[0 1 0] [0 0 1] [1 0 0]
# create_permutation ############################################################### # input1: tuple containing one-line notation # output: the weyl group element corresponding to that one-line notation #################################################################################### def create_permutation(permutation): W = WeylGroup(['A',2]); for w in W: w1 = w.to_permutation(); if w1 == permutation: #print w1; break; return w ###################### End create_permutation ##################################################################### # monotone_increasing ############################################################################################# # This is a standard python function, checking if a list is monotonically increasing. #################################################################################################################### def monotone_increasing(lst): pairs = zip(lst, lst[1:]) return all(itertools.starmap(operator.le, pairs)) #################################################################################################################### # identify(vJ,w0) ################################################################################################## # input1: the permutation vJ # input2: the permutation w0 # output: the positions of the reduced word for vJ in w_0 #################################################################################################################### def identify(vJ,w0): list1=[]; for index2 in range(len(vJ)): list1.append([]); for index3 in range(len(w0)): #print w0[index3] if w0[index3]==vJ[index2]: list1[index2].append(index3) combinations_list=[[]] for x in list1: temp_list = [] for y in x: for i in combinations_list: temp_list.append(i+[y]) combinations_list = temp_list list2=[]; for item in combinations_list: if monotone_increasing(item) == True: list2.append(item) list2 return list2 # end identify(vJ,w0) ############################################################################################### # billeys_formula_summands(identify_output) ########################################################################## # input1: indentify_output, which is the list of positions of vJ in w0 in identify # input2: w - the permutation from p_v(w) # output: list of summands in Billey's formula for p_v(w) ###################################################################################################################### def billeys_formula_summands(identify_output,w0): prodlist=[] for index5 in range(len(identify_output)): #print "identify_output" , identify_output[index5] alphalist=[]; prodlist.append([]); for index in range(len(identify_output[index5])): alphalist.append([alpha[w0[identify_output[index5][index]]]]) for index1 in range(len(alphalist)): for index2 in range(identify_output[index5][index1]): alphalist[index1].append( s[w0[identify_output[index5][index1]-index2-1]](alphalist[index1][index2])); for index in range(len(alphalist)): #print alphalist[index][len(alphalist[index])-1] prodlist[index5].append(alphalist[index][len(alphalist[index])-1]) #print "index ", index5+1; #print " " return prodlist; # end billeys_formula_summands ########################################################################################## import itertools import operator masterlist=[] def billeys_formula(v,w): #print R.dynkin_diagram(); # Just for kicks. It's cool that SAGE can do this! #print "longword", W.long_element().to_permutation(); #print "w0", w0 w0= create_permutation(w).reduced_word() vJ = create_permutation(v).reduced_word() #You really need to run through all reduced words all_reduced_words_for_v = create_permutation(v).reduced_words() #print "ALL REDUCED WORDS FOR V", all_reduced_words_for_v v=[1,2,1] #print "reduced word", v w0= create_permutation(w).reduced_word() identify_output= identify(v,w0); #print billeys_formula_summands(identify_output,w0) billeysformula = billeys_formula_summands(identify_output,w0) masterlist.append([list(W.long_element().to_permutation()),billeysformula]) #for index in range(len(billeysformula)): # for item in billeysformula[index]: # print '(', item ,')', return #print "Enter in the Lie type you would like to work in: e.g 'A', 'B', 'C', 'D' " #lie_type=input(); #print "Enter in the number of simple roots: e.g. 1,2,3,4,5," #n = input(); lie_type='A'; n = 2 W = WeylGroup([lie_type,n]) R = RootSystem([lie_type,n]) space = R.root_lattice() alpha = space.simple_roots(); s = space.simple_reflections(); #print "Enter in one-line notation for v as a tuple: e.g. v=(2,1,3,4)" v=(3,2,1); print "These are the formulas p_v(w) appearing the flow-up class of v=;", v; #billeys_formula(v,w); def flow_up_class(v): v1=list(v) for v2 in permutations(n+1): if v2==v1: break for w in v2.bruhat_greater(): w_tuple=tuple(w) print w_tuple billeys_formula(v,w_tuple) return flow_up_class(v); permutation = permutations(n+1) for index in range (factorial(n+1)-1): masterlist.append([permutation[index],0]) print masterlist
These are the formulas p_v(w) appearing the flow-up class of v=; (3, 2, 1) (3, 2, 1) [[[3, 2, 1], [[alpha[1], alpha[1] + alpha[2], alpha[2]]]], [[1, 2, 3], 0], [[1, 3, 2], 0], [[2, 1, 3], 0], [[2, 3, 1], 0], [[3, 1, 2], 0]]
print s[2](alpha[1])
alpha[1] + alpha[2]