CoCalc Public Filesrowvacuation_root_posets.sagews
Author: Sam Hopkins
Views : 84
Compute Environment: Ubuntu 20.04 (Default)
def rowvacuation_ideal(P,I):
r = P.rank()
f = P.rank_function()
my_order_ideal = I
for i in range(r+1):
for j in range(r+1-i):
s = r+1-j-1
for x in P:
if f(x)==s:
my_order_ideal = P.order_ideal_toggle(my_order_ideal,x)
return my_order_ideal

def antichain_from_ideal(P,I):
return P.subposet(set(P).difference(set(I))).minimal_elements()

def antichain_size(P,I):
return len(antichain_from_ideal(P,I))

def antichain_toggle(P,A,x):
if x in A:
return list(set(A).difference(set([x])))
else:
flag=true
for y in A:
if (P.le(x,y) or P.le(y,x)):
flag=false
if flag:
return list(set(A).union(set([x])))
else:
return A

def rowvacuation_antichain(P,A):
r = P.rank()
f = P.rank_function()
my_antichain = A
for i in range(r+1):
for j in range(i,r+1):
for x in P:
if f(x)==j:
my_antichain = antichain_toggle(P,my_antichain,x)
return my_antichain

def root_poset_rvac_anti_size_test(R):
n=R.root_lattice().rank()
print("Root system: " + str(R))
P = R.root_poset()
error=[]
max_error = 0
num_errors = 0
totcount=0
for A in P.antichains_iterator():
totcount=totcount+1
B = rowvacuation_antichain(P,A)
m = len(A)+len(B)
if not(m==n):
if abs(m-n) >= max_error:
error += [(m,A,B)]
max_error=abs(m-n)
num_errors = num_errors + 1
print("Number of antichains of root poset: " + str(totcount))
print("Number of antichains for which #A + #Rvac(A) != rank: " + str(num_errors))
if (num_errors > 0):
print("An example of a failure: " + str(error[0]))

def root_poset_rvac_anti_size_test_oi(R):
n=R.root_lattice().rank()
print("Root system: " + str(R))
P = R.root_poset()
error=[]
num_errors = 0
totcount=0
for I in Q:
totcount=totcount+1
J = rowvacuation_ideal(P,I)
m = antichain_size(P,I)+antichain_size(P,J)
if not(m==n):
if (num_errors == 0):
error += [(m,I,J)]
num_errors = num_errors + 1
print("Number of antichains of root poset: " + str(totcount))
print("Number of antichains for which #A + #Rvac(A) != rank: " + str(num_errors))
if (num_errors > 0):
print("An example of a failure: " + str(error[0]))

def root_poset_rvac_fix_test(R):
print("Root system: " + str(R))
P = R.root_poset()
count1=0
count2=0
totcount=0
for A in P.antichains_iterator():
totcount=totcount+1
B = rowvacuation_antichain(P,A)
C = rowvacuation_antichain(P,P.order_ideal_complement_generators(A))
if set(A) == set(B):
count1 = count1+1
if set(A) == set(C):
count2 = count2+1
print("Number of antichains of root poset: " + str(totcount))
print("Number fixed by Rvac: " + str(count1))
print("Number fixed by Row^{-1}*Rvac: " + str(count2))

def root_poset_rvac_fix_test_oi(R):
print("Root system: " + str(R))
P = R.root_poset()
count1=0
count2=0
totcount=0
for I in Q:
totcount=totcount+1
J = rowvacuation_ideal(P,I)
K = rowvacuation_ideal(P,P.rowmotion(I))
if I == J:
count1 = count1+1
if I == K:
count2 = count2+1
print("Number of antichains of root poset: " + str(totcount))
print("Number fixed by Rvac: " + str(count1))
print("Number fixed by Row^{-1}*Rvac: " + str(count2))

def noncrossing_refl_fix_test(R):
W=R.root_lattice().weyl_group()
print("Weyl group: " + str(W))
Cmin = W.prod([W.simple_reflection(i) for i in W.coxeter_diagram().bipartite_sets()[0]])
Cplu = W.prod([W.simple_reflection(i) for i in W.coxeter_diagram().bipartite_sets()[1]])
C = Cmin*Cplu
P = list(W.absolute_order_ideal(gens=C))
print("Number of noncrossing partitions: " + str(len(P)))
count1 = 0
count2 = 0
for x in P:
y = Cmin*x.inverse()*Cmin.inverse()
z = C*y.inverse()
if x==y:
count1=count1+1
if x==z:
count2=count2+1
print("Number fixed by Refl: " + str(count1))
print("Number fixed by Krew*Refl: " + str(count2))

