[sage-support] Re: coercion bug?

2009-03-11 Thread William Stein

On Wed, Mar 11, 2009 at 5:23 PM, Alex Raichev  wrote:
>
>> What would you want to do with QQbar in the Symbolic Ring?
>
> Everything: differentiate functions with coefficients in QQbar,
> integrate them, etc.
>    I too don't know anything about Maxima or the new symbolics
> package in preparation --Pynac is it?  So, i'm just standing on the
> sidelines cheering "Go symbolics with QQbar! Go!"

You can already work with QQbar and symbolic variables using pynac,
which is in sage already:

--
| Sage Version 3.4, Release Date: 2009-03-10 |
| Type notebook() for the GUI, and license() for information.|
--
sage: var('x,y',ns=1)
(x, y)
sage: a = QQbar(3).sqrt()
sage: a
1.732050807568878?
sage: f = x*a + y
sage: f
1.732050807568878?*x + y
sage: f^2
(1.732050807568878?*x + y)^2
sage: expand(f^2)
3*x^2 + 3.464101615137755?*x*y + y^2
sage: expand(f^2).diff(x)
6*x + 3.464101615137755?*y
sage: expand(f^2).diff(y)
3.464101615137755?*x + 2*y




-- 
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 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X > 0?

2009-03-11 Thread Ajay Rawat
sage: a=integrate(sin(t*t),t,0,3)
sage: a
sqrt(pi)*((sqrt(2)*I + sqrt(2))*erf((3*sqrt(2)*I + 3*sqrt(2))/2) +
(sqrt(2)*I - sqrt(2))*erf((3*sqrt(2)*I - 3*sqrt(2))/2))/8




-- 
Ajay Rawat
Kalpakkam, IGCAR

-
Save Himalayas
-

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: patch failed to apply

2009-03-11 Thread mabshoff



On Mar 11, 5:41 pm, Florian  wrote:
> Hello!

Hi Florian,

> I am trying to apply the patch variety_bugfix (ticket #5486).
>
> hg_sage.patch(...) terminates with the following error:
> applying /tmp/variety_bugfix.patch
> patching file sage/rings/polynomial/multi_polynomial_ideal.py
> Hunk #1 FAILED at 819
> Hunk #3 FAILED at 1886
> 2 out of 3 hunks FAILED -- saving rejects to file sage/rings/
> polynomial/multi_polynomial_ideal.py.rej
> abort: patch failed to apply
>
> Does anyone know what the problem is?

You do not specify the version of Sage you want to apply this patch
against, but the patch at the ticket is against some Sage release post
3.4.rc0.

> Thanks,
> Florian

Cheers,

Michael
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] patch failed to apply

2009-03-11 Thread Florian

Hello!

