[sage-support] Re: Sage and skew-schurs

2010-10-28 Thread vasu
Thanks a bunch Mike!
That's neat. I have been using Sage a lot in my research on Kronecker
products, and the way things go I was expecting something of the sort
s[lambda].skew([b]) vaguely. But the syntax you wrote is way nicer.
I'll be giving a talk on Sage and Symmetric Functions (specifically
focussing on whatever I've used it for) and there should be a lot more
questions coming up!

Thanks again

On Oct 27, 10:54 pm, Mike Hansen mhan...@gmail.com wrote:
 On Wed, Oct 27, 2010 at 10:42 PM, vasu tewari.v...@gmail.com wrote:
  Hi all
  I have tried searching all over the combinatorics sections of the
  sagemath wiki, but I could not find if there is an implementation of
  the skew schur functions. More specifically, here is what I am looking
  for:
  given partitions 'lambda' and 'mu', and 's' being the schur basis,
  what is s_{lambda\mu}
  where lambda\mu is the skew tableau.

 sage: lmbda = Partition([3,2,1])
 sage: mu = Partition([1])
 sage: s = SymmetricFunctions(QQ).s(); s
 Symmetric Function Algebra over Rational Field, Schur symmetric
 functions as basis
 sage: s(lmbda/mu)
 s[2, 2, 1] + s[3, 1, 1] + s[3, 2]

 sage: s([[3,2,1],[1]])
 s[2, 2, 1] + s[3, 1, 1] + s[3, 2]

 --Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: union of lists and remove an element from a list

2010-10-28 Thread m.rebolledo
Hi Minh,
thank you very much for your detailed answer!!
Marusia

On 27 oct, 22:29, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Marusia,

 On Thu, Oct 28, 2010 at 7:02 AM, m.rebolledo

 marusia.reboll...@gmail.com wrote:
  Hello,
  how to do the union of several lists (more than two)?

 Lists are multisets, so I assume you mean to combine several lists
 into one, while retaining duplicate elements. You could do so using
 the list concatenation operator +:

 sage: L1 = [2, 3, 5, 7, 11]
 sage: L2 = [a, b, c, 13]
 sage: L3 = [1/2, 1/3, 1/4]
 sage: L1 + L2 + L3
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 Via the list method extend():

 sage: L = []
 sage: L.extend(L1)
 sage: L.extend(L2)
 sage: L.extend(L3)
 sage: L
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 Or use the Sage built-in function flatten():

 sage: flatten([L1, L2, L3])
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 If you really want to remove duplicate elements in the final combined
 list, use Set():

 sage: L1 = [1, 2]
 sage: L2 = [2, 3, 4]
 sage: L3 = [a, b]
 sage: Set(L1 + L2 + L3)
 {'a', 1, 2, 3, 4, 'b'}
 sage: list(Set(L1 + L2 + L3))
 ['a', 1, 2, 3, 4, 'b']

  and how to
  remove some elements of the lists?

 Use the operator del:

 sage: L
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]
 sage: L[0]
 2
 sage: del L[0]; L
 [3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]
 sage: L[-1]
 1/4
 sage: del L[-1]; L
 [3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3]

  I know that it is probably
  elementary but I did not find it in the help... :(

 See the Python tutorial [1] for some introductory materials on using
 lists. This page [2] and this page [3] provide detailed information on
 operations on lists.

 [1]http://docs.python.org/tutorial/introduction.html#lists

 [2]http://docs.python.org/library/stdtypes.html#sequence-types-str-unico...

 [3]http://docs.python.org/library/stdtypes.html#typesseq-mutable

 --
 Regards
 Minh Van Nguyen

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: union of lists and remove an element from a list

2010-10-28 Thread m.rebolledo
For the second question the remove is better for me :
list.remove(x)  because I don't know the index of x in the list. (I
don't know even if the list contains x)
Thank you again!

On 27 oct, 22:29, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Marusia,

 On Thu, Oct 28, 2010 at 7:02 AM, m.rebolledo

 marusia.reboll...@gmail.com wrote:
  Hello,
  how to do the union of several lists (more than two)?

 Lists are multisets, so I assume you mean to combine several lists
 into one, while retaining duplicate elements. You could do so using
 the list concatenation operator +:

 sage: L1 = [2, 3, 5, 7, 11]
 sage: L2 = [a, b, c, 13]
 sage: L3 = [1/2, 1/3, 1/4]
 sage: L1 + L2 + L3
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 Via the list method extend():

 sage: L = []
 sage: L.extend(L1)
 sage: L.extend(L2)
 sage: L.extend(L3)
 sage: L
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 Or use the Sage built-in function flatten():

 sage: flatten([L1, L2, L3])
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]

 If you really want to remove duplicate elements in the final combined
 list, use Set():

 sage: L1 = [1, 2]
 sage: L2 = [2, 3, 4]
 sage: L3 = [a, b]
 sage: Set(L1 + L2 + L3)
 {'a', 1, 2, 3, 4, 'b'}
 sage: list(Set(L1 + L2 + L3))
 ['a', 1, 2, 3, 4, 'b']

  and how to
  remove some elements of the lists?

 Use the operator del:

 sage: L
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]
 sage: L[0]
 2
 sage: del L[0]; L
 [3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]
 sage: L[-1]
 1/4
 sage: del L[-1]; L
 [3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3]

  I know that it is probably
  elementary but I did not find it in the help... :(

 See the Python tutorial [1] for some introductory materials on using
 lists. This page [2] and this page [3] provide detailed information on
 operations on lists.

 [1]http://docs.python.org/tutorial/introduction.html#lists

 [2]http://docs.python.org/library/stdtypes.html#sequence-types-str-unico...

 [3]http://docs.python.org/library/stdtypes.html#typesseq-mutable

 --
 Regards
 Minh Van Nguyen

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Sage and skew-schurs

2010-10-28 Thread Dan Drake
On Wed, 27 Oct 2010 at 10:42PM -0700, vasu wrote:
 ps: I stopped short of posting this question on Sage-combinat as I
 thought that is a heavily-research oriented  forum, and this question
 wouldn't fit.

Mike answered your math question, so let me address this: posting your
question in sage-combinat-devel would be perfectly fine. That list is
pretty research-oriented, but anyone who wants to calculate Schur
functions is very welcome there. Feel free to ask any other
combinatorics questions here or in sage-combinat-devel.

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


Re: [sage-support] Reading images using Octave into Sage?

2010-10-28 Thread David Joyner
For me (using octave 3.2 on ubuntu 10.04, sage 4.5.2a1) it ran on repeating

Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
in __subclasscheck__' in type 'exceptions.RuntimeError' ignored

and refused to respond to ctl-c or ctl-d. I had to kill it using a kill -9 PID.

What did your system do?

On Thu, Oct 28, 2010 at 6:39 AM, Alasdair amc...@gmail.com wrote:
 I want to do some computations (using Sage) on the pixel values of an
 image, and I assumed I'd be able to use Octave to read in the values.
 Something like:

 c = octave('imread(cameraman.png)')

 or even

 octave('c = imread(cameraman.png)')

 But none of these work.  Even if I start up Octave-inside-Sage with
 octave.console(), the imread command fails to work.  It works fine in
 Octave (outside of Sage), though.

 It would be nice to be able to use

 octave.imread

 but that doesn't work (as for example all Maxima functions are so
 available).

 Any suggestions?

 Thanks,
 Alasdair

 --
 To post to this group, send email to sage-support@googlegroups.com
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com
 For more options, visit this group at 
 http://groups.google.com/group/sage-support
 URL: http://www.sagemath.org


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Reading images using Octave into Sage?

