ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 30 May 2013 07:37:25 -0500Problem getting indices to sync uphttp://ask.sagemath.org/question/10170/problem-getting-indices-to-sync-up/I'm not sure what is wrong with the following code:
# given a prime p, return all A_n representations of dimension = p^2
def rankrep(p):
bound = p**2
A = lambda i: WeylCharacterRing("A{0}".format(i), style = "coroots")
deg = []
for i in xrange(bound):
deg.append([])
fw = A(i+1).fundamental_weights()
temp = A(i+1)
for j in range(len(fw)):
deg[i].append(temp(fw[j]).degree())
return deg
But when I run it, it is unable to return anything, and tells me `Keyval Error 0`. Should I not be using `append` here?
I eventually hope to insert some `if` trees testing whether a given `temp(fw[j].degree() == p**2`, but I'm not sure how to pull those indices either. Any help would be greatly appreciated. Regards. JoshIzzardThu, 30 May 2013 07:37:25 -0500http://ask.sagemath.org/question/10170/