[sage-support] list of functions

2009-01-29 Thread martin Campos Pinto

Hi again,
... and again sorry if this is a newbie's question:

so when I type (in my sage Notebook 3.2.3)

a = [i for i in range(2)]
a[0]

I get 0 (which is fine), now when I type

b = [lambda x:i for i in range(2)]
b[0](0)

I get 1 ... There must be a simple explanation for this but I can't
figure it out. What's wrong ?

Thanks in advance, (sage is really wonderful :-)
- 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] Strange behaviour of float()?

2009-01-29 Thread martin Campos Pinto

Hi everybody,

in my Notebook (version 3.2.3) I get the following:

sage: a = float(11)
sage: a

0.0

sage: var('x')
sage: b(x) = float(x1)

Traceback (most recent call last):
  File stdin, line 1, in module
  File /Users/campos/.sage/sage_notebook/worksheets/admin/4/code/
204.py, line 8, in module
_=var(x);b=symbolic_expression(float(x_sage_const_1 )).function
(x)
  File /Applications/sage/local/lib/python2.5/site-packages/
SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module

TypeError: float() argument must be a string or a number

... is this a normal behaviour for float()? And sorry is this is a
silly question!
-- 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: list of functions

2009-01-29 Thread Mike Hansen

Hello,

On Thu, Jan 29, 2009 at 1:46 AM, martin Campos Pinto
mcp.st...@gmail.com wrote:
 I get 0 (which is fine), now when I type

 b = [lambda x:i for i in range(2)]
 b[0](0)

 I get 1 ... There must be a simple explanation for this but I can't
 figure it out. What's wrong ?

This is caused by the scoping rules for Python's lambdas and list
comprehensions.  See the question and answer here for an explanation:
http://stackoverflow.com/questions/139819/why-results-of-map-and-list-comprehension-are-different

--Mike

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



[sage-support] Re: list of functions

2009-01-29 Thread martin Campos Pinto


 This is caused by the scoping rules for Python's lambdas and list
 comprehensions.  See the question and answer here for an 
 explanation:http://stackoverflow.com/questions/139819/why-results-of-map-and-list...

 --Mike

...ok, so, a way to write it would be
b = [lambda x,u=i:u for i in range(2)]

Thanks for the link, that was very helpful.
-- 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] Running Sage with a Red Hat distribution

2009-01-29 Thread david

Dear support team,

I would like to install sage on my Machine. I have Red Hat
distribution of Linux.
Can I get a compiled package? or do I have to build the source myself?

Thanks!

David

--~--~-~--~~~---~--~~
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 3.2.3: plots being displayed in webbrowser

2009-01-29 Thread hvniekerk


 Could you please paste the following lines into a Sage session and
 tell me their output?


sage: sage.misc.viewer.viewer()
'firefox'
sage: sage.misc.viewer.BROWSER
'firefox'
sage: sage.misc.viewer.PNG_VIEWER
'firefox'
sage: sage.misc.viewer.DVI_VIEWER
'xdvi'
sage: sage.misc.viewer.PDF_VIEWER
'acroread'
sage:

BTW, I build sage from source on Debian and plots go ok now.
--~--~-~--~~~---~--~~
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: Running Sage with a Red Hat distribution

2009-01-29 Thread Harald Schilly



On Jan 29, 1:09 pm, david d.adjiashv...@gmail.com wrote:
 I have Red Hat
 distribution of Linux.

Could you please specify the red hat version you have and your cpu
type?

Probably the fedora binary could work for you but I don't know.

harald
--~--~-~--~~~---~--~~
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] Field Embeddings

2009-01-29 Thread cm

Hi,

suppose I have a field embedding A = GF(2^4) - B = GF(2^20) say,
and I pick a homomorphism phi from C=A.Hom(GF(2^20,'x')), e.g.

sage: phi

   Ring morphism:
 From: Finite Field in x of size 2^4
 To:   Finite Field in x of size 2^20
 Defn: x |-- x^19 + x^14 + x^13 + x^12 + x^10 + x^8 + x^2 + x

I can evaluate phi on any element from A, but I cannot evaluate the
inverse map.
Is there a way to calculate the inverse?

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: Illegal instruction error -- missing processor flag pni

2009-01-29 Thread Arun