I am trying to apply the patch variety_bugfix (ticket #5486).

hg_sage.patch(...) terminates with the following error:
applying /tmp/variety_bugfix.patch
patching file sage/rings/polynomial/multi_polynomial_ideal.py
Hunk #1 FAILED at 819
Hunk #3 FAILED at 1886
2 out of 3 hunks FAILED -- saving rejects to file sage/rings/
polynomial/multi_polynomial_ideal.py.rej
abort: patch failed to apply

Does anyone know what the problem is?

Thanks,
Florian
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: coercion bug?

2009-03-11 Thread Alex Raichev

> What would you want to do with QQbar in the Symbolic Ring?

Everything: differentiate functions with coefficients in QQbar,
integrate them, etc.
I too don't know anything about Maxima or the new symbolics
package in preparation --Pynac is it?  So, i'm just standing on the
sidelines cheering "Go symbolics with QQbar! Go!"

Alex
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Fwd: two questions about sage-mode

2009-03-11 Thread Alex Ghitza
-- Forwarded message --
From: Nick Alexander 
Date: Thu, Mar 12, 2009 at 10:08 AM
Subject: Re: two questions about sage-mode
To: Alex Ghitza 



On 11-Mar-09, at 3:48 PM, Alex Ghitza wrote:

 Hi folks,
>
> Quite a few people at Sage Days 14 are fans of emacs and therefore trying
> to use sage-mode.  In particular, Mike Stillman had two questions that I
> didn't know how to answer.  It might be that these are not implemented as of
> yet and should be, in which case I'll make enhancement trac tickets for
> them:
>
> 1. suppose you run doctests on a file from inside emacs, and that you get a
> failure with a line number; is there a sage-mode way of jumping to that line
> in the source file?
>

Are you using sage-test?  (I have it bound to C-c C-t).  Then you can use
the standard emacs C-x ` (next-error) to jump around.  I could improve this
if necessary.

 2. is there an easy way of restarting sage in emacs?  or even to rebuild
> and restart?  this would come in handy when making changes to the sage
> library
>

Yes, newer versions have rerun-sage (which kills and restarts an existing
session), sage-build (which builds) and C-u sage-build which builds and
reruns.  sage-build is bound to C-c C-b for me -- I don't think I bind them
by default.  Sorry that the documentation is scant, sounds like that really
needs work.  Try them out!

Thanks for the feedback,
Nick



-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne --
Australia -- http://www.ms.unimelb.edu.au/~aghitza/

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: coercion bug?

2009-03-11 Thread Robert Bradshaw

On Mar 11, 2009, at 3:50 PM, Carl Witty wrote:

>
> On Mar 11, 2:55 pm, Alex Raichev  wrote:
 Well, I think I can explain what's happening.  There's a  
 coercion from
 arbitrary polynomials into the Symbolic Ring; this is useful,  
 because
 it lets you deal with polynomials over the rationals, etc.
>>
>> Similarly, i think a coercion from QQbar and polynomials over  
>> QQbar to
>> the Symbolic Ring would be useful.  At least it is in my work.  What
>> do you all think?  As it stands Sage gives the error below.
>
> What would you want to do with QQbar in the Symbolic Ring?  I don't
> know how to pass an arbitrary element of QQbar to maxima (but I don't
> know much about maxima); does maxima deal with arbitrary algebraic
> numbers?

Not that I know of. Perhaps there's a "roots of" function, though I  
wasn't able to find it. Now there should be a conversion, in the  
cases that maxima is able to explicitly find the roots.

- Robert


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: coercion bug?

2009-03-11 Thread Carl Witty

On Mar 11, 2:55 pm, Alex Raichev  wrote:
> > > Well, I think I can explain what's happening.  There's a coercion from
> > > arbitrary polynomials into the Symbolic Ring; this is useful, because
> > > it lets you deal with polynomials over the rationals, etc.
>
> Similarly, i think a coercion from QQbar and polynomials over QQbar to
> the Symbolic Ring would be useful.  At least it is in my work.  What
> do you all think?  As it stands Sage gives the error below.

What would you want to do with QQbar in the Symbolic Ring?  I don't
know how to pass an arbitrary element of QQbar to maxima (but I don't
know much about maxima); does maxima deal with arbitrary algebraic
numbers?

Carl

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] two questions about sage-mode

2009-03-11 Thread Alex Ghitza
Hi folks,

Quite a few people at Sage Days 14 are fans of emacs and therefore trying to
use sage-mode.  In particular, Mike Stillman had two questions that I didn't
know how to answer.  It might be that these are not implemented as of yet
and should be, in which case I'll make enhancement trac tickets for them:

1. suppose you run doctests on a file from inside emacs, and that you get a
failure with a line number; is there a sage-mode way of jumping to that line
in the source file?

2. is there an easy way of restarting sage in emacs?  or even to rebuild and
restart?  this would come in handy when making changes to the sage library

Best,
Alex


-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne --
Australia -- http://www.ms.unimelb.edu.au/~aghitza/

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: instructions for installing sage do not work

2009-03-11 Thread Robert Bradshaw

On Mar 11, 2009, at 8:57 AM, nsauer wrote:

>
> Thanks for replying;
>
> I start sage by double clicking on the name "sage" in the finder.
> It is  in /Applications/sage/
> This file sage, in /Applications/sage/ is a Unix Executible File.
> Even so, if in the terminal I change the directory to
> /Applications/sage/ and type sage
> I get the return that
> -bash: sage: command not found

OK, what you need to do is cd into the directory then type

./sage

or

./sage -b

to build the changes. By default, bash looks for commands in a  
specified set of directories (the PATH environment variable) but if  
you specify a path (./sage means the "sage" file in the current  
directory) it will forgo the lookup and use that one.

> I also looked at all the other usual places to find an executible
> "sage" file, but there does not seem to be one.
>
> I am not Unix experienced enough to sort this out.
>
> Thanks again,
>
> Norbert
>
>
>
> On Mar 10, 9:58 pm, Robert Bradshaw 
> wrote:
>> How are you starting up Sage? If you're starting up sage via
>>
>> /path/into/folder/sage
>>
>> then you'll have to do
>>
>> /path/into/folder/sage -b
>>
>> On Mar 10, 2009, at 8:52 PM, nsauer wrote:
>>
>>
>>
>>> Thanks for the help. I made the changes
>>> but failed to recompile. Here is what I did:
>>> (test is my home name) where is this sage binary?
>>
>>> Laptop-3:~ test$ sage -b
>>> -bash: sage: command not found
>>
>>> Laptop-3:/ test$ sage -b
>>> -bash: sage: command not found
>>
>>> Laptop-3:sage test$ sage -b
>>> -bash: sage: command not found
>>
>>> sage: sage -b
>>>  
>>> --
>>> -
>>> NameError Traceback (most recent  
>>> call
>>> last)
>>
>>> /Users/test/ in ()
>>
>>> NameError: name 'b' is not defined
>>> sage:
>>
>>> Norbert
>>
>>> On Mar 10, 2:28 pm, John H Palmieri  wrote:
 On Mar 10, 1:00 pm, nsauer  wrote:
>>
> Thanks for your reply;
>>
> As I am completely new to sage I do not know how to
> perform the indicated change. I looked at the file
> sage/devel/sage/sage/matrix0.pyx
> but could not figure out how and where to add
> the function sage.matrix.matrix0.set_latex_delimiters('[',']')
>>
 If you want to make a change just for your own personal use  
 (that is,
 switching to square brackets, not implementing  
 set_latex_delimiters),
 then in the line
>>
 return "\\left(\\begin{array}{%s}\n"%format + s + "\n\\end
 {array}\\right)"
>>
 change '\\left(' to '\\left[' and similarly change '\\right)' to '\
 \right]'.  Run 'sage -b' to recompile the changed file.  If you're
 going to be using 0 x n matrices, or n x 0 matrices, then you  
 should
 also change the parentheses to brackets in this line (36 lines
 earlier):
>>
   return "()"
>>
 --
 John
> >


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Robert Bradshaw


On Mar 11, 2009, at 4:56 AM, Mani chandra wrote:

>
> Hi,
>
> The following function gives me an error.
>
>  def test(l, r):
>return complex(0, 1)**l*spherical_bessel_J(l, r)

[...]

>
> TypeError: unsupported operand parent(s) for '*': ' 'complex'>' and
> 'Symbolic Ring'
>
>
> Help appreciated. Thank you

This was fixed in http://trac.sagemath.org/sage_trac/ticket/5423 . E.g.

sage: complex(3,1) * SR(I)
I*(1.0*I + 3.0)

- Robert

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: coercion bug?

2009-03-11 Thread Alex Raichev

> > Well, I think I can explain what's happening.  There's a coercion from
> > arbitrary polynomials into the Symbolic Ring; this is useful, because
> > it lets you deal with polynomials over the rationals, etc.

Similarly, i think a coercion from QQbar and polynomials over QQbar to
the Symbolic Ring would be useful.  At least it is in my work.  What
do you all think?  As it stands Sage gives the error below.

Alex

--
| Sage Version 3.3, Release Date: 2009-02-21 |
| Type notebook() for the GUI, and license() for information.|
--
sage: var('t')
t
sage: QQbar(2)*t
---
TypeError Traceback (most recent call
last)

/Users/arai021/ in ()

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/
structure/element.so in sage.structure.element.RingElement.__mul__
(sage/structure/element.c:8632)()

/Applications/sage-3.3/local/lib/python2.5/site-packages/sage/
structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/
coerce.c:5847)()

TypeError: unsupported operand parent(s) for '*': 'Algebraic Field'
and 'Symbolic Ring'




On Mar 11, 5:01 pm, Robert Bradshaw 
wrote:
> On Mar 10, 2009, at 8:57 PM, Carl Witty wrote:
>
>
>
> > On Mar 10, 6:47 pm, Alex Raichev  wrote:
> >> Does anyone know what's up with this weird error?  Sage can  
> >> multiply a
> >> symbolic variable and a constant of a polynomial ring R but not a
> >> symbolic variable and an element of R.base_ring().
>
> >> Alex
>
> >> sage: var('t')
> >> t
> >> sage: K.= NumberField(t^2+2,'a')
> >> sage: R.= PolynomialRing(K)
> >> sage: t*R(a)
> >> a*t
> >> sage: t*a
> >> -
> >> --
> >> TypeError                                 Traceback (most recent call
> >> last)
>
> > Well, I think I can explain what's happening.  There's a coercion from
> > arbitrary polynomials into the Symbolic Ring; this is useful, because
> > it lets you deal with polynomials over the rationals, etc.  There's no
> > coercion from number fields into the Symbolic Ring, because the
> > Symbolic Ring can't do anything useful with them.
>
> > When you do t*R(a), that's exactly equivalent to var('a,t'); t*a.  The
> > fact that a is a number field generator is lost, and it just becomes a
> > symbolic variable.  (In particular, you'll notice that t*R(a)^2
> > doesn't reduce the a^2.)
>
> > Since t*R(a) is so useless, it would be better if it didn't work; I'm
> > not sure how hard it would be to change the coercion setup there,
> > though.
>
> That may actually already be fixed inhttp://trac.sagemath.org/
> sage_trac/attachment/ticket/5423/trac_5423.patch . (It tests to see  
> if there's a coercion from the basering before allowing coercion of  
> the polynomial ring.)
>
> - Robert
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: applying patch produces an error

2009-03-11 Thread Jason Grout

Florian wrote:
> I realize I wasn't root. After becoming root, I get a different error.
> 
> "Refusing to do operation since you still have unrecorded changes. You
> must check in all changes in your working repository first."
> 
> I am not a linux person. Can anybody decode this for me?
> 

This sounds like a mercurial thing.  It sounds like you have modified 
files, but haven't saved your changes to the source code control system, 
so applying the patch would corrupt things.

Try checking the status of your files to see what you might have 
changed.  From the command line, you can do hg status in the 
sage/devel/sage/sage/ directory, or from sage, you can do hg_sage.status()

Thanks,

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: applying patch produces an error

2009-03-11 Thread Florian

I realize I wasn't root. After becoming root, I get a different error.

"Refusing to do operation since you still have unrecorded changes. You
must check in all changes in your working repository first."

I am not a linux person. Can anybody decode this for me?

Thanks!
Florian

On Mar 11, 3:43 pm, Florian  wrote:
> Hi everyone,
>
> I am trying to apply a patch. I downloaded the actual patch (not the
> html file) to /tmp
> and called both hg_sage.apply('...') as well as hg_sage.patch('...')
> from the sage prompt.
>
> Both calls result in various (insignificant) warnings and an error:
>
> cd "/usr/local/sage/devel/sage" && hg import   "/tmp/
> variety_bugfix.patch"
> Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
> untrusted user sage, group sage
> Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
> untrusted user sage, group sage
> abort: could not lock working directory of /usr/local/sage/devel/sage-
> main: Permission denied
>
> Any suggestions would be very welcome!
>
> Thanks!
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] applying patch produces an error

2009-03-11 Thread Florian

Hi everyone,

I am trying to apply a patch. I downloaded the actual patch (not the
html file) to /tmp
and called both hg_sage.apply('...') as well as hg_sage.patch('...')
from the sage prompt.

Both calls result in various (insignificant) warnings and an error:

cd "/usr/local/sage/devel/sage" && hg import   "/tmp/
variety_bugfix.patch"
Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
untrusted user sage, group sage
Not trusting file /usr/local/sage/devel/sage-main/.hg/hgrc from
untrusted user sage, group sage
abort: could not lock working directory of /usr/local/sage/devel/sage-
main: Permission denied

Any suggestions would be very welcome!

Thanks!
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X > 0?

2009-03-11 Thread Jason Grout

David Joyner wrote:
> I agree
> 
> sage: a = integrate(sin(t*t),t,0,3)
> sage: a.n(3)
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (897, 0))
> 

Maybe this is the same bug as:

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

Jason




> 
> 
> has a strange error message which might (or might not)
> indicate a bug of some type. Generally, though, I think
> a.n(3) tries to first evaluate a as an exact expression, which
> it can't (AFAIK) do, then coerce a into the appropriate
> floating point data type. Type a.n?? to see  the source code.
> 
> 
> 
> On Wed, Mar 11, 2009 at 2:47 PM, seber...@spawar.navy.mil
>  wrote:
>> Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X >
>> 0?
>>
>> cs
> 
> > 
> 


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

2009-03-11 Thread David Joyner

On Wed, Mar 11, 2009 at 2:52 PM, mark mcclure  wrote:
>
>
>
> On Mar 11, 2:46 pm, David Joyner  wrote:
>> sage: t = var("t")
>> sage: numerical_integral(abs(sin(t^2)),0,3)
>> (1.7024100330599248, 1.5397333279914378e-06)
>>
>> because AFAIK, integrate(abs(sin(t*t)),t,0,3)
>> cannot be computed in closed form.
>
> Mathematica returns the result in terms of Fresnel functions.


Point taken. However, integrate(abs(sin(t*t)),t,0,3) is
by definition (since sin(x)>0 in that interval) the
Fresnel integral S(3), http://en.wikipedia.org/wiki/Fresnel_integral,
and just renaming it doesn't make it a closed form expression:-)


> Maxima can find the indefinite integral in terms of the error
> function.  What Maxima *can't* do is deal with absolute values
> in a definite integral.  Try:
> integrate(abs(sin(t)), t, 0, pi)
>
> The result returns unevaluated, even though the integrand is
> positive on the integral.  I think I saw that on the Maxima
> discussion group a bit ago.
>
> Mark McClure
>
> >
>

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

2009-03-11 Thread mark mcclure

> > Mathematica returns the result in terms of Fresnel functions.
>
> Point taken. However, integrate(abs(sin(t*t)),t,0,3) is
> by definition (since sin(x)>0 in that interval) the
> Fresnel integral S(3),http://en.wikipedia.org/wiki/Fresnel_integral,
> and just renaming it doesn't make it a closed form expression:-)

Absolutely, definitely a special function.

The main point I wanted to make, though, is that Maxima can't even
do integrate(abs(sin(t)), t, 0, pi).  It can't deal with absolute
values
in definite integrals ever.  So the discussion in this thread and the
parallel thread is a bit moot. :)

Mark

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X > 0?

2009-03-11 Thread David Joyner

I agree

sage: a = integrate(sin(t*t),t,0,3)
sage: a.n(3)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (897, 0))



has a strange error message which might (or might not)
indicate a bug of some type. Generally, though, I think
a.n(3) tries to first evaluate a as an exact expression, which
it can't (AFAIK) do, then coerce a into the appropriate
floating point data type. Type a.n?? to see  the source code.



On Wed, Mar 11, 2009 at 2:47 PM, seber...@spawar.navy.mil
 wrote:
>
> Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X >
> 0?
>
> cs
> >
>

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

2009-03-11 Thread mark mcclure



On Mar 11, 2:46 pm, David Joyner  wrote:
> sage: t = var("t")
> sage: numerical_integral(abs(sin(t^2)),0,3)
> (1.7024100330599248, 1.5397333279914378e-06)
>
> because AFAIK, integrate(abs(sin(t*t)),t,0,3)
> cannot be computed in closed form.

Mathematica returns the result in terms of Fresnel functions.
Maxima can find the indefinite integral in terms of the error
function.  What Maxima *can't* do is deal with absolute values
in a definite integral.  Try:
integrate(abs(sin(t)), t, 0, pi)

The result returns unevaluated, even though the integrand is
positive on the integral.  I think I saw that on the Maxima
discussion group a bit ago.

Mark McClure

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X > 0?

2009-03-11 Thread seber...@spawar.navy.mil

Why integrate(sin(t*t),t,0,3).n(X) blows up for (apparently) all X >
0?

cs
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Galois group

2009-03-11 Thread David Joyner

On Wed, Mar 11, 2009 at 2:13 PM, Jaakko  wrote:
>
> I would like to determine the Galois group of x^12 + 2x +2 over Q. I
> don't know how to read the answer I got from Sage:
>
> sudo ./sage -i database_gap-4.4.9
> Installing database_gap-4.4.9
> Calling sage-spkg on database_gap-4.4.9
> You must set the SAGE_ROOT environment variable or
> run this script from the SAGE_ROOT or
> SAGE_ROOT/local/bin/ directory.
> database_gap-4.4.9
> Machine:
> Linux jaakko-desktop 2.6.27-11-generic #1 SMP Thu Jan 29 19:24:39 UTC
> 2009 i686 GNU/Linux
> sage: /home/jaakko/sage-3.2.3/database_gap-4.4.9 is already installed
> jaa...@jaakko-desktop:~/sage-3.2.3$ ./sage
> --
> | Sage Version 3.2.3, Release Date: 2009-01-05                       |
> | Type notebook() for the GUI, and license() for information.        |
> --
> sage: NumberField(x^12+2*x+2, 'a').galois_group()
> verbose 0 (501: permgroup_named.py, __init__) Warning: Computing with
> TransitiveGroups requires the optional database_gap package. Please
> install it.
> Galois group Transitive group number 301 of degree 12 of the Number
> Field in a with defining polynomial x^12 + 2*x + 2
>
> What does the "Transitive group number 301 of degree 12" means?

In other words,

G = TransitiveGroup(12, 301)

The command

TransitiveGroup?

gives more details.


>
> >
>

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Galois group

2009-03-11 Thread Jaakko

I would like to determine the Galois group of x^12 + 2x +2 over Q. I
don't know how to read the answer I got from Sage:

sudo ./sage -i database_gap-4.4.9
Installing database_gap-4.4.9
Calling sage-spkg on database_gap-4.4.9
You must set the SAGE_ROOT environment variable or
run this script from the SAGE_ROOT or
SAGE_ROOT/local/bin/ directory.
database_gap-4.4.9
Machine:
Linux jaakko-desktop 2.6.27-11-generic #1 SMP Thu Jan 29 19:24:39 UTC
2009 i686 GNU/Linux
sage: /home/jaakko/sage-3.2.3/database_gap-4.4.9 is already installed
jaa...@jaakko-desktop:~/sage-3.2.3$ ./sage
--
| Sage Version 3.2.3, Release Date: 2009-01-05   |
| Type notebook() for the GUI, and license() for information.|
--
sage: NumberField(x^12+2*x+2, 'a').galois_group()
verbose 0 (501: permgroup_named.py, __init__) Warning: Computing with
TransitiveGroups requires the optional database_gap package. Please
install it.
Galois group Transitive group number 301 of degree 12 of the Number
Field in a with defining polynomial x^12 + 2*x + 2

What does the "Transitive group number 301 of degree 12" means?

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

2009-03-11 Thread David Joyner

Do you mean

sage: t = var("t")
sage: numerical_integral(abs(sin(t^2)),0,3)
(1.7024100330599248, 1.5397333279914378e-06)

because AFAIK, integrate(abs(sin(t*t)),t,0,3)
cannot be computed in closed form.


On Wed, Mar 11, 2009 at 2:19 PM, seber...@spawar.navy.mil
 wrote:
>
> Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?
>
> Sage just returns the question...
>
> sage: integrate(abs(sin(t*t)),t,0,3)
> integrate(abs(sin(t^2)), t, 0, 3)
>
>
> cs
> >
>

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Variable plot limits

2009-03-11 Thread mark mcclure

On Mar 10, 1:10 pm, roleic  wrote:
> In integrals variable integration limits work fine with sage.
> Now I would like to plot the variable integration range with plot3d or
> parametric_plot3d using variable plot range limits:
>
> u,v = var('u v')
> parametric_plot3d([u, v, u*0.1], (u, 0, 6), (v, 0, u))

In this example at least, you can parameterize the surface more
carefully.  Since x = u, y = u*v maps a square in the uv-plane to
a triangle in the xy-plane, (u, u*v, f(u, u*v)) parameterizes the
portion of the surface you want over the region of interest.  More
generally, x = u, y = (1-v)*g(u) + v*h(u) parameterizes the region
between the graphs of the functions g and h.  Thus, you could
do your example like so:

(x,y,u,v) = var('x,y,u,v')
f(x,y) = 0.1*x;
parametric_plot3d([u,u*v,f(u,u*v)],
  (u,0,2), (v,0,2))

Have fun,
Mark McClure

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

2009-03-11 Thread seber...@spawar.navy.mil

Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?

Sage just returns the question...

sage: integrate(abs(sin(t*t)),t,0,3)
integrate(abs(sin(t^2)), t, 0, 3)


cs
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Carl Witty

On Mar 11, 10:47 am, Mani chandra  wrote:
> Also I tried some basic stuff with "I" and it doesn't seem to be working.
>
> sage: exp(I).real
> 

Sage prefers methods to properties:

sage: exp(I).real()
cos(1)

Using

z = exp(I*r*cos(theta)).real()

makes your parametric_plot3d work, too.

Carl

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Mani chandra

Simon King wrote:
> Dear Mani chandra,
>
> something really weird seems to be going on. This is a fresh session
> of Sage 3.3:
>
> sage: complex(0,1)*spherical_bessel_J(1,1)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/king/.sage/temp/mpc739/24191/_home_king__sage_init_sage_0.py in
> ()
>
> /home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
> sage/structure/element.so in
> sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
> 8632)()
>
> /home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
> sage/structure/coerce.so in
> sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/
> coerce.c:5847)()
>
> TypeError: unsupported operand parent(s) for '*': ''
> and 'Symbolic Ring'
> sage: complex(0,1)*spherical_bessel_J(1,1)
> 1.0*(sin(1) - cos(1))*I
>
>
>
> In other words, calling complex(0,1)*spherical_bessel_J(1,1) for the
> first time yields a bug. Calling it the second time yields a result.
>
> Do people agree that this is a bug? Shall I open a ticket?
>
>
> I guess that, as a work-around, you should consider using a different
> implementation of the complex unit in Sage.
> There are (at least):
>  * complex(0,1), which AFAIK is a Python builtin
>  * I, which belongs to the "Symbolic Ring":
> sage: I^2
> -1
> sage: I.parent()
> Symbolic Ring
>  * The imaginary unit in the complex double field:
> sage: CDF(0,1)
> 1.0*I
> sage: CDF(0,1)^2
> -1.0 + 1.22464679915e-16*I
> As you can see, CDF is numeric with the usual errors of numerical data
> types.
>
> Since "spherical_bessel_J" lives in the Symbolic world, i guess that
> using "I" would work around the error.
>
> Cheers,
>Simon
> >
>
>   
Hi,

Thanks for the reply. I tried using "I" but doesn't seem to work in 
my context.

r, theta = var('r, theta')
x = r*cos(theta)
y = r*sin(theta)
z = exp(I*r*cos(theta)).real

parametric_plot3d( [x, y, z], (r, 0, 10), (theta, 0, 2*pi) )

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/sage/sagenb/sage_notebook/worksheets/mc0710/7/code/8.py", line 
12, in 
parametric_plot3d( [x, y, z], (r, _sage_const_0 , _sage_const_10 ), (theta, 
_sage_const_0 , _sage_const_2 *pi) )
  File 
"/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/",
 line 1, in 

  File "base.pyx", line 61, in sage.plot.plot3d.base.Graphics3d.__repr__ 
(sage/plot/plot3d/base.c:1973)
  File "base.pyx", line 547, in sage.plot.plot3d.base.Graphics3d.show 
(sage/plot/plot3d/base.c:9001)
  File "base.pyx", line 318, in 
sage.plot.plot3d.base.Graphics3d._prepare_for_jmol 
(sage/plot/plot3d/base.c:5762)
  File "base.pyx", line 333, in 
sage.plot.plot3d.base.Graphics3d._box_for_aspect_ratio 
(sage/plot/plot3d/base.c:6233)
  File "base.pyx", line 108, in 
sage.plot.plot3d.base.Graphics3d._safe_bounding_box 
(sage/plot/plot3d/base.c:2740)
  File "parametric_surface.pyx", line 174, in 
sage.plot.plot3d.parametric_surface.ParametricSurface.bounding_box 
(sage/plot/plot3d/parametric_surface.c:2133)
  File "parametric_surface.pyx", line 213, in 
sage.plot.plot3d.parametric_surface.ParametricSurface.triangulate 
(sage/plot/plot3d/parametric_surface.c:2609)
  File "parametric_surface.pyx", line 208, in 
sage.plot.plot3d.parametric_surface.triangulate 
(sage/plot/plot3d/parametric_surface.c:2551)
  File "parametric_surface.pyx", line 395, in 
sage.plot.plot3d.parametric_surface.ParametricSurface.eval_grid 
(sage/plot/plot3d/parametric_surface.c:3978)
TypeError: real() takes exactly 1 argument (3 given)


Also I tried some basic stuff with "I" and it doesn't seem to be working.

sage: exp(I).real


Thanking you,
Mani chandra




--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] looking for a Sage IDE: Anybody using emacs sage-mode or eclipse-pydev out there?

2009-03-11 Thread Iwan Lappo-Danilewski

To actually do some coding it would be nice to have some sort of IDE
on my ubuntu machine. So I first gave emacs sage-mode a try, installed
it according to wiki (http://wiki.sagemath.org/sage-mode) using the
output form the install script to set up ~/.emacs.

Code Highlighting works.. but Ctrl-c Ctrl-c offers me
"Wrong type argument: stringp, t"

Guess that's what the wiki meant by "might fail miserably". Moreover
my entire python-mode is broken afterwards (all Ctrl-c related
commands beeing unknown or broken gving the same error) and only a
revert of the ~/.emacs file (in my case deletion) fixes it.



So I gave eclipse-pydev a try.. But if I write e.g.

from sage.all import *
text("Sage is really neat!!",(2,12)).show()

I get "ImportError: No module named sage.all", which is easily fixed
by importing "$SAGE_ROOT/devel/sage-main/" to the
project>properties>external source folders

But then I get 2 times:
"raise RuntimeError, "To use the SAGE libraries, set the environment
variable SAGE_ROOT to the SAGE build directory and LD_LIBRARY_PATH to
$SAGE_ROOT/local/lib"

my "/etc/environment" reads

'PATH=".. : ../sage-3.2.3-ubuntu-32bit-intel_xeon-i686-Linux/"
SAGE_ROOT = ".../sage-3.2.3-ubuntu-32bit-intel_xeon-i686-Linux/"
LD_LIBRARY_PATH = ".../sage-3.2.3-ubuntu-32bit-intel_xeon-i686-Linux/
local/lib'

though.. Am I not getting something right here?

Same errors with just "python test.sage". Best thing would probably be
using sage as a pydev-interpreter, but that it seems to fail some
interpreter tests they require..

What IDE to use then?
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: symbolic matrix multiplication in sage

2009-03-11 Thread alex

Thank you very much, for the useful information !

Where can I find a complete and good documentation about Sage, better
then the tutorial or the reference ?

Thank you again.

On Mar 10, 8:00 pm, Jason Grout  wrote:
> alex wrote:
> > This seems to work:
> > given a symbolic matrix P of dimension 2x2 do:
>
> > EVECP = maxima(P).eigenvectors()
> > EVEC1 = EVECP.part(2)
> > (first eigenvector)
> > EVEC2 = EVECP.part(3)
> > (second eigenvector)
> > EIGENVECT = (matrix(SR, 2,2, [EVEC1.sage(), EVEC2.sage()])).transpose
> > ()(matrix of eigenvectors)
>
> > for the inverse:
> > EIGENVECTINV = EIGENVECT.inverse()
> > (EIGENVECTINV * EIGENVECT).simplify_rational()
> > gives identity matrix.
>
> > the eigenvalues of P with multiplicity (!) can be read with
> > EVECP.part(1)
>
> > Is this correct ?
>
> > Is there a way to symbolically compute the matrix exponential
> > directly ?
> > THX !
>
> There should be a matrix exponential function:
>
> sage: var('a,b,c,d')
> (a, b, c, d)
> sage: A=matrix([[a,0],[0,d]])
> sage: A.exp()
>
> [e^a   0]
> [  0 e^d]
> sage: A=matrix([[a,2],[0,d]])
> sage: A.exp()
>
> [e^a (2*e^d - 2*e^a)/(d - a)]
> [  0 e^d]
>
> 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: tab-completion problems running sage 3.2.3 on Ubuntu 8.10

2009-03-11 Thread Iwan Lappo-Danilewski

3) Forgot a further issue in filebrowsing:
if I use the tab comletion to got to let's say directory "./white
pace" by typing "cd ./w>>tab", It completes correctly but then offers
me the message:
[Errno 2] No such file or directory: './white._backslash_( space)'

Can't blame ipython, since all three problems do not show using the
"original" version
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: instructions for installing sage do not work

2009-03-11 Thread nsauer

Thanks for replying;

I start sage by double clicking on the name "sage" in the finder.
It is  in /Applications/sage/
This file sage, in /Applications/sage/ is a Unix Executible File.
Even so, if in the terminal I change the directory to
/Applications/sage/ and type sage
I get the return that
-bash: sage: command not found

I also looked at all the other usual places to find an executible
"sage" file, but there does not seem to be one.

I am not Unix experienced enough to sort this out.

Thanks again,

Norbert



On Mar 10, 9:58 pm, Robert Bradshaw 
wrote:
> How are you starting up Sage? If you're starting up sage via
>
> /path/into/folder/sage
>
> then you'll have to do
>
> /path/into/folder/sage -b
>
> On Mar 10, 2009, at 8:52 PM, nsauer wrote:
>
>
>
> > Thanks for the help. I made the changes
> > but failed to recompile. Here is what I did:
> > (test is my home name) where is this sage binary?
>
> > Laptop-3:~ test$ sage -b
> > -bash: sage: command not found
>
> > Laptop-3:/ test$ sage -b
> > -bash: sage: command not found
>
> > Laptop-3:sage test$ sage -b
> > -bash: sage: command not found
>
> > sage: sage -b
> > --
> > -
> > NameError                                 Traceback (most recent call
> > last)
>
> > /Users/test/ in ()
>
> > NameError: name 'b' is not defined
> > sage:
>
> > Norbert
>
> > On Mar 10, 2:28 pm, John H Palmieri  wrote:
> >> On Mar 10, 1:00 pm, nsauer  wrote:
>
> >>> Thanks for your reply;
>
> >>> As I am completely new to sage I do not know how to
> >>> perform the indicated change. I looked at the file
> >>> sage/devel/sage/sage/matrix0.pyx
> >>> but could not figure out how and where to add
> >>> the function sage.matrix.matrix0.set_latex_delimiters('[',']')
>
> >> If you want to make a change just for your own personal use (that is,
> >> switching to square brackets, not implementing set_latex_delimiters),
> >> then in the line
>
> >>         return "\\left(\\begin{array}{%s}\n"%format + s + "\n\\end
> >> {array}\\right)"
>
> >> change '\\left(' to '\\left[' and similarly change '\\right)' to '\
> >> \right]'.  Run 'sage -b' to recompile the changed file.  If you're
> >> going to be using 0 x n matrices, or n x 0 matrices, then you should
> >> also change the parentheses to brackets in this line (36 lines
> >> earlier):
>
> >>   return "()"
>
> >> --
> >> John
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] tab-completion problems running sage 3.2.3 on Ubuntu 8.10

2009-03-11 Thread Iwan Lappo-Danilewski

Searching, documentation and following the discussion on this group
have not guided me towards a solution of two problems I'm experiencing
in using the sage binaries.

1) In the terminal the sage promt gets all cluttered up by tab
completion, making it impossible to use as a file browser
(same problem as
http://groups.google.com/group/sage-support/browse_thread/thread/8fc3c045f5a2e361/58a2b080f5fc1cbe?hl=en&lnk=gst&q=tab+completion#58a2b080f5fc1cbe,
but solution suggested there does not change anything but the display
of the line number).

2) "!emacs ./spam.txt" works fine, but "!emacs spam.txt" results in:
emacs: symbol lookup error: /usr/lib/libxml2.so.2: undefined symbol:
gzopen64
This forces me to change my usual command line behavior and be
punished by a cryptic error message if I forget to...

I would really appreciate some help on the first point
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How do I close a function definition?

2009-03-11 Thread Simon King

Dear Chandra,

On Mar 11, 3:32 pm, "R (Chandra) Chandrasekhar" 
wrote:
> 
> sage: def is_even(n):
> : return n%2 == 0
> : is_even(2)
> 

Just press return a second time:
sage: def is_even(n):
: return n%2==0
:
sage: is_even(2)
True

The function definition is only "officially" closed by entering a
blank line.
I guess the point is that in principle it is possible to continue the
function definition (although it would be pointless), such as:
sage: def foo(n):
: return 0
: print 'bar'
:

Cheers,
 Simon

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Simon King

Dear Mani chandra,

something really weird seems to be going on. This is a fresh session
of Sage 3.3:

sage: complex(0,1)*spherical_bessel_J(1,1)
---
TypeError Traceback (most recent call
last)

/home/king/.sage/temp/mpc739/24191/_home_king__sage_init_sage_0.py in
()

/home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
sage/structure/element.so in
sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
8632)()

/home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/
coerce.c:5847)()

TypeError: unsupported operand parent(s) for '*': ''
and 'Symbolic Ring'
sage: complex(0,1)*spherical_bessel_J(1,1)
1.0*(sin(1) - cos(1))*I



In other words, calling complex(0,1)*spherical_bessel_J(1,1) for the
first time yields a bug. Calling it the second time yields a result.

Do people agree that this is a bug? Shall I open a ticket?


I guess that, as a work-around, you should consider using a different
implementation of the complex unit in Sage.
There are (at least):
 * complex(0,1), which AFAIK is a Python builtin
 * I, which belongs to the "Symbolic Ring":
sage: I^2
-1
sage: I.parent()
Symbolic Ring
 * The imaginary unit in the complex double field:
sage: CDF(0,1)
1.0*I
sage: CDF(0,1)^2
-1.0 + 1.22464679915e-16*I
As you can see, CDF is numeric with the usual errors of numerical data
types.

Since "spherical_bessel_J" lives in the Symbolic world, i guess that
using "I" would work around the error.

Cheers,
   Simon
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] How do I close a function definition?

2009-03-11 Thread R (Chandra) Chandrasekhar

Folks,

I am running SAGE Version 3.0.5, Release Date: 2008-07-11 compiled from 
the Ubuntu package source package sagemath_3.0.5dfsg-2ubuntu1 on my AMD 
64 PC running a 2.6.27-11-generic Linux kernel with Kubuntu 8.04 and KDE 
4.2.

I am going through the tutorial and have just found a snag.

In section 2.3 of the Sage Tutorial, we are asked to define the function 
is_even. My difficulty is that after typing in the statement,

return n%2 == 0

I still get the four dots on the left, meaning that the function 
definition is not closed. A transcript of what happens on my console is 
given below:


sage: def is_even(n):
: return n%2 == 0
: is_even(2)

File "", line 3
  is_even(Integer(2))
^
SyntaxError: invalid syntax


Can someone please tell me what is going wrong? (I would hate to think 
that parts of sage are not working as they should, and hope that it is 
something that I have omitted.)

In short, how do I let sage know that a function definition is being closed?

Thanks.

Chandra

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Variable plot limits

2009-03-11 Thread Jason Grout

roleic wrote:
> Thanks Jason,
> now I tried to implement such a True/False function in order to
> multiply it with the actual plot function to carve out the wanted plot
> region.
> Below I defined the function as a callable object as requested by the
> plot command.
> In a print test the function works well.
> But when used in the plot3d function all I get is a flat plane at +1
> height instead of a carved out rectangle at height +1 and a frame
> around it at 0 height.
> What is wrong? Is f in plot3d not evaluated for each set of
> parameters?
> roleic
> 
> 
> class plotregion:
> def __init__(self):
> pass
> def __call__(self,u,v,umin,umax,vmin,vmax):
> self.u,self.v,self.umin,self.umax,self.vmin,self.vmax =
> u,v,umin,umax,vmin,vmax
> if (self.u < self.umin or self.u > self.umax or self.v <
> self.vmin or self.v > self.vmax):
> return 0
> else:
> return 1
> 
> g = plotregion()
> for i in range(7):
> for j in range(7):
> print g(i,j,1,6-j,1,5),
> print
> 
> f = plotregion()
> plot3d(f(u,v,1,4,1,3),(u,-2,6),(v,-2,6))
> 


You are evaluating the function before plotting it.  You need to do 
something like:

class plotregion:
 def __init__(self, umin, umax, vmin, vmax):
 self.umin, self.umax,self.vmin,self.vmax = umin,umax,vmin,vmax
 def __call__(self,u,v):
  if (u < self.umin or u > self.umax or v <
  self.vmin or v > self.vmax):
  return 0
  else:
  return 1

f=plotregion()
plot3d(f, (-2,6), (-2,6))

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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Boolean Polynomial Ring variety computation problem

2009-03-11 Thread Florian

Wow, that was extremely quick guys! Thanks a lot!!

Hut ab.

Florian

On Mar 11, 7:59 am, Martin Albrecht 
wrote:
> On Tuesday 10 March 2009, Florian wrote:
>
> > Thanks for having a look!
>
> It turns out it was our (my) fault all along, patch is up at
>
>  http://trac.sagemath.org/sage_trac/ticket/5486
>
> and awaits review.
>
> Cheers,
> Martin
>
> --
> name: Martin Albrecht
> _pgp:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
> _www:http://www.informatik.uni-bremen.de/~malb
> _jab: martinralbre...@jabber.ccc.de
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: need sage configuration support

2009-03-11 Thread ajju



On Mar 11, 1:39 am, Ondrej Certik  wrote:
> Hi Kumar,
>
> On Mon, Mar 9, 2009 at 10:24 PM, Kumar  wrote:
>
> > Hi All,
> >          I am facing problems in configure sage-notebook in my
> > desktop. though i had follow all guide line which is given
> > onhttp://www.sagemath.org/doc/inst/node6.htmlbut struck some where in
> > the middle
>
> > bugs:->
>
> > a...@arun:~/Desktop/sage-3.2.3$ su
> > Password:
>
> ^^ why are you using "su" ? Don't do that! If there is some bug in the
> build script, you can easily loose data.
>
> > r...@arun:/home/arun/Desktop/sage-3.2.3# make
> > cd spkg && ./install all 2>&1 | tee -a ../install.log
> > /bin/ls: cannot access bzip2-*-install: No such file or directory
>
> How did you download sage? I bet you downloaded the binary version.
> Then you don't need to type "make", just type "./sage".
>
> If you download the source version, only then you need to build it
> yourself by typing "make".
>
>
>
> > /bin/ls: cannot access dir-*-install: No such file or directory
> > /bin/ls: cannot access prereq-*-install: No such file or directory
> > make[1]: Entering directory `/home/arun/Desktop/sage-3.2.3/spkg'
> > standard/deps:41: warning: overriding commands for target `installed/'
> > standard/deps:38: warning: ignoring old commands for target
> > `installed/'
> > standard/deps:44: warning: overriding commands for target `installed/'
> > standard/deps:41: warning: ignoring old commands for target
> > `installed/'
> > standard/deps:180: warning: overriding commands for target
> > `installed/'
> > standard/deps:44: warning: ignoring old commands for target
> > `installed/'
> > make[1]: Circular installed/python-2.5.2.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/python-2.5.2.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/python-2.5.2.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/zlib-1.2.3.p4 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/zlib-1.2.3.p4 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/zlib-1.2.3.p4 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/termcap-1.3.1.p0 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/termcap-1.3.1.p0 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/termcap-1.3.1.p0 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/readline-5.2.p5 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/readline-5.2.p5 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/readline-5.2.p5 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/libpng-1.2.22.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/libpng-1.2.22.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/libpng-1.2.22.p8 <- installed/ dependency
> > dropped.
> > make[1]: Circular installed/ <- installed/ dependency dropped.
> > make[1]: Circular installed/ <- installed/ dependency dropped.
> > make[1]: Circular installed/ <- installed/ dependency dropped.
> > make[1]: Nothing to be done for `all'.
> > make[1]: Leaving directory `/home/arun/Desktop/sage-3.2.3/spkg'
> > 0.00user 0.00system 0:00.00elapsed 133%CPU (0avgtext+0avgdata
> > 0maxresident)k
> > 0inputs+0outputs (0major+298minor)pagefaults 0swaps
> > To install gap, gp, singular, etc., scripts
> > in a standard bin directory, start sage and
> > type something like
> >   sage: install_scripts('/usr/local/bin')
> > at the SAGE command prompt.
>
> > SAGE build/upgrade complete!
> > r...@arun:/home/arun/Desktop/sage-3.2.3# ./sage
> > --
> > | Sage Version 3.2.3, Release Date: 2009-01-05                       |
> > | Type notebook() for the GUI, and license() for information.        |
> > --
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage.bin: 5: Syntax error: "("
> > unexpected
> > /home/arun/Desktop/sage-3.2.3/local/bin/python: 5: Syntax error: "("
> > unexpected
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage-ipython: line 6:
> > SAGE IPython startup script.
>
> > : command not found
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage-ipython: line 8: import:
> > command not found
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage-ipython: line 9: import:
> > command not found
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage-ipython: line 14: syntax
> > error near unexpected token `['-p','
> > /home/arun/Desktop/sage-3.2.3/local/bin/sage-ipython: line 14: `
> > sys.argv.extend(['-p', 'sage'])'
>
> Try to unpack Sage again and just type "./sage".
>
> > r...@arun:/home/arun/Desktop/sage-3.2.3# sage: 2+2
> > bash: sage:: command not found
> > r...@arun:/home/arun/Desktop/sage-3.2.3#
>
> This needs to be run in the sage prompt.
>
> Ondrej

check your .log file

--~--~-~--~~~---~--~~

[sage-support] Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Mani chandra

Hi,
   
The following function gives me an error.

 def test(l, r):
   return complex(0, 1)**l*spherical_bessel_J(l, r)


sage: test(1, 1)
---
TypeError Traceback (most recent call last)

/home/mc/PHY432/ in ()

/home/mc/PHY432/ in test(l, r)

/opt/sage/sage/local/lib/python2.5/site-packages/sage/structure/element.so 
in sage.structure.element.RingElement.__mul__ 
(sage/structure/element.c:8632)()

/opt/sage/sage/local/lib/python2.5/site-packages/sage/structure/coerce.so 
in sage.structure.coerce.CoercionModel_cache_maps.bin_op 
(sage/structure/coerce.c:5833)()

TypeError: unsupported operand parent(s) for '*': '' and 
'Symbolic Ring'


Help appreciated. Thank you

Mani chandra



--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: VMware Player. Read files from windows OS

2009-03-11 Thread William Stein

On Wed, Mar 11, 2009 at 4:03 AM, hpon  wrote:
>
> Hi,
>
> I'm running Sage from VMware Player (Sage command line) and I would
> like to load a sage-file that I wrote in Windows XP.  Is that
> possible?  How is it done?

Data --> Upload or create file ...

If your file is called a.sage, then you can load it into your
worksheet session by typing

   load a.sage

You can edit the uploaded version of the file by selecting

Data --> a.sage

William

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Boolean Polynomial Ring variety computation problem

2009-03-11 Thread Martin Albrecht

On Tuesday 10 March 2009, Florian wrote:
> Thanks for having a look!

It turns out it was our (my) fault all along, patch is up at

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

and awaits review.

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.de


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Variable plot limits

2009-03-11 Thread roleic

Thanks Jason,
now I tried to implement such a True/False function in order to
multiply it with the actual plot function to carve out the wanted plot
region.
Below I defined the function as a callable object as requested by the
plot command.
In a print test the function works well.
But when used in the plot3d function all I get is a flat plane at +1
height instead of a carved out rectangle at height +1 and a frame
around it at 0 height.
What is wrong? Is f in plot3d not evaluated for each set of
parameters?
roleic


class plotregion:
def __init__(self):
pass
def __call__(self,u,v,umin,umax,vmin,vmax):
self.u,self.v,self.umin,self.umax,self.vmin,self.vmax =
u,v,umin,umax,vmin,vmax
if (self.u < self.umin or self.u > self.umax or self.v <
self.vmin or self.v > self.vmax):
return 0
else:
return 1

g = plotregion()
for i in range(7):
for j in range(7):
print g(i,j,1,6-j,1,5),
print

f = plotregion()
plot3d(f(u,v,1,4,1,3),(u,-2,6),(v,-2,6))

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] VMware Player. Read files from windows OS

