[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Dan Drake
On Fri, 09 May 2008 at 11:25AM -0700, Marshall Hampton wrote:
> Somewhat relevant to this are the (IMHO) very nice substitutions,
> rules, and patterns in mathematica (although the syntax is pretty
> odd).  As a very simple example, the command:
> 
> In: {x, x*y} /. {{x -> 1, y -> 2}, {x -> 2, y -> 3}}
> 
> returns
> 
> Out: {{1,2},{2,6}}
> 
> The Sage subs command is quite weak compared to such substitutions in
> mathematica.  One can do very complicated condition substitutions,
> regular-expression like matching, etc.

I really liked Mathematica's ability to do complicated substitutions,
pattern matching, and so on -- although yes, the syntax got weird. I'd
like to see Sage get more of that ability.

Dan

-- 
---  Dan Drake <[EMAIL PROTECTED]>
-  KAIST Department of Mathematical Sciences
---  http://math.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread Rose


> How about something like the following:
>
> cpoints = [0, 1, 1+I]
> points = [[real(z), imag(z)] for z in cpoints]
> polygon(points).show(figsize=[8,8])
>
> Mark

Thank you, this is what I was trying to do!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread mark mcclure

On May 9, 4:16 pm, Rose <[EMAIL PROTECTED]> wrote:
> No I am not sure I need Tuple(). I am trying to draw some polygons on
> the complex plane, so I put the coordinates of the vertex (I am not
> sure it is the good word) in a Turple().
> Do you think there is a better way to do that?

How about something like the following:

cpoints = [0, 1, 1+I]
points = [[real(z), imag(z)] for z in cpoints]
polygon(points).show(figsize=[8,8])

Mark

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-09 Thread mabshoff

On May 9, 10:35 pm, "Glenn H Tarbox, PhD" <[EMAIL PROTECTED]> wrote:

Hi Glen,

> I have an asus eee sitting around... I put eeexbuntu on it so its not
> running the original os (btw, I recommend this... but there must be
> downsides)

I wouldn't stick with Xandros either ;)

> I could easily nail it up to the net so you could ssh into it which
> supports using vnc to view the screen though most of what you'd need
> would probably "just work" over ssh (with the right ports forwarded).

Sounds like fun. I would certainly take a shell account :). I poked
around and according to

http://wiki.eeeuser.com/eee_pc_701?TB_iframe=true&height=520&width=980

the 4G model comes with a "900 MHz Intel Celeron M ULV 353 @ 630 MHz".
I would be curious about the output from /proc/cpuinfo. If we have
SSE2 I see no reason not to run the Xeon binaries. The tuning would
likely suck, but I don't expect most people to do anything I would
consider a serious computation on it.

If I build Sage on that box I would be slightly concerned about ATLAS,
but I can tune it once [in a day or so] and then stick the tuning info
back into out spkg and also push it upstream.

> Its also running openvpn... so if you wanted to go whole hog... but ssh
> gets you most of the way.

:)

> links I had in a tomboy note:
>
> http://wiki.eeeuser.com/ubuntu:eeexubuntu:home
>
> --
>
> http://ubuntucare.com/2007/12/11/ubuntu-on-the-asus-eee-pc-part-1/
>
> actually at:
>
> http://www.sampletheweb.com/2007/12/09/ubuntu-on-the-asus-eee-pc-part...
>
> and here's the ubuntu docs on it:
>
> https://help.ubuntu.com/community/EeePC
>
> Let me know.

Cool. If you give me a shell please make sure that box is actively
cooled before I build Sage. Otherwise I wouldn't be surprised if the
life expectancy of that piece of hardware goes down rapidly. I
actually just got access to a couple Sun boxen, so I am neck deep in
the Solaris port of Sage again and on the way to beat all dependencies
on gmake in Sage out of the code base :)

> -glenn

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-09 Thread Glenn H Tarbox, PhD

I have an asus eee sitting around... I put eeexbuntu on it so its not
running the original os (btw, I recommend this... but there must be
downsides)

I could easily nail it up to the net so you could ssh into it which
supports using vnc to view the screen though most of what you'd need
would probably "just work" over ssh (with the right ports forwarded). 

Its also running openvpn... so if you wanted to go whole hog... but ssh
gets you most of the way.

links I had in a tomboy note:


http://wiki.eeeuser.com/ubuntu:eeexubuntu:home

--

http://ubuntucare.com/2007/12/11/ubuntu-on-the-asus-eee-pc-part-1/

actually at:

http://www.sampletheweb.com/2007/12/09/ubuntu-on-the-asus-eee-pc-part-1-or-how-to-run-a-functional-ubuntu-install-off-a-usb-drive/

and here's the ubuntu docs on it:

https://help.ubuntu.com/community/EeePC


Let me know.

-glenn

