Hello,

I think something like the following should get you going in the right
direction:

sage: delta = lambda m, n: (m-1)*(n-1)/2 + gcd(m,n)-1/2
sage: m = 3
sage: n = 2
sage: for m_part in Partitions(m):
....:    for n_part in Partitions(n):
....:        print "%s, %s"%(m_part, n_part)
....:        for mi in m_part:
....:            for ni in n_part:
....:                print "delta(%s,%s) = %s"%(mi,ni,delta(mi,ni))
....:
[3], [2]
delta(3,2) = 3/2
[3], [1, 1]
delta(3,1) = 1/2
delta(3,1) = 1/2
[2, 1], [2]
delta(2,2) = 2
delta(1,2) = 1/2
[2, 1], [1, 1]
delta(2,1) = 1/2
delta(2,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
[1, 1, 1], [2]
delta(1,2) = 1/2
delta(1,2) = 1/2
delta(1,2) = 1/2
[1, 1, 1], [1, 1]
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2
delta(1,1) = 1/2

You just need to combine the individual deltas in the appropriate way.

--Mike

On Thu, Apr 3, 2008 at 3:17 PM, Erick Galinkin <[EMAIL PROTECTED]> wrote:
>
>  Mike,
>  Thank you for responding!
>
>  delta is calculated by taking:
>
>  delta(m,n) = ((m-1)(n-1)/2)+(gcd(m,n)-1/2)
>
>  The issue I'm running into is getting sage to cycle these partitions
>  through this calculation. I can get the partitions and do it all by
>  hand, but that's an awful pain.
>
>  ~Erick
>
>
>
>  On Apr 3, 5:51 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
>  > Hi Erick,
>  >
>  > How do you calculate the delta invariant?  (This is not my area of
>  > math.)  How large of m and n do you want to work with?  For example,
>  > here is some Sage code to generate all the integer partitions of 40:
>  >
>  > sage: time l = Partitions(40).list()
>  > CPU times: user 0.50 s, sys: 0.03 s, total: 0.53 s
>  > Wall time: 0.56
>  > sage: len(l)
>  > 37338
>  > sage: l[:5]
>  > [[40], [39, 1], [38, 2], [38, 1, 1], [37, 3]]
>  >
>  > --Mike
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to