Re: [sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Tom Boothby
On Mon, Sep 12, 2011 at 10:18 PM, Dima Pasechnik  wrote:
> I guess this all boils down to the point made by William - that _pow_ needs
> to be integrated into the coersion framework (currently it is not).

+1.  Also, I should point out that I didn't make the decision myself
back then; I was sitting next to William at the time and we had quite
the lengthy discussion about it with some others in IRC.

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


Re: [sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Tom Boothby
I uniformized the behavior of 0^0 a long time ago (though I make no
claim about what has happened between then and now -- just that it was
uniform for a few precious minutes).  The decision back then (which I
still stand behind) is that while it is mathematically unjustifiable,
it's Python's convention so we should stick with it.

On Mon, Sep 12, 2011 at 10:28 AM, kcrisman  wrote:
>
>
> On Sep 12, 12:45 pm, Keshav Kini  wrote:
>> Hey Burcin,
>>
>> I guess that means you think that pynac should return 1 for 0^0, then? As
>> opposed to making Sage throw a ValueError or something at
>> Integer(0)^Integer(0) ?
>>
>
> I think that Sage has had 0^0 return 1 for quite some time now?  On
> the other hand, Wolfram Alpha doesn't like it, and Maxima raises an
> error.  I assume the BDFL has some input on this issue.
>
> - kcrisman
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Dima Pasechnik
I guess this all boils down to the point made by William - that _pow_ needs 
to be integrated into the coersion framework (currently it is not).

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


[sage-devel] Re: [sage-notebook] public single cell server

2011-09-12 Thread Alexander Juarez
Hi Jason,
This is really neat and I love the way the code view is integrated. I
was checking out the cell, and would suggest a version optimized for
handhelds.
Awesome work,
Alex Juarez

On Jul 29, 2011, at 2:11 PM, Jason Grout  wrote:

> Hi everyone,
>
> I'd like to announce a trial beta run of a public single cell server:
>
> http://sagemath.org:5467/
>
> The idea is that this is a single cell that can very easily be embedded in 
> any webpage.  This is the start of a comprehensive Sage web service as well, 
> and lays a piece of the ground work for a much more scalable model for doing 
> computations in the normal notebook.
>
> It's ready to be hammered by the larger community at this point.  I will be 
> mentioning this next week at Mathfest, so please try to break it :).  I think 
> just about any normal Sage computation should work.  Please report any errors 
> to me.
>
> We've also rewritten interacts, so please especially test interacts. There 
> are some exciting new features for interacts in this rewrite that I can 
> detail later.  The main focus for this testing is that current existing 
> interacts should work unchanged, hopefully.
>
> Thanks especially to Ira Hanson and Alex Kramer for doing much of the design 
> and implementation work (funded by Drake University and the NSF), to William 
> for an early version, and Fernando Perez and Robert Bradshaw for many helpful 
> conversations.  I'm sure there are people I've missed who have contributed in 
> some way; please let me know if I've missed someone!
>
> The repository for the code is: 
> https://github.com/jasongrout/simple-python-db-compute.  The instructions are 
> not quite up to date, but I'll be working on those soon.
>
> Thanks,
>
> Jason
>
> --
> Jason Grout

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Maarten Derickx
Here some random examples of wich I find the first one the strangest

sage: CC(0)^CC(0)
NaN - NaN*I

sage: a=GF(7)(0)
sage: a^a
...
ArithmeticError: 0^0 is undefined.


sage: a=Integers(7)(0)
sage: a^a
...
ArithmeticError: 0^0 is undefined.

sage: K.=QQ[]
sage: K(0)^K(0)
1

sage: K.=QQ[sqrt(2)]
sage: K
Number Field in sqrt2 with defining polynomial x^2 - 2
sage: K(0)^K(0)
1

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread kcrisman
> sage: SR(0^0)
> 1

Well, this is a red herring since 0^0 will evaluate, and SR(1) should
be 1.   What about CDF or other more bizarre rings?  But I agree with
you in principle.

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Nils Bruin
If one puts it this way:

sage: 0^0
1
sage: RDF(0)^RDF(0) #this one is the most dubious
1.0
sage: SR(0^0)
1
sage: SR(0)^SR(0)
RuntimeError: power::eval(): pow(0,0) is undefined

I think it's pretty clear that the error should go away unless there
are very convincing technical reasons.

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread kcrisman


On Sep 12, 12:45 pm, Keshav Kini  wrote:
> Hey Burcin,
>
> I guess that means you think that pynac should return 1 for 0^0, then? As
> opposed to making Sage throw a ValueError or something at
> Integer(0)^Integer(0) ?
>

I think that Sage has had 0^0 return 1 for quite some time now?  On
the other hand, Wolfram Alpha doesn't like it, and Maxima raises an
error.  I assume the BDFL has some input on this issue.

- kcrisman

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


Re: [sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Keshav Kini
Hey Burcin,

I guess that means you think that pynac should return 1 for 0^0, then? As 
opposed to making Sage throw a ValueError or something at 
Integer(0)^Integer(0) ?

I'll poke around :)

-Keshav

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


[sage-devel] Re: Finding the exact camera position in Jmol

2011-09-12 Thread Niles
Just printing the camera position would be a huge help!  I have been
trying to figure out the same thing for a while now.

-Niles

p.s.  Thanks Sébastian!!!


On Sep 10, 2:11 pm, Jonathan  wrote:
> If you are doing everything through Sage, would having Jmol print the
> rotation information to the web page be enough?  Then the user could
> do a cut and paste to use with the renderer they want.  Completely
> automating things would require more fiddling.
>
> Jonathan
>
> On Sep 9, 12:04 pm, Nils Bruin  wrote:
>
>
>
>
>
>
>
> > On Sep 9, 6:52 am, Jonathan  wrote:
>
> > > In theory this could be added to the javascript functions being
> > > included with the update to the Jmol interface which is coming with
> > > the switch to the new flask notebook, but I'm not sure this is the
> > > best solution.
>
> > > The new interface will include the ability to download a .jmol file
> > > to  your computer.
>
> > Yes, I agree that in practice that may well be a very good solution
> > for people who frequently do this and are familiar with the jmol
> > toolchain.
>
> > In principle, sage already offers capability like this because it
> > should be able to export a 3d scene as an "x3d" file (the last time I
> > looked there were some things broken about it), which can be loaded in
> > all kinds of software, including Blender. Quite possibly, Jmol has a
> > unique place in sage because it displays 3d scenes interactively and
> > does so (seemingly?) integrated in the notebook. Regardless of what
> > backend one want to use in Sage to produce the final rendering,
> > selecting a camera position is often done best interactively. So, if
> > jmol can do that and hand the camera position back to sage, that would
> > be great. It would allow seamless integration with the tachyon
> > raytracer
>
> > This is the kind of functionality I think one *expects* to be present.
> > It may be that it wouldn't actually get used and that people are quite
> > happy just cutting and pasting screen shots.
>
> > One application would be to give a simplified scene to jmol as a
> > preview, get the camera position, and then use tachyon to render the
> > final picture (possibly with millions of spheres or something else
> > beyond the scope of jmol).

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


Re: [sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Burcin Erocal
Hi Keshav,

On Mon, 12 Sep 2011 03:16:27 -0700 (PDT)
Keshav Kini  wrote:

> I believe that error message is propagated from GiNaC. See line 523
> of src/ginac/power.cpp in the pynac spkg. The error message is
> hard-coded and doesn't refer to python's eval() function.

This should be fixed in pynac. Since you already spent the time to
identify the problem, do you want to submit a patch with the fix?

https://bitbucket.org/burcin/pynac/src


Cheers,
Burcin

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Jean-Pierre Flori


On 12 sep, 12:16, Keshav Kini  wrote:
> Hi Simon,
>
> I believe that error message is propagated from GiNaC. See line 523 of
> src/ginac/power.cpp in the pynac spkg. The error message is hard-coded and
> doesn't refer to python's eval() function.
You're definitely right.
>
> -Keshav

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


[sage-devel] Re: ? sage/rings/finite_field_givaro.pyx

2011-09-12 Thread Keshav Kini
It was renamed in revision ed738932ba96 (sequential number 14045 in my tree, 
which I imagine should be the same for pretty much everyone else), to 
sage/rings/finite_rings/element_givaro.pyx , where it currently remains, 
just fyi. No idea why it's reappearing in your Sage, though.

-Keshav


Join us in #sagemath on irc.freenode.net !

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Keshav Kini
Hi Simon,

I believe that error message is propagated from GiNaC. See line 523 of 
src/ginac/power.cpp in the pynac spkg. The error message is hard-coded and 
doesn't refer to python's eval() function.

-Keshav

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


[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-12 Thread Simon King
Hi Keshav,

On 12 Sep., 11:30, Keshav Kini  wrote:
> RuntimeError: power::eval(): pow(0,0) is undefined

That error message is an interesting statement, because it is wrong,
even in pure Python:
>>> pow(0,0)
1

The error message mentions "eval", but it doesn't seem to be eval's
fault either:

>>> eval("pow(0,0)")
1

Sage yields the same result for pow(0,0) and eval("pow(0,0)"). So, to
the very least, the error message is misleading.

Best regards,
Simon

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


[sage-devel] GiNaC and Python disagree on arithmetic

2011-09-12 Thread Keshav Kini
Here is a sample:

sage: 0^0
1
sage: (x^x)(x=0)
---
RuntimeError  Traceback (most recent call last)

/home/fs/ in ()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so in 
sage.symbolic.expression.Expression.__call__ 
(sage/symbolic/expression.cpp:16183)()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in 
sage.symbolic.ring.SymbolicRing._call_element_ 
(sage/symbolic/ring.cpp:6633)()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so in 
sage.symbolic.expression.Expression.substitute 
(sage/symbolic/expression.cpp:15547)()

RuntimeError: power::eval(): pow(0,0) is undefined
sage: 

What is the desirable solution? Should we make Sage say that 0^0 is 
undefined? Or am I misunderstanding what's going on here?

-Keshav

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


[sage-devel] Re: ? sage/rings/finite_field_givaro.pyx

2011-09-12 Thread leif
On 12 Sep., 11:05, leif  wrote:
> After rebuilding Sage (not just the library), I somehow get this file
> back.
>
> It is empty, and according to Mercurial, it was last modified by #8220
> (but not deleted or renamed *there*).
>
> Any idea how or why this happens?


P.S.: This is not reproducible by simply touching some spkg the Sage
library depends on (I tried Symmetrica), and rebuilding with 'env
SAGE_UPGRADING=yes make build'.

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


[sage-devel] ? sage/rings/finite_field_givaro.pyx

2011-09-12 Thread leif
After rebuilding Sage (not just the library), I somehow get this file
back.

It is empty, and according to Mercurial, it was last modified by #8220
(but not deleted or renamed *there*).

Any idea how or why this happens?


-leif

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


Re: [sage-devel] Re: problem installing 4ti2 spkg

2011-09-12 Thread William Stein
On Sun, Sep 11, 2011 at 8:30 PM, John H Palmieri  wrote:
>
>
> On Sunday, September 11, 2011 8:13:53 PM UTC-7, William wrote:
>>
>> On Sun, Sep 11, 2011 at 11:17 AM, John H Palmieri
>>  wrote:
>> > When I log in to sage.math, I see the file
>> >
>> >   /home/sagemath/www/packages/experimental/4ti2-20061025.spkg
>> >
>> > which is the wrong version.  The other appropriate directories in
>> > /home/sagemath/ contain the correct version of this spkg.  Do we just
>> > need
>> > to replace this file with the correct one?
>> >
>>
>> I'm sure that the answer is NO.    See the section "New SPKGs procedure"
>> in
>>
>>             more /home/sage/www2-dev/README.TXT
>
> Ah, so I should copy the new file, remove the old one, and then run
> "~/mirror t".  Should I take care of that?

That's what it sounds like.  Try it, and if it doesn't work, we'll
know the README.txt is wrong.

William

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



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

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