# Assigning individual entries of a matrix

I have been using code as follows to compute fundamental weight representations of Lie groups inside $GL(25)$:

    D = lambda i: WeylCharacterRing("D{0}".format(i), style = "coroots")
for i in range(2,12):
fw = D(i).fundamental_weights()
deg = D(i)(fw).degree()
print deg


But now I am interested in going through and looking at all D(i)(fw[j]).degree() for i in range(1,12), j in range(1,len(fw))

Now this will be quite a set of numbers, so I am wondering how I can pick out the ones that give me 25 and then store the index of that matrix. Right now I have this:

import numpy
deg = numpy.zeros(12)
D = lambda i: WeylCharacterRing("D{0}".format(i), style = "coroots")
for i in range(2,12):
fw = D(i).fundamental_weights()
for j in range(1,len(fw)):
deg[i,j] = D(i)(fw[j]).degree()

print deg


But this doesn't work. Is my syntax off?

edit retag close merge delete

Sort by » oldest newest most voted

import numpy
deg = numpy.zeros(12)


by:

deg = matrix(ZZ,12)

more