2009-03-11 Thread hpon

Hi,

I'm running Sage from VMware Player (Sage command line) and I would
like to load a sage-file that I wrote in Windows XP.  Is that
possible?  How is it done?

Regards,
hpon
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage simplification

2009-03-11 Thread Martin Rubey

Martin Rubey  writes:

> I did not want to say that sqrt(a*b)=sqrt(a)*sqrt(b) is always good
> behaviour, but there are circumstances where you want it.  Eg., it
> seems that it's necessary for symbolic integration, where you are
> really working in a differential field.

I should have added: Waldek Hebisch is the expert here...

Martin


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage simplification

2009-03-11 Thread Martin Rubey

Stan Schymanski  writes:

> Hi Martin,
> 
> I can't imagine that such a change in the result is intended
> behaviour of a simplify action. If it is, one should either stay
> away from it if one is planning to do any numeric calculations or
> understand when to use it and when not. I'm still struggling with
> that.
 

I did not want to say that sqrt(a*b)=sqrt(a)*sqrt(b) is always good
behaviour, but there are circumstances where you want it.  Eg., it
seems that it's necessary for symbolic integration, where you are
really working in a differential field.

I think what it boils down to is that in the end you want to have a
separate domain that takes care of branch cuts.  I don't think that
maxima has this, in FriCAS it is on the to do list.  However,
currently in (the repository version of) FriCAS already many of the
"offending" simplifications are disabled, and only applied within the
integration algorithms.