for n in range(2,9):
R = RootSystem(['A',n])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['A', 2] Number of antichains of root poset: 5 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 2] Number of antichains of root poset: 5 Number fixed by Rvac: 1 Number fixed by Row^{-1}*Rvac: 3 Root system: Root system of type ['A', 3] Number of antichains of root poset: 14 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 3] Number of antichains of root poset: 14 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 6 Root system: Root system of type ['A', 4] Number of antichains of root poset: 42 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 4] Number of antichains of root poset: 42 Number fixed by Rvac: 2 Number fixed by Row^{-1}*Rvac: 10 Root system: Root system of type ['A', 5] Number of antichains of root poset: 132 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 5] Number of antichains of root poset: 132 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 20 Root system: Root system of type ['A', 6] Number of antichains of root poset: 429 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 6] Number of antichains of root poset: 429 Number fixed by Rvac: 5 Number fixed by Row^{-1}*Rvac: 35 Root system: Root system of type ['A', 7] Number of antichains of root poset: 1430 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 7] Number of antichains of root poset: 1430 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 70 Root system: Root system of type ['A', 8] Number of antichains of root poset: 4862 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['A', 8] Number of antichains of root poset: 4862 Number fixed by Rvac: 14 Number fixed by Row^{-1}*Rvac: 126
for n in range(2,9):
R = RootSystem(['B',n])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['B', 2] Number of antichains of root poset: 6 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 2] Number of antichains of root poset: 6 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 4 Root system: Root system of type ['B', 3] Number of antichains of root poset: 20 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 3] Number of antichains of root poset: 20 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 8 Root system: Root system of type ['B', 4] Number of antichains of root poset: 70 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 4] Number of antichains of root poset: 70 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 16 Root system: Root system of type ['B', 5] Number of antichains of root poset: 252 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 5] Number of antichains of root poset: 252 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 32 Root system: Root system of type ['B', 6] Number of antichains of root poset: 924 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 6] Number of antichains of root poset: 924 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 64 Root system: Root system of type ['B', 7] Number of antichains of root poset: 3432 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 7] Number of antichains of root poset: 3432 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 128 Root system: Root system of type ['B', 8] Number of antichains of root poset: 12870 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['B', 8] Number of antichains of root poset: 12870 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 256
for n in range(3,9):
R = RootSystem(['D',n])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['D', 3] Number of antichains of root poset: 14 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 3] Number of antichains of root poset: 14 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 6 Root system: Root system of type ['D', 4] Number of antichains of root poset: 50 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 4] Number of antichains of root poset: 50 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 16 Root system: Root system of type ['D', 5] Number of antichains of root poset: 182 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 5] Number of antichains of root poset: 182 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 26 Root system: Root system of type ['D', 6] Number of antichains of root poset: 672 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 6] Number of antichains of root poset: 672 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 64 Root system: Root system of type ['D', 7] Number of antichains of root poset: 2508 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 7] Number of antichains of root poset: 2508 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 108 Root system: Root system of type ['D', 8] Number of antichains of root poset: 9438 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['D', 8] Number of antichains of root poset: 9438 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 256
R = RootSystem(['G',2])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['G', 2] Number of antichains of root poset: 8 Number of antichains for which #A + #Rvac(A) != rank: 0 Root system: Root system of type ['G', 2] Number of antichains of root poset: 8 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 4
R = RootSystem(['F',4])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['F', 4] Number of antichains of root poset: 105 Number of antichains for which #A + #Rvac(A) != rank: 8 An example of a failure: (3, [alpha[1] + 2*alpha[2] + 2*alpha[3] + 2*alpha[4]], [alpha[2] + 2*alpha[3] + alpha[4], alpha[1] + alpha[2] + alpha[3]]) Root system: Root system of type ['F', 4] Number of antichains of root poset: 105 Number fixed by Rvac: 1 Number fixed by Row^{-1}*Rvac: 17
R = RootSystem(['E',6])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['E', 6] Number of antichains of root poset: 833 Number of antichains for which #A + #Rvac(A) != rank: 24 An example of a failure: (5, [alpha[1] + alpha[2] + alpha[3] + 2*alpha[4] + alpha[5] + alpha[6]], [alpha[1] + alpha[3] + alpha[4] + alpha[5], alpha[2] + alpha[4] + alpha[5], alpha[2] + alpha[3] + alpha[4], alpha[3] + alpha[4] + alpha[5] + alpha[6]]) Root system: Root system of type ['E', 6] Number of antichains of root poset: 833 Number fixed by Rvac: 5 Number fixed by Row^{-1}*Rvac: 47
R = RootSystem(['E',7])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
#noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['E', 7] Number of antichains of root poset: 4160 Number of antichains for which #A + #Rvac(A) != rank: 354 An example of a failure: (9, [alpha[2] + alpha[3] + 2*alpha[4] + 2*alpha[5] + alpha[6], alpha[2] + alpha[4] + alpha[5] + alpha[6] + alpha[7], alpha[1] + alpha[2] + 2*alpha[3] + 2*alpha[4] + alpha[5], alpha[1] + alpha[2] + alpha[3] + alpha[4] + alpha[5] + alpha[6], alpha[1] + alpha[3] + alpha[4] + alpha[5] + alpha[6] + alpha[7]], [alpha[2] + alpha[3] + 2*alpha[4] + alpha[5] + alpha[6], alpha[2] + alpha[3] + alpha[4] + alpha[5] + alpha[6] + alpha[7], alpha[1] + alpha[3] + alpha[4] + alpha[5] + alpha[6] + alpha[7], alpha[1] + alpha[2] + 2*alpha[3] + 2*alpha[4] + alpha[5]]) Root system: Root system of type ['E', 7] Number of antichains of root poset: 4160 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 132
R = RootSystem(['E',8])
root_poset_rvac_anti_size_test(R)
print()
root_poset_rvac_fix_test(R)
##noncrossing_refl_fix_test(R)
print()

