[sage-support] Re: init.sage and sage -c

2008-06-10 Thread William Stein

On Tue, Jun 10, 2008 at 12:43 AM, William Stein <[EMAIL PROTECTED]> wrote:
> On Sun, Jun 8, 2008 at 4:56 PM, kwatford <[EMAIL PROTECTED]> wrote:
>>
>> I have defined a function that starts up the notebook server with my
>> desired preferences and placed the function definition into my
>> init.sage script, so that whenever I use the command line, I don't
>> have to remember the whole thing to start it up. Works fine.
>>
>> Since I usually go straight to the notebook, I figured just running:
>> sage -c "snote()"
>> would do the trick. But apparently init.sage isn't executed before the
>> -c command.
>>
>> I already know ways to start the notebook conveniently from the
>> command line so I'm not worried about that, but I was wondering if
>> that was the correct and desired behavior of -c. Perhaps we could have
>> another similar argument ( -C ?) that executes init.sage before
>> executing the command?
>
> I think it's a bug that 'sage -c' doesn't load init.sage first.
>
> Does anybody think differently?  If nobody disagrees, I'll
> add a trac ticket.

OK, ticket made:

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

--~--~-~--~~~---~--~~
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: assignments and functions

2008-06-10 Thread Stan Schymanski

Thanks for that! I can do it using the python function now. I think it
would be very useful to have a command to replace symbolic variables
by pre-defined values or terms whenever they are called.
The .subs(locals()) functionality helps a lot with this respect. I am
not registered for the TRAC system yet, so I can't file the bug in the
PiecewisePolynomial as a ticket. Could someone more familiar with it
do it? Thanks a lot, you are an unbelievably helpful crowd. SAGE
rocks!

Cheers
Stan

On Jun 11, 12:56 am, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Jun 10, 2008, at 10:58 AM, Stan Schymanski wrote:
>
>
>
>
>
> > Dear all
>
> > I have been using the .subs(locals()) functionality extensively, but
> > now I found out that this does not work for piecewise defined
> > functions.
>
> > Example:
>
> > sage: var('x a b')
> > (x, a, b)
> > sage: f1=a*sin(x)
> > sage: f2=b*sin(x)
> > sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
> > sage: a=1
> > sage: b=-1
> > sage: f.subs(locals())
> > --
> > -
> > AttributeErrorTraceback (most recent call
> > last)
>
> > ...
>
> > AttributeError: PiecewisePolynomial instance has no attribute 'subs'
>
> This is an (easily fixed)  bug in PiecewisePolynomial.
>
> > The python function approach also fails in this case:
>
> > sage: def g(x):
> > : return  Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
> > sage: a=1
> > sage: b=-1
> > sage: g(1)
> > Piecewise defined function with 2 parts, [[(0, pi/2), a*sin(x)], [(pi/
> > 2, pi), b*sin(x)]]
>
> > Am I doing something wrong?
>
> The python approach won't work recursively unless everything is a
> python function (which may have performance impacts).
>
> To better understand what's going on here, when you write "a=1" it
> does not mean "the symbolic variable a is now 1 in every expression
> it occurs" but rather "the global variable a is 1." In fact writing
> "var('a,b,c')" simply binds the symbolic expression "a" to the global
> variable "a." The difference is subtle but important.
>
> - Robert
--~--~-~--~~~---~--~~
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: print or view depending on context (was Re: python (?) help: equivalent of lisp's "let")

2008-06-10 Thread William Stein

On Tue, Jun 10, 2008 at 9:35 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
> On Jun 10, 7:12 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>> On Wed, May 28, 2008 at 2:03 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > In some code, I'd like to view or print an object depending on whether
>> > in notebook mode with the "typeset" box checked or not.  Is this a
>> > good way to do it?
>>
>> >from sage.misc.misc import embedded
>> >from sage.misc.latex import pretty_print, view
>> >import sys
>> >if embedded() and sys.displayhook == pretty_print:
>> >view(x)
>> >else:
>> >print(x)
>>
>> I think that is the *only* way to do it.   I don't think it is a "good way"
>> though.  It could be made much nicer by adding a single function somewhere,
>> e.g., in misc/*/  that has the lines of code you wrote above in it,
>> and has a meaningful name.Then other code that needs to do the
>> same thing will be easier to write and read.  What do you think?
>
> Well, I didn't know if 'sys.displayhook == pretty_print' was the right
> way to check for the typeset box.

Well it works, and if we encapsulate it in a function (like you've done),
then if we decide on a better way later it will be easy to change in only
one place.

> Anyway, here's a ticket (with a
> patch):
>
> 

Excellent.  If you add a doctest I'll give it a positive review :-)

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: print or view depending on context (was Re: python (?) help: equivalent of lisp's "let")

2008-06-10 Thread John H Palmieri

On Jun 10, 7:12 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Wed, May 28, 2008 at 2:03 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
>
>
> > In some code, I'd like to view or print an object depending on whether
> > in notebook mode with the "typeset" box checked or not.  Is this a
> > good way to do it?
>
> >            from sage.misc.misc import embedded
> >            from sage.misc.latex import pretty_print, view
> >            import sys
> >            if embedded() and sys.displayhook == pretty_print:
> >                view(x)
> >            else:
> >                print(x)
>
> I think that is the *only* way to do it.   I don't think it is a "good way"
> though.  It could be made much nicer by adding a single function somewhere,
> e.g., in misc/*/  that has the lines of code you wrote above in it,
> and has a meaningful name.    Then other code that needs to do the
> same thing will be easier to write and read.  What do you think?

Well, I didn't know if 'sys.displayhook == pretty_print' was the right
way to check for the typeset box.  Anyway, here's a ticket (with a
patch):



-- John

>  -- 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: Li(x) in the complex domain

2008-06-10 Thread William Stein