On Fri, 2008-05-09 at 13:01 -0700, mabshoff wrote:
> On May 9, 9:27 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> 
> hi David,
> 
> > It turns out that next year it is very possible that all USNA freshamn will 
> > have
> > an asus eee. The debate seems to be about the amount of ram it should have.
> > I can borrow one next week. It has xandros linux 500M ram, 2G "hard
> > drive", wireless but
> > no cd or dvd drive. I think I can also borrow a 8G SD card.  It comes with
> > konqueror but not firefox and a very limited (to put it mildly) set of
> > development tools.
> 
> Compiling Sage on another box and then providing a eee specific binary
> shouldn't be much trouble. We can strip down Sage to about 0.5GB
> installed, but then you can no longer develop with it. Aside from that
> konqueror is going to be a problem since there are currently known
> issues with 3.0+ IIRC.
> 
> > Any suggestions as to how to get SAGE running on it? Ideally, if and
> > when this becomes
> > definite, I'd like a very simple set of instructions so that a
> > freshman can download a file and
> > make their own SD card with SAGE on it.
> 
> I don't think it will be much of a problem. If there is hardware
> around at dev1 I can certainly spend a day on the problem to get a
> minimal setup going that works on the eee. malb has already done some
> work there, so I expect little trouble.
> 
> Cheers,
> 
> Michael
> 
> > 
-- 
Glenn H. Tarbox, PhD| Don't worry about people stealing your ideas. If your 
ideas
206-494-0819| are any good, you'll have to ram them down people's 
throats
[EMAIL PROTECTED] (gtalk) + ghtdak on aim/freenode | ^ Howard Aiken, IBM 
engineer



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] (latex(a\v), a) gives an error about calling something with too many arguments.

2008-05-09 Thread Jason Grout

Hi all,

sage: a=matrix(QQ,3,3,range(9))
sage: v=matrix(QQ,3,1,range(3))
sage: (latex(a\v), a)

gives an error.

I think it has to do with the parsing of latex(a\v); it seems to try 
doing "(latex(a._backslash_(v), a)" (note the missing parenthesis in the 
call to latex.

You see this more detailed error from:

@interact
def _(a=matrix(QQ,3,3,range(9)), v=matrix(QQ,3,1,range(3))):
 html('$$%s %s = %s$$'%(latex(a), latex(a\v), latex(v)))

with the patch from #3121 applied.

Does anyone know what is going on?

This error is tracked at http://trac.sagemath.org/sage_trac/ticket/3146

Thanks,

Jason


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread Rose



On 9 mai, 15:01, "John Cremona" <[EMAIL PROTECTED]> wrote:
> Are you sure that you need Tuple() at all for what you are doing?

No I am not sure I need Tuple(). I am trying to draw some polygons on
the complex plane, so I put the coordinates of the vertex (I am not
sure it is the good word) in a Turple().
Do you think there is a better way to do that?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread Rose


> So I'm guessing you're using symbolic numbers instead of complex
> numbers. It's easy to get them wrong:

I was doing that mistake.
Thank you, it is going faster now.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-09 Thread mabshoff

On May 9, 9:27 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:

hi David,

> It turns out that next year it is very possible that all USNA freshamn will 
> have
> an asus eee. The debate seems to be about the amount of ram it should have.
> I can borrow one next week. It has xandros linux 500M ram, 2G "hard
> drive", wireless but
> no cd or dvd drive. I think I can also borrow a 8G SD card.  It comes with
> konqueror but not firefox and a very limited (to put it mildly) set of
> development tools.

Compiling Sage on another box and then providing a eee specific binary
shouldn't be much trouble. We can strip down Sage to about 0.5GB
installed, but then you can no longer develop with it. Aside from that
konqueror is going to be a problem since there are currently known
issues with 3.0+ IIRC.

> Any suggestions as to how to get SAGE running on it? Ideally, if and
> when this becomes
> definite, I'd like a very simple set of instructions so that a
> freshman can download a file and
> make their own SD card with SAGE on it.

I don't think it will be much of a problem. If there is hardware
around at dev1 I can certainly spend a day on the problem to get a
minimal setup going that works on the eee. malb has already done some
work there, so I expect little trouble.

Cheers,

Michael

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] sage-vmware-deluxe-3.0.1

2008-05-09 Thread Adam Getchell

I've built a new version of the sage-vmware-deluxe-3.0.1 virtual machine.

http://www.sagemath.org/SAGEbin/microsoft_windows/sage_deluxe.html

It is running SAGE 3.0.1 on (X)Ubuntu 8.04 LTS patched as of 5/9/08

Enjoy!

Adam
-- 
"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread didier deshommes

