Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 11 years ago

JoshIzzard gravatar image

How to store outputs from a function for later use

My function that I have written to compute the rank of fundamental representations is as follows:

# given a prime p, return all A_n representations of dimension = p^2
def rankrep(p):
    bound = p*p
    s = SymmetricFunctions(QQ).schur()
    Sym_p = s[p]
    A = lambda i: WeylCharacterRing("A{0}".format(i))
    deg = []
    index = []
    L = []
    for i in xrange(bound):
        deg.append([])
        fw = A(i+1).fundamental_weights()
        temp = A(i+1)
        for j in fw.keys():
            deg[i].append(temp(fw[j]).degree())
            if temp(fw[j]).degree() == bound:
                index.append('A'+str(i+1)+'(fw['+str(j)+'])')
                L.append(fw[j])
    return index, deg

But now if I call rankrep it does not let me store index or deg, it just prints them. I am wanting to also store the L variable I create as these are the weights that give me the desired dimension, and convert from these weights, which make up the highest weight Lambda=a1ω1++anωn (here Lambda is the high weight, ωi are the fundamental weights). The ωi have the form (1,1,,1,0,,0), and I would like to express my high weight as (a1++an1,a2++an1,,an1,0). However, since I am only considering one of the ai nonzero, this vector will look like (ai,ai,,ai,0,,0). I would like to store this vector, and then pass it as a partition to a schur function s that I define in the code.

How can I store these outputs and format them (i.e., data types, lists, dictionaries, vectors) so that I can then alter them as described and apply my schur function?