def checkerA12inE8(l,basis,orderList):
    print("Checking if conjugate to any of the complete ones:")
    print(checker(l,basis,orderList))

    #These are two two cases where we do not know lambda5: cases 28 and 29
    l28=[(4,), (4,), (0,), (0,)]
    l29=[(5,), (5,)]
    L28=[]
    L28=L28+concat([(0,)],wedge2(l28))
    L28=L28+[(2,0)]
    
    L29=[]
    L29=L29+concat([(0,)],wedge2(l29))
    L29=L29+[(2,0)]

    basisTemp=[[(0)]]
    basisTemp.append(l)
    print("Conjugate to case 28?")
    print(classifyIncomplete(L28,basisTemp,orderList2))
    if len(classifyIncomplete(L28,basisTemp,orderList2))>1:
        print("YES")
    print("Conjugate to case 29?")
    print(classifyIncomplete(L29,basisTemp,orderList2))
    if len(classifyIncomplete(L29,basisTemp,orderList2))>1:
        print("YES")
#Check lambda5??
lambda1.append([(8,), (0,), (0,), (0,)])
lambda5.append(expand("[(10,)^2/(4,)^2]"))

#What is lambda5??
lambda1.append([(4,), (4,), (0,), (0,)])
lambda5.append(expand("[(6,)^2/(4,)^2/(2,)^2/(0,)^2]"))

#What is the spin here?
lambda1.append([(5,), (5,)])
lambda5.append(expand("[(8,)^2/(4,)^2/(0,)^4]"))


for i in range(1,len(lambda1)):
    lambda2.append(wedge2(lambda1[i]))
    #print(dimChecker(lambda2[i]))


orderList2=order(2)
L=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
for i in range(1,len(lambda1)):
    L[i]=[]
    L[i]=L[i]+concat([(0,)],lambda2[i])
    L[i]=L[i]+[(2,0)]
    L[i]=L[i]+concat([(1,)],lambda5[i])
    x=checker(L[i],basisA12,orderList2)
 #   print("///////////////////////////////")
 #   print(i)
 #   print(x)
    basisA12.append(L[i])
lambda1.append([(4,), (4,), (0,), (0,)])
lambda5.append(expand("[(6,)^2/(4,)^2/(2,)^2/(0,)^2]"))
lambda4.append(expand("[(6,)^2/(4,)^2/(2,)^2/(0,)^2]"))

#What is the spin here?
lambda1.append([(5,), (5,)])
lambda5.append(expand("[(8,)^2/(4,)^2/(0,)^4]"))
lambda4.append(expand("[(5,)^3/(9,)/(3,)]"))

#What is the spin here?
lambda1.append([(5,), (5,)])
lambda5.append(expand("[(5,)^3/(9,)/(3,)]"))
lambda4.append(expand("[(8,)^2/(4,)^2/(0,)^4]"))

for i in range(1,len(lambda1)):
    lambda2.append(wedge2(lambda1[i]))
    #print(dimChecker(lambda2[i]))



orderList3=order(3)
basisA13=[[0]]
basisA13Lambda1=[[0]]

for i in range(1,38):
    print("case i")
    LE8[i]=[]
    LE8[i]=concat([(1,1)],lambda1[i])
    LE8[i]=LE8[i]+concat([(1,0)],lambda4[i])
    LE8[i]=LE8[i]+[(2,0,0),(0,2,0)]
    LE8[i]=LE8[i]+concat([(0,0)],lambda2[i])
e=[0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0]