On Fri, May 9, 2008 at 3:12 PM, John Cremona <[EMAIL PROTECTED]> wrote:
>
> Didier, I am sure you are right but I thought it best to deal with one
> matter at a time!  From Rose's posting it looked as if she was just
> trying to count instances in a list, while Tuples is a much more
> complicated function.

You're right, John. I guess I was being a little selfish: sometimes I
mix up symbolic and complex numbers and it  usually catches up to me
several lines down a computation (or gets really slow).

didier

>
> John
>
> 2008/5/9 didier deshommes <[EMAIL PROTECTED]>:
>>
>> On Fri, May 9, 2008 at 1:59 PM, Rose <[EMAIL PROTECTED]> wrote:
>> Hi Rose,
>>
>>>
>>> Second, it becomes pretty long went there are complex numbers in my
>>> Tuples (more than 30 secondes for 7 elements).
>>
>> This does take time, interestingly when the numbers are symbolic:
>>
>> {{{
>> sage: f=range(6)
>>
>> sage: %time Tuples(f,1);
>> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
>> Wall time: 0.00
>>
>> sage: u=[CC(CC.random_element(10)+i) for _ in range(5)]
>>
>> sage: %time Tuples(u,1);
>> CPU times: user 0.48 s, sys: 0.22 s, total: 0.70 s
>> Wall time: 7.12
>> }}}
>>
>> So I'm guessing you're using symbolic numbers instead of complex
>> numbers. It's easy to get them wrong:
>> {{{
>> sage: symbol=2+I ; type(symbol)
>>  
>>
>> sage: a=CC(2+I) ; type(a)
>>  
>> }}}
>>
>> Hope that helps
>>
>> didier
>>>
>>> I would like to know if there is a better way to count a Tuples of
>>> complex number.
>>>
>>> In general, it is really long when I utilize Tuples with complex
>>> number (in comparaison of doing 2 Tuples, one for real part and one
>>> for imaginary part).
>>>
>>> >
>>>
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: [sage-newbie] Re: Will Sage run on a 4GB Asus Eee PC?

2008-05-09 Thread David Joyner

It turns out that next year it is very possible that all USNA freshamn will have
an asus eee. The debate seems to be about the amount of ram it should have.
I can borrow one next week. It has xandros linux 500M ram, 2G "hard
drive", wireless but
no cd or dvd drive. I think I can also borrow a 8G SD card.  It comes with
konqueror but not firefox and a very limited (to put it mildly) set of
development tools.

Any suggestions as to how to get SAGE running on it? Ideally, if and
when this becomes
definite, I'd like a very simple set of instructions so that a
freshman can download a file and
make their own SD card with SAGE on it.

On Sun, Jan 20, 2008 at 8:56 PM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Jan 21, 1:17 am, mhampton <[EMAIL PROTECTED]> wrote:
>> I've wondered about this myself, but I don't have an Eee.  Please post
>> whatever you find out; I think the Eees look pretty sweet.
>>
>> It should be pretty easy to do, the chip is a standard Intel x86
>> (centrino?).  As for memory, my G4 apple laptop only has 512 of memory
>> right now, and sage runs reasonably well on it - the 3d graphics
>> strain it a bit, but that's more the G4 chip's fault than the memory I
>> think.
>>
>> Cheers,
>> M. Hampton
>>
>> On Jan 20, 5:46 pm, JohnGuin <[EMAIL PROTECTED]> wrote:
>>
>> > Has anyone tried this?  I'm not sure if the flavor of Linux on the Eee
>> > will support Sage, and am also curious if 512MB of RAM is enough.
>
> I think malb owns one, but I am not sure if he talked about buying one
> or if he already did. As observed above 512 MB is enough. You can also
> strip down the binary distribution if you do not intent to do any
> development, i.e. remove all static libraries, strip all binaries,
> remove header and so on.
>
>> > If anyone has actually run this config, please let me know.  Thanks
>> > all!
>>
>> > John
>
> Cheers,
>
> Michael
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread John Cremona

Didier, I am sure you are right but I thought it best to deal with one
matter at a time!  From Rose's posting it looked as if she was just
trying to count instances in a list, while Tuples is a much more
complicated function.

John

2008/5/9 didier deshommes <[EMAIL PROTECTED]>:
>
> On Fri, May 9, 2008 at 1:59 PM, Rose <[EMAIL PROTECTED]> wrote:
> Hi Rose,
>
>>
>> Second, it becomes pretty long went there are complex numbers in my
>> Tuples (more than 30 secondes for 7 elements).
>
> This does take time, interestingly when the numbers are symbolic:
>
> {{{
> sage: f=range(6)
>
> sage: %time Tuples(f,1);
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00
>
> sage: u=[CC(CC.random_element(10)+i) for _ in range(5)]
>
> sage: %time Tuples(u,1);
> CPU times: user 0.48 s, sys: 0.22 s, total: 0.70 s
> Wall time: 7.12
> }}}
>
> So I'm guessing you're using symbolic numbers instead of complex
> numbers. It's easy to get them wrong:
> {{{
> sage: symbol=2+I ; type(symbol)
>  
>
> sage: a=CC(2+I) ; type(a)
>  
> }}}
>
> Hope that helps
>
> didier
>>
>> I would like to know if there is a better way to count a Tuples of
>> complex number.
>>
>> In general, it is really long when I utilize Tuples with complex
>> number (in comparaison of doing 2 Tuples, one for real part and one
>> for imaginary part).
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Jason Grout