2010-10-28 Thread Alasdair
Yep, mine too.  But sometimes it just hangs.

On Oct 28, 11:27 pm, David Joyner wdjoy...@gmail.com wrote:
 For me (using octave 3.2 on ubuntu 10.04, sage 4.5.2a1) it ran on repeating

 Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
 in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
 in __subclasscheck__' in type 'exceptions.RuntimeError' ignored

 and refused to respond to ctl-c or ctl-d. I had to kill it using a kill -9 
 PID.

 What did your system do?

 On Thu, Oct 28, 2010 at 6:39 AM, Alasdair amc...@gmail.com wrote:
  I want to do some computations (using Sage) on the pixel values of an
  image, and I assumed I'd be able to use Octave to read in the values.
  Something like:

  c = octave('imread(cameraman.png)')

  or even

  octave('c = imread(cameraman.png)')

  But none of these work.  Even if I start up Octave-inside-Sage with
  octave.console(), the imread command fails to work.  It works fine in
  Octave (outside of Sage), though.

  It would be nice to be able to use

  octave.imread

  but that doesn't work (as for example all Maxima functions are so
  available).

  Any suggestions?

  Thanks,
  Alasdair

  --
  To post to this group, send email to sage-support@googlegroups.com
  To unsubscribe from this group, send email to 
  sage-support+unsubscr...@googlegroups.com
  For more options, visit this group 
  athttp://groups.google.com/group/sage-support
  URL:http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: union of lists and remove an element from a list

2010-10-28 Thread Yann


On Oct 27, 10:29 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Marusia,

 On Thu, Oct 28, 2010 at 7:02 AM, m.rebolledo

 marusia.reboll...@gmail.com wrote:
  Hello,
  how to do the union of several lists (more than two)?

 Lists are multisets, so I assume you mean to combine several lists
 into one, while retaining duplicate elements. You could do so using
 the list concatenation operator +:

 sage: L1 = [2, 3, 5, 7, 11]
 sage: L2 = [a, b, c, 13]
 sage: L3 = [1/2, 1/3, 1/4]
 sage: L1 + L2 + L3
 [2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]