Martin


--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage simplification

2009-03-11 Thread Stan Schymanski

Hi Martin,

I can't imagine that such a change in the result is intended behaviour
of a simplify action. If it is, one should either stay away from it if
one is planning to do any numeric calculations or understand when to
use it and when not. I'm still struggling with that.

I am much more fond of the FullSimplify[] command in Mathematica:

In[32]:= Remove["Global`*"]

In[33]:= FullSimplify[(Sqrt[-zr^2 + 2*ys*zr + (2*cz - zr)^2 -
  2*ys*(2*cz - zr)] + 2*zr - 2*cz)/(2*zr - 2*cz)]

Out[33]= -((-cz + Sqrt[(cz - ys) (cz - zr)] + zr)/(cz - zr))

In[34]:= cz = 10
ys = 5
zr = 4


Out[34]= 10

Out[35]= 5

Out[36]= 4

In[37]:= N[(Sqrt[-zr^2 + 2*ys*zr + (2*cz - zr)^2 -
  2*ys*(2*cz - zr)] + 2*zr - 2*cz)/(2*zr - 2*cz)]
N[-((-cz + Sqrt[(cz - ys) (cz - zr)] + zr)/(cz - zr))]

Out[37]= 0.0871291

Out[38]= 0.0871291

Here, the equation simplifies to something that produces the same
result no matter what values I choose for the variables. That is, I
have only tried real numbers.
Anyway, simplify_full() should at least warn the user of possible
ambiguities, otherwise it can lead to undesired behaviour at the end
of the line.
See the thread I mentioned in the previous email to find an error
caused by simplify_full() even if I make the required assumptions and
stick to real numbers.

Sorry about the lengthy email, but I have seen numerous threads about
simplifying equations in the recent past, so I think these issues
should be discussed.

Cheers,
Stan

On Mar 9, 9:43 pm, Martin Rubey 
wrote:
> Maurizio  writes:
> > What is the reason to have such a bugged function?
>
> I wouldn't consider
>
> > > sage: var('omgo zr ys cz')
> > > (omgo, zr, ys, cz)
> > > sage: omgo = (sqrt(-zr^2 + 2*ys*zr + (2*cz - zr)^2 - 2*ys*(2*cz - zr))
> > > + 2*zr- 2*cz)/(2*zr - 2*cz)
> > > sage: omgo.simplify_full()
> > > (I*sqrt(cz - ys)*sqrt(zr - cz) + zr - cz)/(zr - cz)
>
> a bug, at least not a priori.  it just seems that simplify_full
> assumes sqrt(a)*sqrt(b) = sqrt(a*b), which is reasonable in many
> circumstances.
>
> (I didn't check the details, though)
>
> Martin
--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---