Marshall Hampton wrote:
> It occurred to me that maybe I should supply a more non-trivial
> example of rules/patterns/subs in mathematica.  Here is just one: we
> replace exponents of polynomials with the famous 3x+1 sequence
> (Collatz, whatever) until they stabilize:
> 
> In: {x^2, x^3 + x^200,  x^4 + z^909} //. {y_^n_ /; Mod[n, 2] == 1 ->
> y^(3 n + 1),  y_^n_ /; Mod[n, 2] == 0 -> y^(n/2)}
> 
> Out: {x, 2 x, x + z}
> 

Some interpretation:

/; == "such that" (gives a condition on the replacement)

a_ is a placeholder

y_^n_ matches a number to an exponent and lets y be the name of the base 
while n is the exponent.

y_^n_ /; Mod[n,2] == 1 -> y^(3 n + 1) means:

if there is a base to an exponent such that the exponent is odd, then 
call the base y and the exponent n and replace the y^n with y^(3n+1).


One other thing: //. means "keep running the replacement rule until 
there is no change in the expression"

Marshall or anyone, please correct me if I've said something incorrect.

I too miss the power of the Mathematica replacement engine.

Thanks,

Jason


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread didier deshommes

On Fri, May 9, 2008 at 1:59 PM, Rose <[EMAIL PROTECTED]> wrote:
Hi Rose,

>
> Second, it becomes pretty long went there are complex numbers in my
> Tuples (more than 30 secondes for 7 elements).

This does take time, interestingly when the numbers are symbolic:

{{{
sage: f=range(6)

sage: %time Tuples(f,1);
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00

sage: u=[CC(CC.random_element(10)+i) for _ in range(5)]

sage: %time Tuples(u,1);
CPU times: user 0.48 s, sys: 0.22 s, total: 0.70 s
Wall time: 7.12
}}}

So I'm guessing you're using symbolic numbers instead of complex
numbers. It's easy to get them wrong:
{{{
sage: symbol=2+I ; type(symbol)
 

sage: a=CC(2+I) ; type(a)
 
}}}

Hope that helps

didier
>
> I would like to know if there is a better way to count a Tuples of
> complex number.
>
> In general, it is really long when I utilize Tuples with complex
> number (in comparaison of doing 2 Tuples, one for real part and one
> for imaginary part).
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Counting complex number in a Tuples

2008-05-09 Thread John Cremona

Are you sure that you need Tuple() at all for what you are doing?  Try
looking at the documentaion for it with Tuples?  If all you want to do
is count the number of times an element appears in a list, use the
count() function which every lisy has, like this

sage: u=[1+I,1+I,1+I,2+I,2+I,2+I,2+I]
sage: u.count(1+I)
3
sage: u.count(2+I)
4

John Cremona

2008/5/9 Rose <[EMAIL PROTECTED]>:
>
> Hi,
>
> (I am a Newbie)
> I need to count complex number in Tuples and the only way I found out
> is to use Tuples(l,1).count() or UnorderedTuples(l,1).count() (I don't
> understand the difference), but I have two problems.
>
> First, it counts only once an element that is twice in my Tuples.
>   ex: sage: u=[1,2,1]
> sage:  Tuples(u,1).count()
> 2
>
> Second, it becomes pretty long went there are complex numbers in my
> Tuples (more than 30 secondes for 7 elements).
>
> I would like to know if there is a better way to count a Tuples of
> complex number.
>
> In general, it is really long when I utilize Tuples with complex
> number (in comparaison of doing 2 Tuples, one for real part and one
> for imaginary part).
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Marshall Hampton

It occurred to me that maybe I should supply a more non-trivial
example of rules/patterns/subs in mathematica.  Here is just one: we
replace exponents of polynomials with the famous 3x+1 sequence
(Collatz, whatever) until they stabilize:

In: {x^2, x^3 + x^200,  x^4 + z^909} //. {y_^n_ /; Mod[n, 2] == 1 ->
y^(3 n + 1),  y_^n_ /; Mod[n, 2] == 0 -> y^(n/2)}

Out: {x, 2 x, x + z}

-MH