Hi,
just as a sidenote, this might make people write this:

L = sum( a list of list, [] )

which is correct but quite inefficient.

Compare the following:

timeit('L = sum([[0] for i in range(1)], [])')

and

timeit('L = []\nfor i in range(1): L += [0]')

Regards

 Yann

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] doubly noncentral F distribution

2010-10-28 Thread Neal Becker
Is there any code for cdf of double noncentral F distribution?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: union of lists and remove an element from a list

2010-10-28 Thread Jason Grout

On 10/28/10 9:25 AM, Yann wrote:



On Oct 27, 10:29 pm, Minh Nguyennguyenmi...@gmail.com  wrote:

Hi Marusia,

On Thu, Oct 28, 2010 at 7:02 AM, m.rebolledo

marusia.reboll...@gmail.com  wrote:

Hello,
how to do the union of several lists (more than two)?


Lists are multisets, so I assume you mean to combine several lists
into one, while retaining duplicate elements. You could do so using
the list concatenation operator +:

sage: L1 = [2, 3, 5, 7, 11]
sage: L2 = [a, b, c, 13]
sage: L3 = [1/2, 1/3, 1/4]
sage: L1 + L2 + L3
[2, 3, 5, 7, 11, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4]



Hi,
just as a sidenote, this might make people write this:

L = sum( a list of list, [] )

which is correct but quite inefficient.




But you could try using sage's balanced_sum, which is much more 
efficient (but still not as efficient as using += like your last 
example, at least in this case):


sage: LL=[range(5*n,5*n+3) for n in range(100)]
sage: LL
[[0, 1, 2], [5, 6, 7], [10, 11, 12], [15, 16, 17], [20, 21, 22], [25, 
26, 27], [30, 31, 32], [35, 36, 37], [40, 41, 42], [45, 46, 47], [50, 
51, 52], [55, 56, 57], [60, 61, 62], [65, 66, 67], [70, 71, 72], [75, 
76, 77], [80, 81, 82], [85, 86, 87], [90, 91, 92], [95, 96, 97], [100, 
101, 102], [105, 106, 107], [110, 111, 112], [115, 116, 117], [120, 121, 
122], [125, 126, 127], [130, 131, 132], [135, 136, 137], [140, 141, 
142], [145, 146, 147], [150, 151, 152], [155, 156, 157], [160, 161, 
162], [165, 166, 167], [170, 171, 172], [175, 176, 177], [180, 181, 
182], [185, 186, 187], [190, 191, 192], [195, 196, 197], [200, 201, 
202], [205, 206, 207], [210, 211, 212], [215, 216, 217], [220, 221, 
222], [225, 226, 227], [230, 231, 232], [235, 236, 237], [240, 241, 
242], [245, 246, 247], [250, 251, 252], [255, 256, 257], [260, 261, 
262], [265, 266, 267], [270, 271, 272], [275, 276, 277], [280, 281, 
282], [285, 286, 287], [290, 291, 292], [295, 296, 297], [300, 301, 
302], [305, 306, 307], [310, 311, 312], [315, 316, 317], [320, 321, 
322], [325, 326, 327], [330, 331, 332], [335, 336, 337], [340, 341, 
342], [345, 346, 347], [350, 351, 352], [355, 356, 357], [360, 361, 
362], [365, 366, 367], [370, 371, 372], [375, 376, 377], [380, 381, 
382], [385, 386, 387], [390, 391, 392], [395, 396, 397], [400, 401, 
402], [405, 406, 407], [410, 411, 412], [415, 416, 417], [420, 421, 
422], [425, 426, 427], [430, 431, 432], [435, 436, 437], [440, 441, 
442], [445, 446, 447], [450, 451, 452], [455, 456, 457], [460, 461, 
462], [465, 466, 467], [470, 471, 472], [475, 476, 477], [480, 481, 
482], [485, 486, 487], [490, 491, 492], [495, 496, 497]]

sage: timeit('flatten(LL)')
625 loops, best of 3: 507 盜 per loop
sage: timeit('sum(LL,[])')
625 loops, best of 3: 104 盜 per loop
sage: timeit('balanced_sum(LL,[])')
625 loops, best of 3: 32.4 盜 per loop
sage: timeit('L=[]\nfor i in LL: L.extend(i)')
625 loops, best of 3: 21.6 盜 per loop
sage: timeit('L=[]\nfor i in LL: L+=i')
625 loops, best of 3: 13.5 盜 per loop


-Jason

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] sage console in ubuntu 10.10 and jmol

2010-10-28 Thread adrian
I installed the sage 4.5.3 binary in my little netbook, and when I
type
sphere()
or show(sphere()=

nothing happens.  I have the package sun-java6-bin sun-java6-jre and
sun-java6-plugin installed.  All works in the notebook.

Is this intended?

I do the same in an ubuntu 10.04 and I do get the jmol window, unlike
with 10.10.
Thanks.

-Adrián.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org