On Tue, Jun 10, 2008 at 7:50 PM, M. Yurko <[EMAIL PROTECTED]> wrote:
>
> Thanks again to everyone who tried to assist me. I was able to use the
> incomplete gamma function already in sage to compute Li(x) for complex
> inputs. For the speed that I need this works fine. However, this
> should be impetus for me to try and learn Cython.

Hey, could you give a short example (as a response to this email) of
using the incomplete gamma already in sage to compute Li(x) for
complex x?  I could paste it into the documentation for Li.

 -- 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: Li(x) in the complex domain

2008-06-10 Thread M. Yurko

Thanks again to everyone who tried to assist me. I was able to use the
incomplete gamma function already in sage to compute Li(x) for complex
inputs. For the speed that I need this works fine. However, this
should be impetus for me to try and learn Cython.

On Jun 10, 8:04 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 10, 2008 at 3:49 PM, Robert Bradshaw
>
> <[EMAIL PROTECTED]> wrote:
>
> > Just for a start, try looking in sage/interfaces for several
> > examples. You could also try wrapping it in Cython (though this is
> > sometimes a bit harder with C++ than with C).
>
> I don't think there is any command line interface to Michael Rubinstein's
> Li(..) function.  If not, then sage/interfaces/* is irrelevant.   The only
> possible way to use that code is to write a C++ program or equivalently
> a Cython (Sage) program that directly calls it.  If the original poster
> doesn't know C++ or Cython, he'll have to learn Cython/C++ or wait until
> somebody implements this for him (or use a different program).
>
> I would do this now but I'm too busy.
>
>  -- 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: print or view depending on context (was Re: python (?) help: equivalent of lisp's "let")

2008-06-10 Thread William Stein

On Wed, May 28, 2008 at 2:03 PM, John H Palmieri <[EMAIL PROTECTED]> wrote:
>
> In some code, I'd like to view or print an object depending on whether
> in notebook mode with the "typeset" box checked or not.  Is this a
> good way to do it?
>
>from sage.misc.misc import embedded
>from sage.misc.latex import pretty_print, view
>import sys
>if embedded() and sys.displayhook == pretty_print:
>view(x)
>else:
>print(x)
>

I think that is the *only* way to do it.   I don't think it is a "good way"
though.  It could be made much nicer by adding a single function somewhere,
e.g., in misc/*/  that has the lines of code you wrote above in it,
and has a meaningful name.Then other code that needs to do the
same thing will be easier to write and read.  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: Li(x) in the complex domain

2008-06-10 Thread William Stein

On Tue, Jun 10, 2008 at 3:49 PM, Robert Bradshaw
<[EMAIL PROTECTED]> wrote:
>
> Just for a start, try looking in sage/interfaces for several
> examples. You could also try wrapping it in Cython (though this is
> sometimes a bit harder with C++ than with C).