On May 9, 12:25 pm, Marshall Hampton <[EMAIL PROTECTED]> wrote:
> Well, the design is somewhat different to start with: in Sage, you
> have to declare variables explicitly (i.e. with var('x,y') or
> whatever), but then symbolic variables can automatically act like
> functions (as in the usage/bug above).  In mathematica, anything
> undefined is _assumed_ to be a new symbolic object.
>
> Strings behave in a funny way in mathematica.  They are usually
> evaluated to symbolic expressions.  Here is a (hopefully) relevant
> example, setting the value of something to a string and then using it
> in a function:
>
> In: a = "test"
> Out: test
>
> In: f[x_] := x^2
> In: f[a]
> Out: test^2
>
> The output is misleading since the returned object is really
> Power["test",2] but that is displayed the same way that the symbolic
> expression Power[test,2] is.
>
> Somewhat relevant to this are the (IMHO) very nice substitutions,
> rules, and patterns in mathematica (although the syntax is pretty
> odd).  As a very simple example, the command:
>
> In: {x, x*y} /. {{x -> 1, y -> 2}, {x -> 2, y -> 3}}
>
> returns
>
> Out: {{1,2},{2,6}}
>
> The Sage subs command is quite weak compared to such substitutions in
> mathematica.  One can do very complicated condition substitutions,
> regular-expression like matching, etc.
>
> Cheers,
> Marshall
>
> On May 9, 11:54 am, "William Stein" <[EMAIL PROTECTED]> wrote:
>
> > On Fri, May 9, 2008 at 10:03 AM, Marshall Hampton <[EMAIL PROTECTED]> wrote:
>
> > > Ah, ok.  I am probably not the right person to weigh in on what
> > > symbolics should do.  I'll be happy if I can do most of what I could
> > > do in mathematica - since I used it for 16 years, it defines what I
> > > expect, but of course it won't always be the right design to follow
> > > for Sage.
>
> > > -M. Hampton
>
> > Wait -- please *do* weigh in, and do explain what Mathematica would
> > do in analogous situations.  I do care to hear.
>
> > William
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Counting complex number in a Tuples

2008-05-09 Thread Rose

Hi,

(I am a Newbie)
I need to count complex number in Tuples and the only way I found out
is to use Tuples(l,1).count() or UnorderedTuples(l,1).count() (I don't
understand the difference), but I have two problems.

First, it counts only once an element that is twice in my Tuples.
   ex: sage: u=[1,2,1]
 sage:  Tuples(u,1).count()
 2

Second, it becomes pretty long went there are complex numbers in my
Tuples (more than 30 secondes for 7 elements).

I would like to know if there is a better way to count a Tuples of
complex number.

In general, it is really long when I utilize Tuples with complex
number (in comparaison of doing 2 Tuples, one for real part and one
for imaginary part).

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Marshall Hampton

Well, the design is somewhat different to start with: in Sage, you
have to declare variables explicitly (i.e. with var('x,y') or
whatever), but then symbolic variables can automatically act like
functions (as in the usage/bug above).  In mathematica, anything
undefined is _assumed_ to be a new symbolic object.

Strings behave in a funny way in mathematica.  They are usually
evaluated to symbolic expressions.  Here is a (hopefully) relevant
example, setting the value of something to a string and then using it
in a function:

In: a = "test"
Out: test

In: f[x_] := x^2
In: f[a]
Out: test^2

The output is misleading since the returned object is really
Power["test",2] but that is displayed the same way that the symbolic
expression Power[test,2] is.

Somewhat relevant to this are the (IMHO) very nice substitutions,
rules, and patterns in mathematica (although the syntax is pretty
odd).  As a very simple example, the command:

In: {x, x*y} /. {{x -> 1, y -> 2}, {x -> 2, y -> 3}}

returns

Out: {{1,2},{2,6}}

The Sage subs command is quite weak compared to such substitutions in
mathematica.  One can do very complicated condition substitutions,
regular-expression like matching, etc.

Cheers,
Marshall

On May 9, 11:54 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Fri, May 9, 2008 at 10:03 AM, Marshall Hampton <[EMAIL PROTECTED]> wrote:
>
> > Ah, ok.  I am probably not the right person to weigh in on what
> > symbolics should do.  I'll be happy if I can do most of what I could
> > do in mathematica - since I used it for 16 years, it defines what I
> > expect, but of course it won't always be the right design to follow
> > for Sage.
>
> > -M. Hampton
>
> Wait -- please *do* weigh in, and do explain what Mathematica would
> do in analogous situations.  I do care to hear.
>
> William
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread William Stein

On Fri, May 9, 2008 at 10:03 AM, Marshall Hampton <[EMAIL PROTECTED]> wrote:
>
> Ah, ok.  I am probably not the right person to weigh in on what
> symbolics should do.  I'll be happy if I can do most of what I could
> do in mathematica - since I used it for 16 years, it defines what I
> expect, but of course it won't always be the right design to follow
> for Sage.
>
> -M. Hampton