d[1]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,0,1,1)/(0,0,0,0,0,0)^4]")
d[2]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,0,1,1)^2]")
d[3]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,0,1,1)/(1,0,1,0,0,0)]")
d[4]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,0,1,1)/(0,0,0,0,0,1)^2]")
d[5]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,1,1,0)/(0,0,0,0,0,1)^2]")
d[6]=expand("[(1,1,0,0,0,0)/(0,0,1,1,0,0)/(0,0,0,0,1,0)^2/(0,0,0,0,0,1)^2]")
d[7]=expand("[(1,0,0,0,0,0)^2/(0,1,1,0,0,0)/(0,0,0,1,1,0)/(0,0,0,0,0,2)/(0,0,0,0,0,0)]")
d[8]=expand("[(1,1,0,0,0,0)/(0,1,1,0,0,0)/(0,0,0,1,1,0)/(0,0,0,0,0,2)/(0,0,0,0,0,0)]")
d[9]=expand("[(1,0,0,0,0,1)/(0,1,1,0,0,0)/(0,0,0,1,1,0)/(0,0,0,0,0,2)/(0,0,0,0,0,0)]")


for i in range(1,10):
        sol[i]= wedge2(d[i])
        
#Original : e[2]=expand("[(1,0,1,0,1,0,0,1)/(1,0,1,0,0,1,1,0)/(1,0,0,1,1,0,1,0)/(1,0,0,1,0,1,0,1)/(0,1,1,0,1,0,0,1)/(0,1,1,0,0,1,1,0)/(0,1,0,1,1,0,1,0)/(0,1,0,1,0,1,0,1)/()]")

e[1]=expand("[(1,0,1,0,1,0)^2/(1,0,1,0,0,1)^2/(1,0,0,1,1,0)^2/(1,0,0,1,0,1)^2/(0,1,1,0,1,0)^2/(0,1,1,0,0,1)^2/(0,1,0,1,1,0)^2/(0,1,0,1,0,1)^2]")
e[2]=expand("[(1,0,1,0,1,1)/(1,0,1,0,1,1)/(1,0,0,1,2,0)/(1,0,0,1,0,0)/(1,0,0,1,0,2)/(1,0,0,1,0,0)/(0,1,1,0,1,1)/(0,1,1,0,1,1)/(0,1,0,1,2,0)/(0,1,0,1,0,0)/(0,1,0,1,0,2)/(0,1,0,1,0,0)]")


e[3]=expand("[(1,0,2,0,1,0)/(1,0,0,0,1,0)/(2,0,1,0,0,1)/(0,0,1,0,0,1)/(2,0,0,1,1,0)/(0,0,0,1,1,0)/(1,0,1,1,0,1)/(0,1,2,0,1,0)/(0,1,0,0,1,0)/(1,1,1,0,0,1)/(1,1,0,1,1,0)/(0,1,1,1,0,1)]")



#e[4]=expand("[()/()/()/()/()/()/()/()]")


from compare import classifyIncomplete
#from compare import classifyIncomplete2
from compare import classify
from compare import perm
from tensor_wedge import concat
from remove_tensor_A1 import removeFirstA1
from remove_tensor_A1 import removeA1
from remove_tensor_A1 import diagA1
from tensor_wedge import printLE8
from tensor_wedge import tensor


print("A_1^4 in D5")
a=[(1,1,0,0),(0,0,1,1),(0,0,0,0),(0,0,0,0)]
b=[(1,1,0,0),(0,0,2,0),(0,0,0,2),(0,0,0,0)]
print(latex(wedge2(a)))
print(latex(wedge2(b)))



print("A_1^3 in D5")
lam=[0]
lam.append(expand("[(1,1,0)/(0,1,1)/(0,0,0)^2]"))
lam.append(expand("[(1,1,0)/(0,0,1)^2/(0,0,0)^2]"))
lam.append(expand("[(1,1,0)/(0,0,2)/(0,0,0)^3]"))
lam.append(expand("[(1,1,0)/(0,0,2)^2]"))
lam.append(expand("[(1,1,0)/(2,0,0)/(0,0,2)]"))
lam.append(expand("[(1,1,0)/(0,0,4)/(0,0,0)]"))
lam.append(expand("[(1,0,0)^2/(0,2,0)/(0,0,2)]"))
lam.append(expand("[(2,0,0)/(0,2,0)/(0,0,2)/(0,0,0)]"))
print(len(lam))