Ask Your Question

# 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[1]).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

## 1 answer

Sort by ยป oldest newest most voted

What about replacing:

import numpy
deg = numpy.zeros(12)


by:

deg = matrix(ZZ,12)

more

## Comments

Worked great thanks!

( 2013-05-20 11:36:20 -0600 )edit

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2013-05-20 10:00:35 -0600

Seen: 119 times

Last updated: May 20 '13