Wait -- please *do* weigh in, and do explain what Mathematica would
do in analogous situations.  I do care to hear.

William

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: problem with 'view', question about 'view'

2008-05-09 Thread John H Palmieri



On May 9, 9:23 am, "Yi Qiang" <[EMAIL PROTECTED]> wrote:
> This actually bothered me for a while too. There is a patch on the
> trac ticket, please test it out on Linux :-)

Works okay for me.  (By the way, I am unable to reproduce my problem
from a few days ago, either before applying the patch or after.  Maybe
my computer was just acting up?)

> On Thu, May 8, 2008 at 5:16 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
> > On Thu, May 8, 2008 at 5:12 PM, William Stein <[EMAIL PROTECTED]> wrote:
> >> On Wed, May 7, 2008 at 12:26 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
> >>> A problem: on my linux box, if I use 'view' (not in a notebook), an
> >>> xdvi window appears then immediately disappears.  If I run view with
> >>> 'debug=True', toward the end I get this:
>
> >>> Output written on sage.dvi (1 page, 740 bytes).
> >>> Transcript written on sage.log.
> >>> gs: Unrecoverable error: limitcheck in .putdeviceprops
> >>> xdvik gs_io: Broken pipe
> >>> xdvik gs_io: Broken pipe
> >>> xdvik gs_io: Broken pipe
> >>> ghostscript died unexpectedly.
> >>> xdvi.bin: spcl_scan: shouldn't happen: POST encountered, offset 659
>
> >>> Has anyone seen this before?  (This works on my mac, just not on my
> >>> linux box.)
>
> >> I have never seen that before.
>
> >>> And a question: on my mac, suppose I want to use TeXShop instead of
> >>> xdvi to display the output of the view command.  Is there a way to do
> >>> this?
>
> >> The use of xdvi is hardcoded in
>
> >> sage/misc/latex.py
>
> >> so the answer is I guess to change this and submit a patch
> >> or make it a trac ticket.   It's reasonable to consider this
> >> a bug, since view should I think just use the OS X open
> >> command as defined in sage/misc/viewer.py, i.e., use
> >> whatever is the default opener for a dvi file on your system.
>
> >> It's hardcoded xdvi right now since that was some of the first
> >> sage code I ever wrote and that was long before I ported
> >> Sage to run on OS X...
>
> > OK, I made this trac #3137:
>
> >  http://trac.sagemath.org/sage_trac/ticket/3137
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Marshall Hampton

Ah, ok.  I am probably not the right person to weigh in on what
symbolics should do.  I'll be happy if I can do most of what I could
do in mathematica - since I used it for 16 years, it defines what I
expect, but of course it won't always be the right design to follow
for Sage.

-M. Hampton

On May 9, 10:37 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Fri, May 9, 2008 at 9:28 AM, Marshall Hampton <[EMAIL PROTECTED]> wrote:
>
> > I'm not sure I agree that this is a bug.  After using the name "var"
> > in the loop, the value of var is y.  y is a symbolic variable, and
> > when evaluated at the string "x,y" it returns "x,y"; this seems like
> > desirable behavior (to have string-valued functions seems OK to me).
>
> > Or another way to put it: if the above behavior is a bug, then I think
> > the following would be as well:
> > sage: x,y = var("x,y")
> > sage: y(2)
> > 2
>
> > Or perhaps I am missing something.
> > -M. Hampton
>
> There is an issue with the design, though it is arguable what it is.
> Notice that var('x') acts as the identity function irregardless of the input,
> where as var('x')^2 coerces its input to the SymbolicRing.
>
> sage: x = var('x')
> sage: x('hello world')
> 'hello world'
> sage: type(x('hello world'))
> 
> sage: (x^2)('hello world')
> hello^2*world^2
> sage: type((x^2)('hello world'))
> 
> sage: x,y=var("x,y")
>
> I thus think the right fix would be for var('x') to also coerce its input
> to the symbolic ring.  So, in the original question var('x,y') would
> give an error since:
>
>  sage: SR('x,y')
> Traceback (most recent call last):
> ...
> TypeError: Malformed expression: x, !!! y
>
> By the way, what's up with the !!! in the error message?  That looks
> very weird.
>
> What do you think.
>
>  -- william
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread William Stein

On Fri, May 9, 2008 at 9:28 AM, Marshall Hampton <[EMAIL PROTECTED]> wrote:
>
> I'm not sure I agree that this is a bug.  After using the name "var"
> in the loop, the value of var is y.  y is a symbolic variable, and
> when evaluated at the string "x,y" it returns "x,y"; this seems like
> desirable behavior (to have string-valued functions seems OK to me).
>
> Or another way to put it: if the above behavior is a bug, then I think
> the following would be as well:
> sage: x,y = var("x,y")
> sage: y(2)
> 2
>
> Or perhaps I am missing something.
> -M. Hampton