Root system: Root system of type ['E', 8] Number of antichains of root poset: 25080 Number of antichains for which #A + #Rvac(A) != rank: 4582 An example of a failure: (10, [2*alpha[1] + 2*alpha[2] + 3*alpha[3] + 4*alpha[4] + 3*alpha[5] + 2*alpha[6] + alpha[7], alpha[1] + alpha[2] + alpha[3] + 2*alpha[4] + 2*alpha[5] + 2*alpha[6] + 2*alpha[7] + alpha[8], alpha[1] + alpha[2] + 2*alpha[3] + 3*alpha[4] + 3*alpha[5] + 2*alpha[6] + alpha[7] + alpha[8], alpha[1] + 2*alpha[2] + 2*alpha[3] + 3*alpha[4] + 2*alpha[5] + alpha[6] + alpha[7] + alpha[8]], [alpha[2] + alpha[4] + alpha[5] + alpha[6] + alpha[7] + alpha[8], alpha[1] + alpha[2] + alpha[3] + 2*alpha[4] + alpha[5] + alpha[6], alpha[1] + alpha[3] + alpha[4] + alpha[5] + alpha[6] + alpha[7] + alpha[8], alpha[2] + alpha[3] + 2*alpha[4] + 2*alpha[5] + alpha[6], alpha[2] + alpha[3] + 2*alpha[4] + alpha[5] + alpha[6] + alpha[7], alpha[1] + alpha[2] + alpha[3] + alpha[4] + alpha[5] + alpha[6] + alpha[7]]) Root system: Root system of type ['E', 8] Number of antichains of root poset: 25080 Number fixed by Rvac: 14 Number fixed by Row^{-1}*Rvac: 278
def h3_poset():
return Poset({1:[4],2:[4,5],3:[5],4:[6,7],5:[7],6:[8,9],7:[9],8:[10],9:[10,11],10:[12],11:[12],12:[13],13:[14],14:[15]})

P = h3_poset()
n = 3
error=[]
num_errors = 0
totcount=0
for A in P.antichains_iterator():
totcount=totcount+1
B = rowvacuation_antichain(P,A)
m = len(A)+len(B)
if not(m==n):
if (num_errors == 0):
error += [(m,A,B)]
num_errors = num_errors + 1
print("Number of antichains of root poset: " + str(totcount))
print("Number of antichains for which #A + #Rvac(A) != rank: " + str(num_errors))
if (num_errors > 0):
print("An example of a failure: " + str(error[0]))

count1=0
count2=0
totcount=0
for A in P.antichains_iterator():
totcount=totcount+1
B = rowvacuation_antichain(P,A)
C = rowvacuation_antichain(P,P.order_ideal_complement_generators(A))
if set(A) == set(B):
count1 = count1+1
if set(A) == set(C):
count2 = count2+1
print("Number of antichains of root poset: " + str(totcount))
print("Number fixed by Rvac: " + str(count1))
print("Number fixed by Row^{-1}*Rvac: " + str(count2))

W=CoxeterGroup(['H',3])
print("Weyl group: " + str(W))
Cmin = W.prod([W.simple_reflection(i) for i in W.coxeter_diagram().bipartite_sets()[0]])
Cplu = W.prod([W.simple_reflection(i) for i in W.coxeter_diagram().bipartite_sets()[1]])
C = Cmin*Cplu
P = list(W.absolute_order_ideal(gens=C))
print("Number of noncrossing partitions: " + str(len(P)))
count1 = 0
count2 = 0
for x in P:
y = Cmin*x.inverse()*Cmin.inverse()
z = C*y.inverse()
if x==y:
count1=count1+1
if x==z:
count2=count2+1
print("Number fixed by Refl: " + str(count1))
print("Number fixed by Krew*Refl: " + str(count2))

Number of antichains of root poset: 32 Number of antichains for which #A + #Rvac(A) != rank: 0 Number of antichains of root poset: 32 Number fixed by Rvac: 0 Number fixed by Row^{-1}*Rvac: 8 Weyl group: Finite Coxeter group over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? with Coxeter matrix: [1 3 2] [3 1 5] [2 5 1] Number of noncrossing partitions: 32 Number fixed by Refl: 8 Number fixed by Krew*Refl: 0