Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unsure why the 0 values error keeps coming up

I am trying to code an algorithm to find the degrees of all small rank representations of $A_n$ that are equal to $p^2$ for some prime $p$. However, I think that my code should be correct, but it keeps giving me the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_24.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("W2ZuYW1lLCBjbmFtZV0gPSBBX2NvbWIycmVwKDMp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmp2u4eia/___code___.py", line 3, in <module>
    exec compile(u'[fname, cname] = A_comb2rep(_sage_const_3 )
  File "", line 1, in <module>

ValueError: need more than 0 values to unpack

The code for which it gives me this error is the following:

def A_comb2rep(p):
bound = p*p
name_fund = []
name_comb = []
A = lambda i: WeylCharacterRing("A{0}".format(i))
for i in range(bound):
    for k in range(1,bound+1):
        fw = A(i+1).fundamental_weights()
        if A(i+1)(k * fw[1]).degree > bound:
            break
        else:
            for v in fw:
                if A(i+1)(k * v).degree() == bound:
                    name_fund.append([])
                    name_fund[len(name_fund)-1].append('A'+str(i+1)+'('str(k)+str(v)+')')
return name_fund
for i in range(bound): # now onto combinations of two of the fws   #####
    for k in fw:
        fw = A(i+1).fundamental_weights()
        if A(i+1)(fw[1] + fw[2]).degree() > bound:
            break
        else:
            for j in fw:
                rep = A(i+1)(j+k)
                deg = rep.degree()
                if deg == bound:
                    name_comb.append([])
                    name_comb[len(name_comb)-1].append('A'+str(i+1)+'['+str(j)+'+'+str(k)+']')
return name_comb

A helpful answer would be one that answers: What does ValueError: need more than 0 values to unpack mean and where should I look for tips on how to fix it.

Many thanks for your time.

Unsure why the 0 values error keeps coming up

I am trying to code an algorithm to find the degrees of all small rank representations of $A_n$ that are equal to $p^2$ for some prime $p$. However, I think that my code should be correct, but it keeps giving me the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_24.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("W2ZuYW1lLCBjbmFtZV0gPSBBX2NvbWIycmVwKDMp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmp2u4eia/___code___.py", line 3, in <module>
    exec compile(u'[fname, cname] = A_comb2rep(_sage_const_3 )
  File "", line 1, in <module>

ValueError: need more than 0 values to unpack

The code for which it gives me this error is the following:

def A_comb2rep(p):
bound = p*p
name_fund = []
name_comb = []
A = lambda i: WeylCharacterRing("A{0}".format(i))
for i in range(bound):
    for k in range(1,bound+1):
        fw = A(i+1).fundamental_weights()
        if A(i+1)(k * fw[1]).degree > bound:
            break
        else:
            for v in fw:
                if A(i+1)(k * v).degree() == bound:
                    name_fund.append([])
                    name_fund[len(name_fund)-1].append('A'+str(i+1)+'('str(k)+str(v)+')')
return name_fund
for i in range(bound): # now onto combinations of two of the fws   #####
    for k in fw:
        fw = A(i+1).fundamental_weights()
        if A(i+1)(fw[1] + fw[2]).degree() > bound:
            break
        else:
            for j in fw:
                rep = A(i+1)(j+k)
                deg = rep.degree()
                if deg == bound:
                    name_comb.append([])
                    name_comb[len(name_comb)-1].append('A'+str(i+1)+'['+str(j)+'+'+str(k)+']')
return name_comb
name_comb, name_fund

A helpful answer would be one that answers: What does ValueError: need more than 0 values to unpack mean and where should I look for tips on how to fix it.

Many thanks for your time.