There is an issue with the design, though it is arguable what it is.
Notice that var('x') acts as the identity function irregardless of the input,
where as var('x')^2 coerces its input to the SymbolicRing.

sage: x = var('x')
sage: x('hello world')
'hello world'
sage: type(x('hello world'))

sage: (x^2)('hello world')
hello^2*world^2
sage: type((x^2)('hello world'))

sage: x,y=var("x,y")

I thus think the right fix would be for var('x') to also coerce its input
to the symbolic ring.  So, in the original question var('x,y') would
give an error since:

 sage: SR('x,y')
Traceback (most recent call last):
...
TypeError: Malformed expression: x, !!! y

By the way, what's up with the !!! in the error message?  That looks
very weird.

What do you think.

 -- william

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: ValueError

2008-05-09 Thread Marshall Hampton

I'm not sure I agree that this is a bug.  After using the name "var"
in the loop, the value of var is y.  y is a symbolic variable, and
when evaluated at the string "x,y" it returns "x,y"; this seems like
desirable behavior (to have string-valued functions seems OK to me).

Or another way to put it: if the above behavior is a bug, then I think
the following would be as well:
sage: x,y = var("x,y")
sage: y(2)
2

Or perhaps I am missing something.
-M. Hampton

On May 9, 9:17 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Fri, May 9, 2008 at 5:02 AM, Babai <[EMAIL PROTECTED]> wrote:
> > The RUN 2nd time:
>
> > x,y=var("x,y")
> > f(x,y)=sin(x)+cos(y)
> > grads=[diff(f,var) for var in (x,y)]
> > plot_vector_field(grads,[-5,5],[-5,5])
>
> > Result>>
> > Traceback (most recent call last):grads=[diff(f,var) for var in
> > (x,y)]
> > ValueError: too many values to unpack
>
> > in SAGE Notebook
>
> > Then I reduce the run to:
>
> > x,y=var("x,y")
>
> > I get the result:
>
> > Traceback (most recent call last):
> >  File "", line 1, in 
> >  File "/root/.sage/sage_notebook/worksheets/admin/6/code/6.py", line
> > 6, in 
> >x,y=var("x,y")
> >  File "/root/sage-3.0.1-fc8-x86-i686-Linux/local/lib/python2.5/site-
> > packages/sympy/plotting/", line 1, in 
>
> > ValueError: too many values to unpack
>
> With the above clearer description I am able to replicate this and do consider
> it a subtle, serious, and interesting bug.  Thanks for the bug report
> and persisting
> in explaining it well!   We are now tracking this at
>
> http://trac.sagemath.org/sage_trac/ticket/3144
>
> William
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: problem with 'view', question about 'view'

2008-05-09 Thread Yi Qiang

This actually bothered me for a while too. There is a patch on the
trac ticket, please test it out on Linux :-)

On Thu, May 8, 2008 at 5:16 PM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Thu, May 8, 2008 at 5:12 PM, William Stein <[EMAIL PROTECTED]> wrote:
>> On Wed, May 7, 2008 at 12:26 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>>>
>>> A problem: on my linux box, if I use 'view' (not in a notebook), an
>>> xdvi window appears then immediately disappears.  If I run view with
>>> 'debug=True', toward the end I get this:
>>>
>>> Output written on sage.dvi (1 page, 740 bytes).
>>> Transcript written on sage.log.
>>> gs: Unrecoverable error: limitcheck in .putdeviceprops
>>> xdvik gs_io: Broken pipe
>>> xdvik gs_io: Broken pipe
>>> xdvik gs_io: Broken pipe
>>> ghostscript died unexpectedly.
>>> xdvi.bin: spcl_scan: shouldn't happen: POST encountered, offset 659
>>>
>>> Has anyone seen this before?  (This works on my mac, just not on my
>>> linux box.)
>>>
>>
>> I have never seen that before.
>>
>>> And a question: on my mac, suppose I want to use TeXShop instead of
>>> xdvi to display the output of the view command.  Is there a way to do
>>> this?
>>>
>>
>> The use of xdvi is hardcoded in
>>
>> sage/misc/latex.py
>>
>> so the answer is I guess to change this and submit a patch
>> or make it a trac ticket.   It's reasonable to consider this
>> a bug, since view should I think just use the OS X open
>> command as defined in sage/misc/viewer.py, i.e., use
>> whatever is the default opener for a dvi file on your system.
>>
>> It's hardcoded xdvi right now since that was some of the first
>> sage code I ever wrote and that was long before I ported
>> Sage to run on OS X...
>
> OK, I made this trac #3137:
>
>  http://trac.sagemath.org/sage_trac/ticket/3137
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Fwd: ValueError

