Ask Your Question

JoshIzzard's profile - activity

2023-11-05 11:59:37 +0200 received badge  Nice Question (source)
2023-09-05 06:04:59 +0200 received badge  Notable Question (source)
2023-09-05 06:04:59 +0200 received badge  Popular Question (source)
2023-06-22 04:57:26 +0200 received badge  Notable Question (source)
2023-02-09 02:14:50 +0200 received badge  Notable Question (source)
2023-02-09 02:14:50 +0200 received badge  Popular Question (source)
2022-12-31 10:14:03 +0200 received badge  Notable Question (source)
2022-12-31 10:14:03 +0200 received badge  Popular Question (source)
2022-10-26 21:25:49 +0200 received badge  Notable Question (source)
2022-10-26 21:25:49 +0200 received badge  Popular Question (source)
2021-06-11 09:52:16 +0200 received badge  Famous Question (source)
2021-01-21 15:32:53 +0200 received badge  Popular Question (source)
2020-06-20 15:50:06 +0200 received badge  Notable Question (source)
2020-06-20 15:50:06 +0200 received badge  Popular Question (source)
2020-04-21 16:17:10 +0200 received badge  Popular Question (source)
2017-07-07 22:18:23 +0200 received badge  Popular Question (source)
2014-06-29 18:55:40 +0200 received badge  Famous Question (source)
2014-06-29 18:55:40 +0200 received badge  Popular Question (source)
2014-06-29 18:55:40 +0200 received badge  Notable Question (source)
2014-06-29 03:15:41 +0200 marked best answer Plethysym as composition of functions

On this page the plethysym function is described as "composition of functions". Is this implying that writing s[2](s[lambda]) for some other partition $\lambda$ is like taking the symmetric square of the schur function corresponding to $\lambda$?

2014-06-29 03:15:40 +0200 marked best answer Pulling the index of an entry of a matrix

Let $M$ be some matrix, then I am looking for how to find out which entries of $M$ make the statement M[i,j] == 25 true. Specifically, this is the code I'm using to generate the matrix, called deg:

deg = matrix(ZZ, 15)
A = lambda i: WeylCharacterRing("A{0}".format(i), style = "coroots")
for i in range(1,15):
    fw = A(i).fundamental_weights()
    for j in range(1,len(fw)):
        deg[i,j] = A(i)(fw[j]).degree()


print deg

It works great, but now instead of printing deg and finding the entries manually, I would like to be able to store which entries [i,j] of deg are equal to 25 in some list, and then print that list, which would ideally look something like:

list(tfentry)
{ (2,3), (4,4) }

etc.

Any tips on where to look or help files to examine?

Thanks very much.

2014-06-29 03:15:40 +0200 marked best answer 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?

2014-06-29 03:15:40 +0200 marked best answer How to define multiple WeylCharacterRings at one time

I am trying to use a script like the one below (to use a simplistic version)

for i in [1..4]:
    B"i" = WeylCharacterRing("Bi")

to define multiple Weyl character rings at one time. I then am hoping to go through, and compute the degrees of the representation corresponding to the weight (1,1,1,...,1) depending on which B$i$ I am considering i.e., for $B4$ I would want to calculate

B4(1,1,1,1).degree()

(its $126$). How can I go about automating this in some way? Any tips or reference materials?

Thanks for your time.

2014-06-29 03:15:40 +0200 marked best answer How to find instances where $d(a,b) = p^2$ for $p$ a prime

Suppose I have a dimension formula (for a Lie algebra representation) given by $\mathrm{dim}_{a,b} = {(a+1)(b+1)(a+b+2) \over 2}$. I now would like to find pairs $(a,b)$ where $\dim_{a,b} = p^2$ for $p$ a prime? What are some techniques for accomplishing this? Should I first filter out a list of primes using isprime and then check possible pairs $(a,b)$ for each prime $p < N$, say $1000$.

2014-06-29 03:14:42 +0200 marked best answer 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.

2013-06-17 16:02:36 +0200 asked a question How to see the documentation for a Sage function

I am looking for the documentation (i.e., the source code) of invariant_degree() in the Weyl Character Rings module. I have looked through that website pretty extensively, but I think I am looking in the wrong place?

2013-06-13 11:57:57 +0200 asked a question Generating permutations of coefficients

I have created the following function to return all pairs (n, k) such that a slightly altered binomial coefficient is less than or equal to a certain N:

bin = lambda n, k : binomial(n + k - 1, k)

def nkfilter(N):
    pairs = []
    for n in range(2, N+1):
        for k in range(1, n):
            if bin(n, k) <= N:
                pairs.append([n, k])
    print '\n (n, k)\n'            
    return pairs

This prints out the following:

example = nkfilter(8); print example

(n, k)

[[2, 1], [3, 1], [3, 2], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1]]

I now would like to take this n and generate a tuple of length n: (a_1,..., a_n), for which all the a_is are less than or equal to k. I have been considering permutations to accomplish this, but I believe I need to first generate list_of_numbers_less_than_k and then take permutations(n, list_of_numbers).

However I am not sure which data types to use, and how to generate these n-length tuples.

2013-06-11 12:17:39 +0200 marked best answer How to compute an iterated product in Sage

You can use the prod() function (see prod? for some help):

sage: f = lambda n, k, i : prod([binomial(n+k-l,k) for l in range(1,i+1)])
sage: f(3,4,2)
75

This also works symbolically:

sage: var('n,k')
(n, k)
sage: f(n,k,2)  
binomial(k + n - 2, k)*binomial(k + n - 1, k)
2013-06-10 17:58:24 +0200 asked a question How to compute an iterated product in Sage

I am wondering about how to define a function f(n, k, i) that will take inputs n, k, i and give me the following product: $$ \prod_{\ell = 1}^i {n + k - \ell \choose k} $$ So for $i = 2$, this would look like ${n + k - 1 \choose k}\cdot {n + k - 2 \choose k}$. Would I use a for loop to iteratively add to the product until all i terms were accounted for?

2013-06-03 16:26:23 +0200 commented answer Unsure why the 0 values error keeps coming up

I see, I just corrected the range that the function needs to access and it worked perfectly. Thanks!

2013-06-03 16:25:55 +0200 marked best answer Unsure why the 0 values error keeps coming up

The problem comes from how you called your function. The function returns an empty list, but you try to assign two variables (fname and cname) with that output.

A simpler example:

sage: def my_empty_func():
sage:     return []
sage: a,b = my_empty_func()
...
ValueError: need more than 0 values to unpack

Here, the error means that you need the function my_empty_func() to return a list (or tuple) of two elements to feed a and b, but it returned a list of zero elements.

2013-06-03 16:18:10 +0200 commented question Unsure why the 0 values error keeps coming up

@vdelecroix I'm sorry, I was missing a `+` and I put the `return` statement that appears halfway down in order to see if the first output of my function was valid but I suppose this is not a correct debugging technique. I have edited the code to fix those two mistakes

2013-06-03 16:15:20 +0200 received badge  Editor (source)
2013-06-03 14:06:38 +0200 asked a question 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)+')')
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_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.

2013-06-03 14:00:42 +0200 commented answer How to store outputs from a function for later use

Many thanks @tmontneil, I now understand. Partition is indeed useful to keep in mind

2013-05-31 11:51:47 +0200 commented answer How to store outputs from a function for later use

@tmontneil but will the `w[i]` values now feed into a Schur function? I thought they had to be lists i.e., I think I need `w[0] = [1,0,...,0]` right?

2013-05-31 11:19:15 +0200 received badge  Commentator