On Jan 27, 2:54 pm, William Stein wst...@gmail.com wrote:
 On Tue, Jan 27, 2009 at 11:44 AM, Arun arungirid...@gmail.com wrote:

  On Jan 27, 3:14 am, William Stein wst...@gmail.com wrote:
  On Mon, Jan 26, 2009 at 2:07 PM, Arun arungirid...@gmail.com wrote:

   When I try to run Sage 3.2.3 on Pentium M 750 (Dothan, MMX, SSE, SSE2)
   with VMWare on Windows XP, I get the following error:

     WARNING!  This Sage install was built on a machine that supports
     instructions that are not available on this computer.  Sage will
     likely fail with ILLEGAL INSTRUCTION errors! The following
   processor
     flags were on the build machine but are not on this computer:

     pni

   I found this through Sagetrac:http://sagetrac.org/sage_trac/ticket/4642
   which says that pni (Prescott new instructions) cannot be ignored.
   Please let me know what I can do to disable Sage's reliance on pni, or
   if I need to compile Sage from source under VMWare.

  Right now the best thing you can do is to compile Sage from source under 
  VMware.
  It should work since that's exactly how I build sage for the vmware
  machine.   If this proves impossible for you for some reason, let me
  know.  It should be easy though.

  We *are* working on making it so it is possible to build sage in such
  a way that it
  doesn't require pni, etc., but that will be some months in the future.

   -- William

  William,

  Thanks! It will probably be a little difficult for me due to disk
  space constraints (enough for Sage under VMWare Player, but
  insufficient for Ubuntu + VMWare Server + Sage), but I'll see what I
  can do to solve the problem.

 All you have to do is the following:

 1. login to the virtual machine that you already have (login: login,
 password: sage)
 2. sudo su
 3. cd /usr/local/
 4. rm -rf sage      # get rid of the sage install I put there
 5. wgethttp://sagemath.org/src/sage-3.2.3.tar
 6. tar xf sage-3.2.3.tar
 7. mv sage-3.2.3 sage
 8. cd sage
 9. make   # 2-3 hours, at least.

 Then you're done.  No need to install another Ubuntu + vmware server +
 sage.  Just use vmware player and what you've alread got.

  -- William

William,

It works! Thank you.

Arun
--~--~-~--~~~---~--~~
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] Large formula simplification

2009-01-29 Thread Zac

I have a really large formula that obviously has some common terms and
significant duplication inside of it, is there a way to make sage
reduce, or extract out common pieces?

Small example: http://sagenb.org:8000/home/pub/195

Any help is greatly appreciated.

-Zac

--~--~-~--~~~---~--~~
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] spherical_bessel_J() argument

2009-01-29 Thread Robert Close


I'm trying to do some symbolic calculus and am having trouble with the special function spherical_bessel_J(). I can't get it to work when the argument contains two factors.
Here is a simple program:
k=var('k');
k=maxima(k);
rho=var('rho');
rho=maxima(rho);
arg=var('arg');
arg=maxima(arg);
arg=k*rho;
f=cos(arg);
print f;
f=spherical_bessel_J(1,rho);
print f;
f=spherical_bessel_J(1,arg);
print f;

The first two print statements are fine:

  cos(k rho)

  sin(rho)
   - cos(rho)
rho
  ---
  rho
But the program hangs and never reaches the third print statement. What is wrong?
-Robert
robert.cl...@classicalmatter.org 


[sage-support] Re: Large formula simplification

2009-01-29 Thread Zac


Small example:http://sagenb.org/home/pub/195

I would like to have it decompose into something like:

z = ( 0.027027027027e ) / d  + 3p/dmq
f'(x) = ( 4 * z ^ 2 ) - ( 2 * z )
--~--~-~--~~~---~--~~
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 can I make a topographic map with Sage?

2009-01-29 Thread Sage

Is Sage suitable for topography? I have collected the data of a see,
discreate data points. I need to make regressions on the data. Then, I
think the contour plot creates the final topographic map. Or am I
wrong? How are topographic maps dene in Sage? Can I give the data as
an input and get the map back as an output?

--~--~-~--~~~---~--~~
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 can I make a topographic map with Sage?

2009-01-29 Thread Carl Witty

On Jan 29, 5:32 pm, Sage sage...@gmail.com wrote:
 Is Sage suitable for topography? I have collected the data of a see,
 discreate data points. I need to make regressions on the data. Then, I
 think the contour plot creates the final topographic map. Or am I
 wrong? How are topographic maps dene in Sage? Can I give the data as
 an input and get the map back as an output?

Maybe the contour_plot function (type contour_plot? for documentation)
will be helpful?

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: How can I make a topographic map with Sage?

2009-01-29 Thread David Joyner

I don't know if there is anything Sage specific. However, Sage contains
matplotlib, which apparently can do such things. For example, I googled
maps matplotlib and got this:
http://www.scipy.org/Cookbook/Matplotlib/Maps


On Thu, Jan 29, 2009 at 8:32 PM, Sage sage...@gmail.com wrote:

 Is Sage suitable for topography? I have collected the data of a see,
 discreate data points. I need to make regressions on the data. Then, I
 think the contour plot creates the final topographic map. Or am I
 wrong? How are topographic maps dene in Sage? Can I give the data as
 an input and get the map back as an output?

 


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