2008-05-09 Thread William Stein

On Fri, May 9, 2008 at 5:02 AM, Babai <[EMAIL PROTECTED]> wrote:
> The RUN 2nd time:
>>>
> x,y=var("x,y")
> f(x,y)=sin(x)+cos(y)
> grads=[diff(f,var) for var in (x,y)]
> plot_vector_field(grads,[-5,5],[-5,5])
>
> Result>>
> Traceback (most recent call last):grads=[diff(f,var) for var in
> (x,y)]
> ValueError: too many values to unpack
>
> in SAGE Notebook
>
> Then I reduce the run to:
>>>
> x,y=var("x,y")
>
> I get the result:
>>>
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/root/.sage/sage_notebook/worksheets/admin/6/code/6.py", line
> 6, in 
>x,y=var("x,y")
>  File "/root/sage-3.0.1-fc8-x86-i686-Linux/local/lib/python2.5/site-
> packages/sympy/plotting/", line 1, in 
>
> ValueError: too many values to unpack

With the above clearer description I am able to replicate this and do consider
it a subtle, serious, and interesting bug.  Thanks for the bug report
and persisting
in explaining it well!   We are now tracking this at

http://trac.sagemath.org/sage_trac/ticket/3144

William



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: Fwd: problem upgrading sage

2008-05-09 Thread mabshoff



On May 9, 11:45 am, "Eduardo Ocampo" <[EMAIL PROTECTED]> wrote:
> hi!

Hi Eduardo,

> Sage does not work anymore after upgrading, and i dont have any idea what
> could be the problem...could you please tell me what should I do?

You do not have m4 installed. Did you compile the original Sage from
sources or install a binary? If you installed a binary you probably
are missing a whole bunch of development tools.

Either way, Sage should check on upgrade that all the needed
development bits are installed. This is now 
http://trac.sagemath.org/sage_trac/ticket/3140

> I send here the screenshot, because I can't find any "config.log" file on de
> directories...

It is called install.log and is located in $SAGE_ROOT.

> best regards and thanks in advance
> Eduardo

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: md5sums of source code tarballs on download page?

2008-05-09 Thread mabshoff



On May 9, 8:46 am, Dan Drake <[EMAIL PROTECTED]> wrote:
> On the download page for the source code [1] it would be useful if, next
> to each link, there was a link to an md5sum (or sha1sum, etc) of the
> tarball. I know we've seen some corrupted downloads, and if an md5sum
> link is easy to find, it might encourage people to use it.

Yep.

> (Similar md5sum files might be useful on the binary download pages, too
> -- I notice there's one for the FC8 binary [2], but not for any of the
> other Linux binaries.)

I created those md5sums when creating the binaries on some remote
computer. Since I wanted to make sure they were not corrupted in the
process I also copied them over to sagemath.org and verified the
result.

We should open a ticket so that -sdist and -bdist automatically create
md5sums of the archives.

> Thanks!
>
> Dan

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] md5sums of source code tarballs on download page?

2008-05-09 Thread Dan Drake
On the download page for the source code [1] it would be useful if, next
to each link, there was a link to an md5sum (or sha1sum, etc) of the
tarball. I know we've seen some corrupted downloads, and if an md5sum
link is easy to find, it might encourage people to use it.

(Similar md5sum files might be useful on the binary download pages, too
-- I notice there's one for the FC8 binary [2], but not for any of the
other Linux binaries.)

Thanks!

Dan

  1. http://www.sagemath.org/dist/src/index.html
  2. http://www.sagemath.org/SAGEbin/linux/32bit/
-- 
---  Dan Drake <[EMAIL PROTECTED]>
-  KAIST Department of Mathematical Sciences
---  http://math.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] Re: bug in trac's diff?

2008-05-09 Thread mabshoff

On May 9, 9:42 am, "John Cremona" <[EMAIL PROTECTED]> wrote:

Hi,

> That's what it shows for a new file added to the repository, so the
> diff it shows is the diff between the new file and nothing, i.e.
> /dev/null.  I think!

That is correct. I still consider this odd, but you can always
download the patch and check out the real name of the added file.

> John

Cheers,

Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: bug in trac's diff?

2008-05-09 Thread John Cremona

That's what it shows for a new file added to the repository, so the
diff it shows is the diff between the new file and nothing, i.e.
/dev/null.  I think!

John

2008/5/9 David Joyner <[EMAIL PROTECTED]>:
>
> Hi:
>
> Does "/dev/null", around 40-50 lines down in
> http://trac.sagemath.org/sage_trac/attachment/ticket/3051/3051-unified-1.patch,
> seem strange to anyone? Shouldn't that be the name of a Python module?
>
> - David Joyner
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---