I don't think there is any command line interface to Michael Rubinstein's
Li(..) function.  If not, then sage/interfaces/* is irrelevant.   The only
possible way to use that code is to write a C++ program or equivalently
a Cython (Sage) program that directly calls it.  If the original poster
doesn't know C++ or Cython, he'll have to learn Cython/C++ or wait until
somebody implements this for him (or use a different program).

I would do this now but I'm too busy.

 -- 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: error compiling sage: pari and libgmp mismatch - fixed

2008-06-10 Thread lciti

Hi, I'll answer your questions in the thread you suggested.

--~--~-~--~~~---~--~~
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: assignments and functions

2008-06-10 Thread Robert Bradshaw

On Jun 10, 2008, at 10:58 AM, Stan Schymanski wrote:

>
> Dear all
>
> I have been using the .subs(locals()) functionality extensively, but
> now I found out that this does not work for piecewise defined
> functions.
>
> Example:
>
> sage: var('x a b')
> (x, a, b)
> sage: f1=a*sin(x)
> sage: f2=b*sin(x)
> sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
> sage: a=1
> sage: b=-1
> sage: f.subs(locals())
> -- 
> -
> AttributeErrorTraceback (most recent call
> last)
>
> ...
>
> AttributeError: PiecewisePolynomial instance has no attribute 'subs'

This is an (easily fixed)  bug in PiecewisePolynomial.

> The python function approach also fails in this case:
>
> sage: def g(x):
> : return  Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
> sage: a=1
> sage: b=-1
> sage: g(1)
> Piecewise defined function with 2 parts, [[(0, pi/2), a*sin(x)], [(pi/
> 2, pi), b*sin(x)]]
>
> Am I doing something wrong?

The python approach won't work recursively unless everything is a  
python function (which may have performance impacts).

To better understand what's going on here, when you write "a=1" it  
does not mean "the symbolic variable a is now 1 in every expression  
it occurs" but rather "the global variable a is 1." In fact writing  
"var('a,b,c')" simply binds the symbolic expression "a" to the global  
variable "a." The difference is subtle but important.

- Robert


--~--~-~--~~~---~--~~
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: Li(x) in the complex domain

2008-06-10 Thread Robert Bradshaw

Just for a start, try looking in sage/interfaces for several  
examples. You could also try wrapping it in Cython (though this is  
sometimes a bit harder with C++ than with C).

- Robert

On Jun 10, 2008, at 7:35 AM, M. Yurko wrote:

> After a little more searching, it appears that I should use a Pseudo
> tty( right?). However, the programming guide gives no information on
> how to actually do this. Any help would be greatly appreciated
> (copying and pasting input and output is less than ideal).
>
> On Jun 10, 10:15 am, "M. Yurko" <[EMAIL PROTECTED]> wrote:
>> Mike, thanks for the code. This is just what I need and works well
>> from the command line. However, I'm a bit of a SAGE and linux newbie
>> and I'm unsure about the best way of integrating this with SAGE. I
>> checked the programming guide, but I only have some basic Python
>> experience and have never done anything with C++ before. If it
>> matters, I'm using Ubuntu 8.04 and have SAGE 3.0.2.
>>
>> On Jun 8, 11:15 pm, Michael <[EMAIL PROTECTED]> wrote:
>>
>>> My package has routines for the incomplete gamma function, and the
>>> logarithmic
>>> integral is a special case of that. For the incomplete gamma  
>>> function
>>> I use a
>>> combination of series, asumptotics, and continued fractions.  The
>>> relevant file
>>> is Lgamma.h in the include directory of my L-function  
>>> package:http://pmmac03.math.uwaterloo.ca/~mrubinst/ 
>>> L_function_public/CODE/
>>
>>> Mike
>>
>>> On Jun 7, 4:08 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>>
 On Sat, Jun 7, 2008 at 12:54 PM, M. Yurko <[EMAIL PROTECTED]> wrote:
>>
> Is there any way for SAGE to calculate Li(x) (logarithmic  
> integral)
> for complex inputs?
>>
 I don't think that functionality is directly exposed in Sage in  
 any easy
 to use way.  I've cc'd Mike Rubinstein who has probably written  
 fast
 C++ code (that is included with sage) in hopes that he will have  
 a comment
 to make.
>>
 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: error compiling sage: pari and libgmp mismatch - fixed

2008-06-10 Thread mabshoff

Hi Luca,

the problem you are having is discussed at

http://groups.google.com/group/mpir-devel/t/c31f89ed1683d383

You might want to come over and give some feedback since it cuts mw
out of the loop and will hopefully result in a quicker resolution.

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: simplifying exponents

2008-06-10 Thread polo0691

Thanks for the reply.  In the cases when those variables are real (or
tell Sage they are real), could you force Sage or the underlying tool
to simplify the equation?

On Jun 10, 2:56 pm, Carl Witty <[EMAIL PROTECTED]> wrote:
> On Jun 10, 10:44 am, polo0691 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for creating sage! I can really see how useful sage could be
> > for engineering purposes. I've been playing around with sage for a
> > couple of days and I have had trouble with the following:
>
> >   1) simplifying equations with exponents:
>
> > sage: var('vgs vt n')
> > (vgs, vt, n)
> > sage: f = (vgs - vt)^n
> > sage: f^(1/n)
> > ((vgs - vt)^n)^(1/n)
> > sage: f^(1/n).simplify()
> > ((vgs - vt)^n)^(1/n)
>
> > It doesn't seem to easily simplify the exponent. I'm guessing it
> > is a limitation of the CAS engine used. I also tried the same test
> > case on YACAS and it didn't seem to want to simplify the exponent
> > either.
>
> I'm not surprised this doesn't simplify: there's no consistent
> definition for exponentiation that lets you safely apply the
> simplification you want.  To pick a simple case, over the reals,
> squaring followed by square root gives the absolute value:
>
> sage: ((-2)^2)^(1/2)
> 2
>
> Then consider that Sage is assuming that vgs, vt, and n may be complex
> numbers, and it gets very complicated.
>
> Carl Witty

--~--~-~--~~~---~--~~
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: simplifying exponents

2008-06-10 Thread Jonathan Bober

On Tue, 2008-06-10 at 12:56 -0700, Carl Witty wrote:
> On Jun 10, 10:44 am, polo0691 <[EMAIL PROTECTED]> wrote:
> > Thanks for creating sage! I can really see how useful sage could be
> > for engineering purposes. I've been playing around with sage for a
> > couple of days and I have had trouble with the following:
> >
> >   1) simplifying equations with exponents:
> >
> > sage: var('vgs vt n')
> > (vgs, vt, n)
> > sage: f = (vgs - vt)^n
> > sage: f^(1/n)
> > ((vgs - vt)^n)^(1/n)
> > sage: f^(1/n).simplify()
> > ((vgs - vt)^n)^(1/n)
> >
> > It doesn't seem to easily simplify the exponent. I'm guessing it
> > is a limitation of the CAS engine used. I also tried the same test
> > case on YACAS and it didn't seem to want to simplify the exponent
> > either.
> 
> I'm not surprised this doesn't simplify: there's no consistent
> definition for exponentiation that lets you safely apply the
> simplification you want.  To pick a simple case, over the reals,
> squaring followed by square root gives the absolute value:
> 
> sage: ((-2)^2)^(1/2)
> 2

Sometimes you can use 'assume' to get the behavior you want, however. In
this case, for example:

sage: var('vgs vt n')
(vgs, vt, n)
sage: f = (vgs - vt)^n
sage: assume(vgs > vt)
sage: f^(1/n)
vgs - vt
sage: forget()
sage: f^(1/n)
((vgs - vt)^n)^(1/n)
sage: 




--~--~-~--~~~---~--~~
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: BLAS routines required by linbox are not installed

2008-06-10 Thread eduardo

ok, I'm on the list...sorry...

I just make copy-paste of what i wrote you:

 let me see :  m4, lbstdc++6, gcc (apt-get says that there's no
4.2 version of gcc available so I have de 4.1) and g++. For the others
I had already the latest version.

cheers
Eduardo



On Jun 4, 5:23 pm, mabshoff <[EMAIL PROTECTED]
dortmund.de> wrote:
> On Jun 4, 4:37 pm, "Eduardo Ocampo" <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
>
> Hi Eduardo,
>
> > this is my second call for help!
>
> When did you report this problem previously? I did not see it or maybe
> I just don't remember.
>
> >  does anybody know how to solve this
> > problem??? this problem have ocurred when I tried to upgrade SAGE:
> > The system: linux debian etch, AMD 64 X2 at 3GHz, 8 .GB RAM:
>
> What is the version you upgrade from? sage-2.8.10 directly to Sage
> 3.0.2? Was the inital build a binary or did you build from scratch?
> Did you upgrade your Debian compilers in the mean time? I am wondering
> since if you switched compilers, i.e. from g95 to gfortran for example
> things tend to blow up.
>
> In addition to the above I have some follow up questions once you did
> answer those questions.
>
> 
>
> > Best regards
> > 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: Displaying plot in frames

2008-06-10 Thread Carl Witty

On Jun 10, 11:28 am, Emerson <[EMAIL PROTECTED]> wrote:
> Hello everyone.
>
> I'm just wondering if there's a way of showing a SAGE plot in a window
> when running a code on the script (i.e., a python script ran with the
> sage environment from the command line). To make it more clear, I have
> the code bellow...
>
> #!/usr/bin/env sage
>
> import sys
> from sage.all import *
>
> g = 2
> t = .4
> var('n m')
> d2u = diff(1/(1 + (n * exp(-m/t))), m, 2)
> solns = solve([d2u == 0, m == g], m, n, solution_dict=True)
> ns = [[soln[n].n()] for soln in solns]
> n = ns.pop().pop()
> u = 1/(1 + (n * exp(-m/t)))
> p = plot([u], (-10, 10))
>
> ...and I want to display the plot "p" in a window/frame when i run my
> script from the command line (i.e., ./myScript.py). Any way to do
> that?

Well, I can tell you what sort of worked for me; but it's environment
specific.

The easy part: add a new line "p.show()" at the end of your script;
this should produce a plot and display it with your default image
viewer.

Unfortunately, in my environment, this displays the plot very briefly,
and then the plot disappears.  This is because the .show() command
creates a temporary file and sends it to my image viewer (Eye of
Gnome); then when Sage exits, it removes all its temporary files.  Eye
of Gnome notices that the file it was viewing went away, and stops
showing the file.

There's surely an easy fix or workaround for this, but I don't have
time to look into it; one easy but very unsatisfying workaround is to
add another line "sleep(100)" to your script, to let you view the
image for 100 seconds before it disappears.

Carl

--~--~-~--~~~---~--~~
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: simplifying exponents

2008-06-10 Thread Carl Witty

On Jun 10, 10:44 am, polo0691 <[EMAIL PROTECTED]> wrote:
> Thanks for creating sage! I can really see how useful sage could be
> for engineering purposes. I've been playing around with sage for a
> couple of days and I have had trouble with the following:
>
>   1) simplifying equations with exponents:
>
> sage: var('vgs vt n')
> (vgs, vt, n)
> sage: f = (vgs - vt)^n
> sage: f^(1/n)
> ((vgs - vt)^n)^(1/n)
> sage: f^(1/n).simplify()
> ((vgs - vt)^n)^(1/n)
>
>     It doesn't seem to easily simplify the exponent. I'm guessing it
> is a limitation of the CAS engine used. I also tried the same test
> case on YACAS and it didn't seem to want to simplify the exponent
> either.

I'm not surprised this doesn't simplify: there's no consistent
definition for exponentiation that lets you safely apply the
simplification you want.  To pick a simple case, over the reals,
squaring followed by square root gives the absolute value:

sage: ((-2)^2)^(1/2)
2

Then consider that Sage is assuming that vgs, vt, and n may be complex
numbers, and it gets very complicated.

Carl Witty

--~--~-~--~~~---~--~~
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: simplifying exponents

2008-06-10 Thread mabshoff

On Jun 10, 10:44 am, polo0691 <[EMAIL PROTECTED]> wrote:

Hi,

> Thanks for creating sage! I can really see how useful sage could be
> for engineering purposes. I've been playing around with sage for a
> couple of days and I have had trouble with the following:
>
>   1) simplifying equations with exponents:
>
> sage: var('vgs vt n')
> (vgs, vt, n)
> sage: f = (vgs - vt)^n
> sage: f^(1/n)
> ((vgs - vt)^n)^(1/n)
> sage: f^(1/n).simplify()
> ((vgs - vt)^n)^(1/n)
>
>     It doesn't seem to easily simplify the exponent. I'm guessing it
> is a limitation of the CAS engine used. I also tried the same test
> case on YACAS and it didn't seem to want to simplify the exponent
> either.

Somebody else will need to answer this question.

>  2) I don't see a lot of examples on how one could take data and fit
> it to a mathematical model. I realize that I could write some python
> code and use scipy along with numpy; but I was wondering if there was
> an easier way.  I'm a circuit designer and I like to fit transistor
> models within a certain range of operation to enable mathematical
> analysis of circuit operation. So the models I'm trying to fit are not
> terribly complicated (functions like above and perhaps some
> exponentials and polynomials).  I've fitted functions in Excel using
> the solver function and least squares method; but was looking for more
> of a Pythonish,script based solution and then I stumbled upon Sage. I
> didn't see any examples though. I'm also interested in optimization
> algorithms that might have a place in Sage as well.
>
>  3) One of the nice things about Sage is that it interfaces to a lot
> of packages. I see the potential challenge of keeping those packages
> updated within the Sage releases. I've noticed that matplotlib, numpy,
> sympy are all out of date. For those of us who like to use the latest
> python packages, can we simply replace the older packages in the site-
> packages directories with an updated version? Is there a recommended
> way of updating incrementally small python modules without breaking
> the SAGE interface to those python modules?

It depends. Usually we do upgrade the modules shipped with Sage
quickly,  but in case of numpy and scipy we are a little out of date.
numpy 1.1.0 was release a couple weeks ago and we are planning to
upgrade that in the near future. One issue holding us back that you
need to run scipy-svn at the moment since the last scipy release does
not work with numpy 1.1.0.

Feel free to report any non-current package in Sage you see and we can
then tell you if we already are aware of that release and when we are
planning to upgrade. For now:

http://trac.sagemath.org/sage_trac/ticket/3390 - upgrade numpy to
1.1.0
http://trac.sagemath.org/sage_trac/ticket/3391 - upgrade scipy to
matching release
http://trac.sagemath.org/sage_trac/ticket/3392 - upgrade matplotlib to
0.98

>   thanks!
>
>    Jon

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] Displaying plot in frames

2008-06-10 Thread Emerson

Hello everyone.

I'm just wondering if there's a way of showing a SAGE plot in a window
when running a code on the script (i.e., a python script ran with the
sage environment from the command line). To make it more clear, I have
the code bellow...

#!/usr/bin/env sage

import sys
from sage.all import *

g = 2
t = .4
var('n m')
d2u = diff(1/(1 + (n * exp(-m/t))), m, 2)
solns = solve([d2u == 0, m == g], m, n, solution_dict=True)
ns = [[soln[n].n()] for soln in solns]
n = ns.pop().pop()
u = 1/(1 + (n * exp(-m/t)))
p = plot([u], (-10, 10))

...and I want to display the plot "p" in a window/frame when i run my
script from the command line (i.e., ./myScript.py). Any way to do
that?

Thanks in advance.

Cheers


Emerson

--~--~-~--~~~---~--~~
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: error compiling sage: pari and libgmp mismatch - fixed

2008-06-10 Thread mabshoff

On Jun 10, 7:55 am, lciti <[EMAIL PROTECTED]> wrote:
> Hi Michael,

Hi Luca,

> thank you for your reply.

No problem.

> I think it is something related to gmp. It is the only one that falls
> in this error.
> After the fix it gets configured for a x86_64 machine and not for a
> core duo
> (and as you said it is probably suboptimal) but at least not as a
> generic i386,
> that would be (besides suboptimal) also uncompatible with pari that
> gets
> compiled for x86_64.

Yes, but if you set the host manually you get the generic C code which
is bad performance wise.

> I attach all the info you requested and some more I think useful.
> It is a big bunch of data I hope it is still readable.
> The line "Do we have a Core2 CPU?... No" looks weird as well as maybe
> "Patching gmp-h.in".

That has been added by our script since we patch in Core2 optimized
assembly code not in GMP that roughly double the gmpbench score. The
gmp-h.in patch is also harmless since it deals with an inline issue.

Since your CPU is obviously a Core2 we also need to fix the detection
script.

> The line "config.status: linking ./mpn/generic/add.c to mpn/
> add.c" (and similar)
> after the patch become s."... /mpn/x86_64/add.c to mpn/add.c".
> Thanks again.

ok.

> Cheers,
> Luca
>
> 
> 
> 
>
> part of install.log concerning the configuration of gmp (before the
> fix):
>
> 
> 
> GCC Version
> gcc -v
> Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
> infodir=/usr/share/info --enable-shared --enable-threads=posix --
> disable-checking --with-system-
> zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-
> java-awt=gtk --host=x86_64-redhat-linux
> Thread model: posix
> gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
> 
> Patching gmp-h.in (fixes OSX 10.5 issues and gcc 4.3 problems)
> Do we have a Core2 CPU?... No
> Moving .asm files that are to be replaced to .asm.disabled ...
> Copying new .asm and x86_64-defs.m4 files ...
> Copying new gmp-mparam.h...
> Done.
> You can now go to /home/lciti/opt/sage-3.0.2/spkg/build/gmp-4.2.2/src
> and configure/make/make_check as usual.
> Fast gcd patch:
> Moving files that are to be replaced to *.orig ...
> Copying new files across...
> Done.
> checking build system type... pentium3-unknown-linux-gnu
> checking host system type... pentium3-unknown-linux-gnu
> ..
> ..
> config.status: linking ./mpn/generic/add.c to mpn/add.c
> config.status: linking ./mpn/generic/add_1.c to mpn/add_1.c
> config.status: linking ./mpn/x86/p6/aors_n.asm to mpn/add_n.asm
> config.status: linking ./mpn/generic/sub.c to mpn/sub.c
> config.status: linking ./mpn/generic/sub_1.c to mpn/sub_1.c
> config.status: linking ./mpn/x86/p6/aors_n.asm to mpn/sub_n.asm
>
> 
> 
> 
>
> part of install.log concerning the configuration of SQLite (and many
> others are similar)
>
> 
> 
> GCC Version
> gcc -v
> Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
> infodir=/usr/share/info --enable-shared --enable-threads=posix --
> disable-checking --with-system-
> zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-
> java-awt=gtk --host=x86_64-redhat-linux
> Thread model: posix
> gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
> 
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... x86_64-unknown-linux-gnu
>
> 
> 
> 
>
> $ grep "host system" ~/opt/sage-3.0.2/install.log
> checking host system type... pentium3-unknown-linux-gnu   <--- this is
> libgmp (before the fix) !

Ok.

> checking host system type... x86_64-redhat-linux-gnu       <--- this
> is iml

Ok.

> 
> 
> 
>
> $ config.guess
> x86_64-unknown-linux-gnu

Is that with the config.guess from gmp? What does a "vanilla" gmp
4.2.2 do? I have similar problems with gmp 4.2.2 on a recent Core2
Qu

[sage-support] Re: Sage + Eclipse + PyDev

2008-06-10 Thread mabshoff



On Jun 10, 9:49 am, Emerson <[EMAIL PROTECTED]> wrote:
> Hello everyone.

Hi Emerson,

> I'm trying to set up sage to work with pydev on Eclipse. So far, I've
> managed to set the interpreter properly (it does seem to work
> properly). The problem is that when I try to do this...
>
> from sage.all import *
>
> ...I get the following error message "ImportError: libgnutls.so.26:
> cannot open shared object file: No such file or directory". I don't
> actually know why I'm getting this message as I've set the SAGE_ROOT
> and LD_LIBRARY_PATH variables to the proper locations. I've set these
> variables via python. Bellow is my (sample) code that was starting to
> write when I came across this message.
>
> == START OF CODE ===
>
> import sys
> import os
>
> os.environ.__setitem__('SAGE_ROOT', '/home/emerson/ProgramFiles/Sage')
> os.environ.__setitem__('PATH', os.environ.__getitem__('SAGE_ROOT') +
> ':' + os.environ.__getitem__('PATH'))
> os.environ.__setitem__('LD_LIBRARY_PATH',
> os.environ.__getitem__('SAGE_ROOT')+'/local/lib')
>
> # + os.environ.__getitem__('LD_LIBRARY_PATH') :/usr/lib/jvm/java-6-
> sun-1.6.0.03/jre/lib/i386/client::/usr/lib/jvm/java-6-sun-1.6.0.03/jre/
> lib/i386::/usr/lib/firefox/:/usr/lib/firefox/
>
> print(os.environ.__getitem__('SAGE_ROOT'))
> print(os.environ.__getitem__('PATH'))
> print(os.environ.__getitem__('LD_LIBRARY_PATH'))
>
> from sage.all import *
>
> == END OF CODE ===
>
> If anyone could help me I'd appreciate. I'm really stuck at this :-(.

You should either run "sage -sh" before starting eclipse or
alternatively "source local/bin/sage-env" from $SAGE_ROOT. Then PATH
and LD_LIBRARY_PATH should be set properly.

> Thanks in advance.
>
> 
> Emerson

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: assignments and functions

2008-06-10 Thread Stan Schymanski

Dear all

I have been using the .subs(locals()) functionality extensively, but
now I found out that this does not work for piecewise defined
functions.

Example:

sage: var('x a b')
(x, a, b)
sage: f1=a*sin(x)
sage: f2=b*sin(x)
sage: f = Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
sage: a=1
sage: b=-1
sage: f.subs(locals())
---
AttributeErrorTraceback (most recent call
last)

...

AttributeError: PiecewisePolynomial instance has no attribute 'subs'

The python function approach also fails in this case:

sage: def g(x):
: return  Piecewise([[(0,pi/2),f1],[(pi/2,pi),f2]])
sage: a=1
sage: b=-1
sage: g(1)
Piecewise defined function with 2 parts, [[(0, pi/2), a*sin(x)], [(pi/
2, pi), b*sin(x)]]

Am I doing something wrong?

Cheers
Stan
--~--~-~--~~~---~--~~
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] simplifying exponents

2008-06-10 Thread polo0691

Thanks for creating sage! I can really see how useful sage could be
for engineering purposes. I've been playing around with sage for a
couple of days and I have had trouble with the following:

  1) simplifying equations with exponents:

sage: var('vgs vt n')
(vgs, vt, n)
sage: f = (vgs - vt)^n
sage: f^(1/n)
((vgs - vt)^n)^(1/n)
sage: f^(1/n).simplify()
((vgs - vt)^n)^(1/n)

It doesn't seem to easily simplify the exponent. I'm guessing it
is a limitation of the CAS engine used. I also tried the same test
case on YACAS and it didn't seem to want to simplify the exponent
either.

 2) I don't see a lot of examples on how one could take data and fit
it to a mathematical model. I realize that I could write some python
code and use scipy along with numpy; but I was wondering if there was
an easier way.  I'm a circuit designer and I like to fit transistor
models within a certain range of operation to enable mathematical
analysis of circuit operation. So the models I'm trying to fit are not
terribly complicated (functions like above and perhaps some
exponentials and polynomials).  I've fitted functions in Excel using
the solver function and least squares method; but was looking for more
of a Pythonish,script based solution and then I stumbled upon Sage. I
didn't see any examples though. I'm also interested in optimization
algorithms that might have a place in Sage as well.

 3) One of the nice things about Sage is that it interfaces to a lot
of packages. I see the potential challenge of keeping those packages
updated within the Sage releases. I've noticed that matplotlib, numpy,
sympy are all out of date. For those of us who like to use the latest
python packages, can we simply replace the older packages in the site-
packages directories with an updated version? Is there a recommended
way of updating incrementally small python modules without breaking
the SAGE interface to those python modules?


  thanks!

   Jon

--~--~-~--~~~---~--~~
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 + Eclipse + PyDev

2008-06-10 Thread Emerson

Hello everyone.

I'm trying to set up sage to work with pydev on Eclipse. So far, I've
managed to set the interpreter properly (it does seem to work
properly). The problem is that when I try to do this...

from sage.all import *

...I get the following error message "ImportError: libgnutls.so.26:
cannot open shared object file: No such file or directory". I don't
actually know why I'm getting this message as I've set the SAGE_ROOT
and LD_LIBRARY_PATH variables to the proper locations. I've set these
variables via python. Bellow is my (sample) code that was starting to
write when I came across this message.

== START OF CODE ===

import sys
import os

os.environ.__setitem__('SAGE_ROOT', '/home/emerson/ProgramFiles/Sage')
os.environ.__setitem__('PATH', os.environ.__getitem__('SAGE_ROOT') +
':' + os.environ.__getitem__('PATH'))
os.environ.__setitem__('LD_LIBRARY_PATH',
os.environ.__getitem__('SAGE_ROOT')+'/local/lib')

# + os.environ.__getitem__('LD_LIBRARY_PATH') :/usr/lib/jvm/java-6-
sun-1.6.0.03/jre/lib/i386/client::/usr/lib/jvm/java-6-sun-1.6.0.03/jre/
lib/i386::/usr/lib/firefox/:/usr/lib/firefox/

print(os.environ.__getitem__('SAGE_ROOT'))
print(os.environ.__getitem__('PATH'))
print(os.environ.__getitem__('LD_LIBRARY_PATH'))

from sage.all import *

== END OF CODE ===

If anyone could help me I'd appreciate. I'm really stuck at this :-(.

Thanks in advance.


Emerson

--~--~-~--~~~---~--~~
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: How do I create a Matrices Set

2008-06-10 Thread John Cremona

It is hard to help if you don't post the whole session.  What is m?
What are you trying to create, a set containing some matrices?

In Sage you can only form sets of objects if the are "immutable",
which is a Python concept.  That is to do with the way that set
elements are managed, via so-called hash functions.  But when you
construct a matrix in Sage is is "mutable", i.e. you can change its
elements.

So if you want a set containing matrices you have to make the
immutable first.  Like this:

sage: m=Matrix([[1,2],[3,4]])
sage: MatList=[m^i for i in range(5)]
sage: for mi in MatList: mi.set_immutable()
:
sage: MatSet = Set(MatList)
sage: MatSet

{[1 2]
[3 4], [199 290]
[435 634], [1 0]
[0 1], [ 7 10]
[15 22], [ 37  54]
[ 81 118]}

(not very beautiful, but it is a set of matrices).

I'm only guessing, but I bet that for what you are trying to do, using
a list of matrices (such as I constructed above, called MatList) will
do what you need.

John Cremona

2008/6/10 cesarnda <[EMAIL PROTECTED]>:
>
> I want to create a matrices set but I get the following error if I use
> the Set command:
> sage: setMat = Set(m)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/cesarnda/ in ()
>
> /home/cesarnda/Sage/sage-3.0.2-debian32-intelx86-i686-Linux/local/lib/
> python2.5/site-packages/sage/sets/set.py in Set(X)
> 76
> 77 if isinstance(X, Element):
> ---> 78 raise TypeError, "Element has no defined underlying
> set"
> 79 elif isinstance(X, (list, tuple, set, frozenset)):
> 80 return Set_object_enumerated(frozenset(X))
>
> TypeError: Element has no defined underlying set
>
> and if I use the set command I get:
> sage: setMat = set(m)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/cesarnda/ in ()
>
> /home/cesarnda/free_module_element.pyx in
> sage.modules.free_module_element.FreeModuleElement.__hash__ (sage/
> modules/free_module_element.c:2570)()
>
> TypeError: mutable vectors are unhasheable
>
> How can I solve this problem?
>
> >
>

--~--~-~--~~~---~--~~
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: How do I create a Matrices Set

2008-06-10 Thread William Stein

On Tue, Jun 10, 2008 at 9:31 AM, cesarnda <[EMAIL PROTECTED]> wrote:
>
> I want to create a matrices set but I get the following error if I use
> the Set command:
> sage: setMat = Set(m)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/cesarnda/ in ()
>
> /home/cesarnda/Sage/sage-3.0.2-debian32-intelx86-i686-Linux/local/lib/
> python2.5/site-packages/sage/sets/set.py in Set(X)
> 76
> 77 if isinstance(X, Element):
> ---> 78 raise TypeError, "Element has no defined underlying
> set"
> 79 elif isinstance(X, (list, tuple, set, frozenset)):
> 80 return Set_object_enumerated(frozenset(X))
>
> TypeError: Element has no defined underlying set
>
> and if I use the set command I get:
> sage: setMat = set(m)
> ---
> TypeError Traceback (most recent call
> last)
>
> /home/cesarnda/ in ()
>
> /home/cesarnda/free_module_element.pyx in
> sage.modules.free_module_element.FreeModuleElement.__hash__ (sage/
> modules/free_module_element.c:2570)()
>
> TypeError: mutable vectors are unhasheable
>
> How can I solve this problem?

What exactly is m?  By "Matrices set" do you mean a
"set of matrices"?

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] How do I create a Matrices Set

2008-06-10 Thread cesarnda

I want to create a matrices set but I get the following error if I use
the Set command:
sage: setMat = Set(m)
---
TypeError Traceback (most recent call
last)

/home/cesarnda/ in ()

/home/cesarnda/Sage/sage-3.0.2-debian32-intelx86-i686-Linux/local/lib/
python2.5/site-packages/sage/sets/set.py in Set(X)
 76
 77 if isinstance(X, Element):
---> 78 raise TypeError, "Element has no defined underlying
set"
 79 elif isinstance(X, (list, tuple, set, frozenset)):
 80 return Set_object_enumerated(frozenset(X))

TypeError: Element has no defined underlying set

and if I use the set command I get:
sage: setMat = set(m)
---
TypeError Traceback (most recent call
last)

/home/cesarnda/ in ()

/home/cesarnda/free_module_element.pyx in
sage.modules.free_module_element.FreeModuleElement.__hash__ (sage/
modules/free_module_element.c:2570)()

TypeError: mutable vectors are unhasheable

How can I solve this problem?

--~--~-~--~~~---~--~~
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] notebook shows up as blank in firefox

2008-06-10 Thread Stan Schymanski

Dear all,

When I try to display some of the documentation notebooks, they turn
out partly or wholly blank in Firefox, especially the long ones (e.g.
5.1 2d plotting).

They work fine in Safari, so perhaps this is more a Firefox or Mac
issue than a SAGE problem, but perhaps someone experienced something
similar.

Some details:
I am running 'SAGE Version 3.0.2, Release Date: 2008-05-24' on a
MacBook Pro with Mac OS X 10.4.11 and Firefox 2.0.0.11.


Thanks a lot for your help already!

Cheers
Stan

--~--~-~--~~~---~--~~
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: error compiling sage: pari and libgmp mismatch - fixed

2008-06-10 Thread lciti

Hi Michael,
thank you for your reply.
I think it is something related to gmp. It is the only one that falls
in this error.
After the fix it gets configured for a x86_64 machine and not for a
core duo
(and as you said it is probably suboptimal) but at least not as a
generic i386,
that would be (besides suboptimal) also uncompatible with pari that
gets
compiled for x86_64.
I attach all the info you requested and some more I think useful.
It is a big bunch of data I hope it is still readable.
The line "Do we have a Core2 CPU?... No" looks weird as well as maybe
"Patching gmp-h.in".
The line "config.status: linking ./mpn/generic/add.c to mpn/
add.c" (and similar)
after the patch become s."... /mpn/x86_64/add.c to mpn/add.c".
Thanks again.
Cheers,
Luca







part of install.log concerning the configuration of gmp (before the
fix):



GCC Version
gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --
disable-checking --with-system-
zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-
java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)

Patching gmp-h.in (fixes OSX 10.5 issues and gcc 4.3 problems)
Do we have a Core2 CPU?... No
Moving .asm files that are to be replaced to .asm.disabled ...
Copying new .asm and x86_64-defs.m4 files ...
Copying new gmp-mparam.h...
Done.
You can now go to /home/lciti/opt/sage-3.0.2/spkg/build/gmp-4.2.2/src
and configure/make/make_check as usual.
Fast gcd patch:
Moving files that are to be replaced to *.orig ...
Copying new files across...
Done.
checking build system type... pentium3-unknown-linux-gnu
checking host system type... pentium3-unknown-linux-gnu
..
..
config.status: linking ./mpn/generic/add.c to mpn/add.c
config.status: linking ./mpn/generic/add_1.c to mpn/add_1.c
config.status: linking ./mpn/x86/p6/aors_n.asm to mpn/add_n.asm
config.status: linking ./mpn/generic/sub.c to mpn/sub.c
config.status: linking ./mpn/generic/sub_1.c to mpn/sub_1.c
config.status: linking ./mpn/x86/p6/aors_n.asm to mpn/sub_n.asm





part of install.log concerning the configuration of SQLite (and many
others are similar)



GCC Version
gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --
disable-checking --with-system-
zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-
java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu





$ grep "host system" ~/opt/sage-3.0.2/install.log
checking host system type... pentium3-unknown-linux-gnu   <--- this is
libgmp (before the fix) !
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-redhat-linux-gnu   <--- this
is iml
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host system type... (cached) x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking host

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread M. Yurko

After a little more searching, it appears that I should use a Pseudo
tty( right?). However, the programming guide gives no information on
how to actually do this. Any help would be greatly appreciated
(copying and pasting input and output is less than ideal).

On Jun 10, 10:15 am, "M. Yurko" <[EMAIL PROTECTED]> wrote:
> Mike, thanks for the code. This is just what I need and works well
> from the command line. However, I'm a bit of a SAGE and linux newbie
> and I'm unsure about the best way of integrating this with SAGE. I
> checked the programming guide, but I only have some basic Python
> experience and have never done anything with C++ before. If it
> matters, I'm using Ubuntu 8.04 and have SAGE 3.0.2.
>
> On Jun 8, 11:15 pm, Michael <[EMAIL PROTECTED]> wrote:
>
> > My package has routines for the incomplete gamma function, and the
> > logarithmic
> > integral is a special case of that. For the incomplete gamma function
> > I use a
> > combination of series, asumptotics, and continued fractions.  The
> > relevant file
> > is Lgamma.h in the include directory of my L-function 
> > package:http://pmmac03.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/
>
> > Mike
>
> > On Jun 7, 4:08 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>
> > > On Sat, Jun 7, 2008 at 12:54 PM, M. Yurko <[EMAIL PROTECTED]> wrote:
>
> > > > Is there any way for SAGE to calculate Li(x) (logarithmic integral)
> > > > for complex inputs?
>
> > > I don't think that functionality is directly exposed in Sage in any easy
> > > to use way.  I've cc'd Mike Rubinstein who has probably written fast
> > > C++ code (that is included with sage) in hopes that he will have a comment
> > > to make.
>
> > > 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: Li(x) in the complex domain

2008-06-10 Thread M. Yurko

Mike, thanks for the code. This is just what I need and works well
from the command line. However, I'm a bit of a SAGE and linux newbie
and I'm unsure about the best way of integrating this with SAGE. I
checked the programming guide, but I only have some basic Python
experience and have never done anything with C++ before. If it
matters, I'm using Ubuntu 8.04 and have SAGE 3.0.2.

On Jun 8, 11:15 pm, Michael <[EMAIL PROTECTED]> wrote:
> My package has routines for the incomplete gamma function, and the
> logarithmic
> integral is a special case of that. For the incomplete gamma function
> I use a
> combination of series, asumptotics, and continued fractions.  The
> relevant file
> is Lgamma.h in the include directory of my L-function 
> package:http://pmmac03.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/
>
> Mike
>
> On Jun 7, 4:08 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>
> > On Sat, Jun 7, 2008 at 12:54 PM, M. Yurko <[EMAIL PROTECTED]> wrote:
>
> > > Is there any way for SAGE to calculate Li(x) (logarithmic integral)
> > > for complex inputs?
>
> > I don't think that functionality is directly exposed in Sage in any easy
> > to use way.  I've cc'd Mike Rubinstein who has probably written fast
> > C++ code (that is included with sage) in hopes that he will have a comment
> > to make.
>
> > 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: init.sage and sage -c

2008-06-10 Thread William Stein

On Sun, Jun 8, 2008 at 4:56 PM, kwatford <[EMAIL PROTECTED]> wrote:
>
> I have defined a function that starts up the notebook server with my
> desired preferences and placed the function definition into my
> init.sage script, so that whenever I use the command line, I don't
> have to remember the whole thing to start it up. Works fine.
>
> Since I usually go straight to the notebook, I figured just running:
> sage -c "snote()"
> would do the trick. But apparently init.sage isn't executed before the
> -c command.
>
> I already know ways to start the notebook conveniently from the
> command line so I'm not worried about that, but I was wondering if
> that was the correct and desired behavior of -c. Perhaps we could have
> another similar argument ( -C ?) that executes init.sage before
> executing the command?

I think it's a bug that 'sage -c' doesn't load init.sage first.

Does anybody think differently?  If nobody disagrees, I'll
add a trac ticket.

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