[sage-support] install R packages

2009-07-14 Thread Aleksey Gogolev

Hello!

I tried to install package cluster for R and got this:

--
| Sage Version 4.0.2, Release Date: 2009-06-18   |
| Type notebook() for the GUI, and license() for information.|
--
sage: r.install_package(cluster)
Error: object sage1 not found
sage: r.install_package(cluster)
Error: object sage2 not found
sage: r.install_package(cluster)

Can somebody give a hint what is wrong?

Thanks in advance.

--~--~-~--~~~---~--~~
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: primitive k-th root of unity

2009-07-14 Thread davidloeffler

On Jul 14, 11:37 am, mac8090 bonzerpot...@hotmail.com wrote:
 For a given k, is it possible to instantly get an k-th root of unity
 in sage without making extra fields, or by using e^(2*pi*I/k)?

I'm curious why you are so opposed to creating a number field.
Basically, there are three one-liners you can use:

CyclotomicField(k).gen() -- creates a number field element.
CC.zeta(k) -- creates an inexact, fixed-precision approximation.
QQbar.zeta(k) -- a clever hybrid, which behaves like an element of CC
but also remembers that it's algebraic and can calculate itself to
arbitrary precision if you ask it to.

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: primitive k-th root of unity

2009-07-14 Thread David Joyner

On Tue, Jul 14, 2009 at 6:37 AM, mac8090bonzerpot...@hotmail.com wrote:


 For a given k, is it possible to instantly get an k-th root of unity
 in sage without making extra fields, or by using e^(2*pi*I/k)?


I'm a bit confused by your question. If you mean k-th roots of unity in
the complex field CC then

sage: z = e^(2*pi*I/7)
sage: z^7
1

works for me. If youmean the kth roots of unity in some other field
(after all, every field contains 0 and 1) then you should specify the
field to determine where you want the roots of x^k-1=0 to lie.




 On a similar note, anybody know why I can't get sage to equate e^
 (theta*I) == cos(theta) + I*sin(theta) ?


I don't know. Sage uses Maxima. Does maxima know Euler's formula?


 


--~--~-~--~~~---~--~~
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] Cython typedef not working

2009-07-14 Thread Ethan Van Andel

When I run this code:

%cython
%time
import numpy as np
cimport numpy as np

COMPLEX = np.complex128
ctypedef np.complex128_t COMPLEX_t

it gives me this error:

...code_sage30_spyx_0.pyx:10:9: 'complex128_t' is not a type
identifier

As far as I can tell my code should work. At one point I think I heard
that this was a known issue and would be fixed in 4.1. Is it still not
working, or am I doing something wrong?

If it isn't working, is there any sort of work around I can do?

Thanks for any help you can give,

Ethan
--~--~-~--~~~---~--~~
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: Cython typedef not working

2009-07-14 Thread Robert Bradshaw

There is a ticket in progress to fix this. I've started reviewing it,  
I'm hopefully it'll go into 4.1.1.

On Jul 14, 2009, at 7:11 AM, Ethan Van Andel wrote:


 When I run this code:

 %cython
 %time
 import numpy as np
 cimport numpy as np

 COMPLEX = np.complex128
 ctypedef np.complex128_t COMPLEX_t

 it gives me this error:

 ...code_sage30_spyx_0.pyx:10:9: 'complex128_t' is not a type
 identifier

 As far as I can tell my code should work. At one point I think I heard
 that this was a known issue and would be fixed in 4.1. Is it still not
 working, or am I doing something wrong?

 If it isn't working, is there any sort of work around I can do?

 Thanks for any help you can give,

 Ethan
 


--~--~-~--~~~---~--~~
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: assume()

2009-07-14 Thread Doug


Hmm. I've also had trouble interpreting what assume() affects, and I'm
glad to hear that I'm not the only one.  What Robert says here helps a
lot, but is there anything written anywhere else that goes into a bit
more detail?  I'm sure there's more to it than a missing filter on the
output of solve.  e.g., that doesn't explain Neal's other example:

 sage: assume(x == 1)
 sage: bool(x == 1)
 False

I do a bunch of writing down equations, stating assumptions, and
trying to prove inequalities.  Understanding what assume() does and
does not do could make my job a lot easier!

--Doug

--~--~-~--~~~---~--~~
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] Newb basic algebra question

2009-07-14 Thread Doug

Hi all; I'm brand new to sage and am finding it really fun and
useful.  Of course, I don't know anyone else who uses it and thus need
to rely on the general community when reading documentation and
scratching my head leave me with open questions.  Here's my first:

sage: foo = (x-1)^2/(x+2)^2 + 2*(x-1)/(x+2)
sage: bar = foo*(x+2)
sage: bar
(x + 2)*((x - 1)^2/(x + 2)^2 + 2*(x - 1)/(x + 2))

How come (x+2) isn't canceling in each of the parts?  It does simplify
if I multiply each additive part of foo separately:

sage: foo1 = (x-1)^2/(x+2)^2
sage: bar1 = foo1*(x+2)
sage: bar1
(x - 1)^2/(x + 2)

sage: foo2 = 2*(x-1)/(x+2)
sage: bar2 = foo2*(x+2)
sage: bar2
2*x - 2

Any help would be much appreciated!

-Doug

--~--~-~--~~~---~--~~
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: Newb basic algebra question

2009-07-14 Thread Harald Schilly

On Jul 14, 6:18 pm, Doug mcke...@gmail.com wrote:
 Hi all; I'm brand new to sage and am finding it really fun and
 useful.

Great, welcome in the Sage family ;)


 Any help would be much appreciated!


That's simply a matter of automatic simplification. Your more complex
term with the sum is just not covered by those simplification rules.
Others might tell you more details, but basically it's just that.
Think about a much bigger term: There is no way that all possible
simplifications are done automatically while still being fast. Of
course, there are also simplification commands for the resulting term
to do it on demand.

H
--~--~-~--~~~---~--~~
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: Newb basic algebra question

2009-07-14 Thread Robert Bradshaw

On Jul 14, 2009, at 9:18 AM, Doug wrote:

 Hi all; I'm brand new to sage and am finding it really fun and
 useful.

Thanks.

 Of course, I don't know anyone else who uses it and thus need
 to rely on the general community when reading documentation and
 scratching my head leave me with open questions.

Note that Sage's calculus stuff, while still very useful, isn't as  
well developed as some of the other parts of Sage. We use maxima a s  
a backend, but it doesn't always do what we want, and is sometimes  
incompletely wrapped. (This is an area of active development.)

 Here's my first:

 sage: foo = (x-1)^2/(x+2)^2 + 2*(x-1)/(x+2)
 sage: bar = foo*(x+2)
 sage: bar
 (x + 2)*((x - 1)^2/(x + 2)^2 + 2*(x - 1)/(x + 2))

 How come (x+2) isn't canceling in each of the parts?

Probably because x might be -2. Also, you have to explicitly simplify  
to do any non-trivial transformations (because it may be expensive to  
do so).

sage: bar.simplify_full()
3*(x^2 - 1)/(x + 2)

- 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] Sage Unum

2009-07-14 Thread dw

I've been evaluating Sage for engineering applications.  The one
missing part, which after reading this forum I've realized is
currently being worked on, is unit support.  The best solution I've
been able to use so far is Unum.  It works well in my application, but
in the notebook I'd like to be able to limit the number of digits
shown.  I'd previously been using print '%.3f to set the display, but
it doesn't work with Unum numbers.  I'm sure this would be better
asked in an Unum forum, but I haven't found one and it seems a few
people here have used the package.
Also, on a more general note.  Can you set the significant digits
displayed throughout a notebook somehow?

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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread William Stein

On Tue, Jul 14, 2009 at 3:01 AM, Paul Sargentpsa...@gmail.com wrote:


 On 13 Jul 2009, at 17:13, Robert Bradshaw wrote:

 In general, we try to avoid modifying the preparser as much as
 possible. Sometimes, we really have to

 sage: eval(1/2 + 3^2)
 1

 is really not acceptable (IMHO) for a serious alternative to other
 systems out there

 I know what you're getting at, but that's a rather cheeky example. '^'
 is the python XOR operator. '**' is the python exponent operator. To
 be honest, I'm not sure why sage re-writes '^' as '**'. As long as
 there's an operator that does the job, everything is good IMHO.

Your perspective might change if you imagine giving colloquium talks
to college teachers who have all used Mathematica + Latex for years,
where ^ means exponent and / means divide (not floor divide).   In
my experience (having given dozens of such talks), such an audience
would consider ^ not working right to be a deal breaker for many
of them, and would not consider switching to Sage.

 The bigger point about the pre-parser is reasonable though. It should
 only do what's unavoidable (for appropriate values of unavoidable).

+1

William



 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
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] adding cells

2009-07-14 Thread Mikie

I have several worksheets in my file list.  Just created new notebook
and I can only add about 7 cells.  Why is this?  Is there some kind of
limit?
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: adding cells

2009-07-14 Thread Marshall Hampton

Try reloading the page.  Occaisonally things go wrong and there isn't
actually a connection to the server, in which case the notebook looks
OK but it won't let you make new cells.  Do the cells that are already
there actually work?

-M. Hampton

On Jul 14, 1:23 pm, Mikie thephantom6...@hotmail.com wrote:
 I have several worksheets in my file list.  Just created new notebook
 and I can only add about 7 cells.  Why is this?  Is there some kind of
 limit?
 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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread Carlos Córdoba
Sorry for not answering before, I've being a bit busy. I'll try to give a
concrete example of what I'm trying to do so you can understand me better.
I have a list of real numbers, for example

[1,2,3]

I want to multiply by 2 to get

[2,4,6]

the to sum it to 3

[5,7,9]

then divide by the max number

[5/9, 7/9, 1]

then convert every point to a point in the circle with

[[cos(5/9), sin(5/9)], [cos(7/9), sin(7/9)], [cos(1), sin(1)]]

Finally graph this thing with list_plot.

To do this in Mathematica I just have to operate on the successive lists.
But to do this on Sage I would have to transform the initial list into a
vector or numpy array, do all the operations and finally transform the
result again into a list of lists so I can plot it.

I was hoping to avoid the transformation functions, which (in my humble
opinion) make the code more verbose and can probably misguide those who read
it later (why does he used vectors if the data are frequencies?)

To do what I want I would have to modify the arithmetics methods of the list
python built-in, so I can do 2 + [1,2,3] to get [3,4,5] instead of getting
an error. Unfortunately that is forbidden by the language.

Another option (mentioned by Marshall before) is to subclass list, with a
MyList class for example, and then change the methods I want on it. But then
I would have to wrap every list I use with MyList, which makes the code
equally verbose.

So the last thing that occurred to me was to modify the parser (or something
like that) so that every list that I write in Sage be an instance of MyList
instead of list, in the same spirit as every number in Sage is an instance
of Integer or RealNumber and not of int and float.

I hope you understand that my motivation is mainly aesthetic. I know that my
problem can be easily solved in Sage. I just want to know if I can write
more succinct and simpler code with just one type (a list), instead of doing
several transformations and possibly writing more functions to do them.

Thanks,
Carlos

On Tue, Jul 14, 2009 at 1:45 PM, William Stein wst...@gmail.com wrote:


 On Tue, Jul 14, 2009 at 3:01 AM, Paul Sargentpsa...@gmail.com wrote:
 
 
  On 13 Jul 2009, at 17:13, Robert Bradshaw wrote:
 
  In general, we try to avoid modifying the preparser as much as
  possible. Sometimes, we really have to
 
  sage: eval(1/2 + 3^2)
  1
 
  is really not acceptable (IMHO) for a serious alternative to other
  systems out there
 
  I know what you're getting at, but that's a rather cheeky example. '^'
  is the python XOR operator. '**' is the python exponent operator. To
  be honest, I'm not sure why sage re-writes '^' as '**'. As long as
  there's an operator that does the job, everything is good IMHO.

 Your perspective might change if you imagine giving colloquium talks
 to college teachers who have all used Mathematica + Latex for years,
 where ^ means exponent and / means divide (not floor divide).   In
 my experience (having given dozens of such talks), such an audience
 would consider ^ not working right to be a deal breaker for many
 of them, and would not consider switching to Sage.

  The bigger point about the pre-parser is reasonable though. It should
  only do what's unavoidable (for appropriate values of unavoidable).

 +1

 William


 
  
 



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

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread John H Palmieri



On Jul 14, 1:52 pm, Carlos Córdoba ccordob...@gmail.com wrote:
 Sorry for not answering before, I've being a bit busy. I'll try to give a
 concrete example of what I'm trying to do so you can understand me better.
 I have a list of real numbers, for example

 [1,2,3]

Python list comprehensions might be what you want -- see
http://docs.python.org/tutorial/datastructures.html#list-
comprehensions

 I want to multiply by 2 to get

 [2,4,6]

sage: x = [1,2,3]
sage: y = [2*a for a in x]

 the to sum it to 3

 [5,7,9]

sage: z = [b + 3 for b in y]

 then divide by the max number

 [5/9, 7/9, 1]

sage: w = [a/max(z) for a in z]

 then convert every point to a point in the circle with

 [[cos(5/9), sin(5/9)], [cos(7/9), sin(7/9)], [cos(1), sin(1)]]

sage: v = [[cos(a), sin(a)] for a in w]


Is that helpful at all?

  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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread Carlos Córdoba
Thanks John, I'd seen Python comprehensions before, but since I was trying
to do all in a one-liner, I think I overlooked your elegant and simple
solution. One comprehension at a time is quite neat, but several is just
unreadable.

On Tue, Jul 14, 2009 at 4:28 PM, John H Palmieri jhpalmier...@gmail.comwrote:




 On Jul 14, 1:52 pm, Carlos Córdoba ccordob...@gmail.com wrote:
  Sorry for not answering before, I've being a bit busy. I'll try to give a
  concrete example of what I'm trying to do so you can understand me
 better.
  I have a list of real numbers, for example
 
  [1,2,3]

 Python list comprehensions might be what you want -- see
 http://docs.python.org/tutorial/datastructures.html#list-
 comprehensions

  I want to multiply by 2 to get
 
  [2,4,6]

 sage: x = [1,2,3]
 sage: y = [2*a for a in x]

  the to sum it to 3
 
  [5,7,9]

 sage: z = [b + 3 for b in y]

  then divide by the max number
 
  [5/9, 7/9, 1]

 sage: w = [a/max(z) for a in z]

  then convert every point to a point in the circle with
 
  [[cos(5/9), sin(5/9)], [cos(7/9), sin(7/9)], [cos(1), sin(1)]]

 sage: v = [[cos(a), sin(a)] for a in w]


 Is that helpful at all?

  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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread William Stein

2009/7/14 Carlos Córdoba ccordob...@gmail.com:
 Thanks John, I'd seen Python comprehensions before, but since I was trying
 to do all in a one-liner, I think I overlooked your elegant and simple
 solution. One comprehension at a time is quite neat, but several is just
 unreadable.

That could be a function of familiarity.  Quick poll -- Do you find
the following just unreadable?

x = [1,2,3]
y = [2*a for a in x]
z = [b + 3 for b in y]
w = [a/max(z) for a in z]
v = [[cos(a), sin(a)] for a in w]

ANSWER:
[ ] Yes, the above is just unreadable.
[ ] No, I can read the above just fine.  It is crystal clear.


 -- 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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread John H Palmieri

On Jul 14, 3:35 pm, William Stein wst...@gmail.com wrote:
 2009/7/14 Carlos Córdoba ccordob...@gmail.com:

  Thanks John, I'd seen Python comprehensions before, but since I was trying
  to do all in a one-liner, I think I overlooked your elegant and simple
  solution. One comprehension at a time is quite neat, but several is just
  unreadable.

 That could be a function of familiarity.  Quick poll -- Do you find
 the following just unreadable?

 x = [1,2,3]
 y = [2*a for a in x]
 z = [b + 3 for b in y]
 w = [a/max(z) for a in z]
 v = [[cos(a), sin(a)] for a in w]

 ANSWER:
 [ ] Yes, the above is just unreadable.
 [ ] No, I can read the above just fine.  It is crystal clear.

I think it's readable, but I think the issue was whether this was
unreadable:

[[cos(a/9), sin(a/9)] for a in [b+3 for b in [2*c for c in [1,2,3

(This is using a/9 instead of a/max(z) since I don't know how to do
'max(z)' in a one-liner like this.)

I think the above is not very readable, but of course you can write it
as

[[cos((2*a+3)/9), sin((2*a+3)/9)] for a in [1,2,3]]

and it's not too bad.

  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: derivative bug in Sage 4.0 symbolics?

2009-07-14 Thread Alex Raichev

Hi Burcin:

When using Sage for my work i makes heavy use of dictionaries to
substitute values for derivatives of symbolic functions.  Thanks for
your help on fixing this bug for Sage 4.1.1.

Alex

On Jun 8, 7:12 am, Burcin Erocal bur...@erocal.org wrote:
 Hi Alex,

 On Sun, 7 Jun 2009 11:31:26 -0700 (PDT)



 Alex Raichev tortoise.s...@gmail.com wrote:

  Hi all:

  Upon upgrading to Sage 4.0, i can no longer make a dictionary with
  derivatives as keys (see below).  Can someone please fix this?
  --
  | Sage Version 4.0, Release Date: 2009-05-29                         |
  | Type notebook() for the GUI, and license() for information.        |
  --
  sage: X= var('x,y')
  sage: f= function('f',*X); f
  f(x, y)
  sage: for x in X:
  :     diff(f,x)
  :
  D[0](f)(x, y)
  D[1](f)(x, y)
  sage: d= {}
  sage: for x in X:
  :     d[diff(f,x)] = 1
  :

 snip



  /Applications/sage/local/lib/python2.5/site-packages/sage/rings/
  complex_interval_field.pyc in __call__(self, x, im)
      286
      287             try:
  -- 288                 return x._complex_mpfi_( self )
      289             except AttributeError:
      290                 pass

  /Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
  expression.so in sage.symbolic.expression.Expression._complex_mpfi_
  (sage/symbolic/expression.cpp:5484)()
 snip
  /Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
  expression_conversions.pyc in derivative(self, ex, operator)
      344             NotImplementedError: derivative
      345         
  -- 346         raise NotImplementedError, derivative
      347
      348     def arithmetic(self, ex, operator):

  NotImplementedError: derivative

 I opened a ticket for this:

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

 As I wrote on the ticket, I believe the correct fix is to change pynac
 to handle more general numerical approximations. I will try to get this
 done until the next release.

 There might be an easier fix by implementing the derivative method in
 sage.symbolic.expression_conversions.Converter. Maybe Mike can comment
 on that.

 Thanks.

 Burcin
--~--~-~--~~~---~--~~
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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread Bill Page

 [ x ] No, I can read the above just fine.  It is crystal clear.

... but of course unnecessarily verbose. In my opinion a more common
notation in Sage:

sage: x=2*vector(range(10))+vector(10*[3])
sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x)))

is superior to Mathematica.

On Tue, Jul 14, 2009 at 6:35 PM, William Stein wrote:

 2009/7/14 Carlos Córdoba ccordob...@gmail.com:
 Thanks John, I'd seen Python comprehensions before, but since I was trying
 to do all in a one-liner, I think I overlooked your elegant and simple
 solution. One comprehension at a time is quite neat, but several is just
 unreadable.

 That could be a function of familiarity.  Quick poll -- Do you find
 the following just unreadable?

 x = [1,2,3]
 y = [2*a for a in x]
 z = [b + 3 for b in y]
 w = [a/max(z) for a in z]
 v = [[cos(a), sin(a)] for a in w]

 ANSWER:
 [ ] Yes, the above is just unreadable.
 [ ] No, I can read the above just fine.  It is crystal clear.


  -- 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: Is it possible to replace the list built-in type in Sage?

2009-07-14 Thread Bill Page

 [ x ] No, I can read the above just fine.  It is crystal clear.

... but of course unnecessarily verbose. In my opinion a more common
notation in Sage:

sage: x=2*vector(range(10))+vector(10*[3])
sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x)))

is superior to Mathematica.

On Tue, Jul 14, 2009 at 6:35 PM, William Stein wrote:

 2009/7/14 Carlos Córdoba ccordob...@gmail.com:
 Thanks John, I'd seen Python comprehensions before, but since I was trying
 to do all in a one-liner, I think I overlooked your elegant and simple
 solution. One comprehension at a time is quite neat, but several is just
 unreadable.

 That could be a function of familiarity.  Quick poll -- Do you find
 the following just unreadable?

 x = [1,2,3]
 y = [2*a for a in x]
 z = [b + 3 for b in y]
 w = [a/max(z) for a in z]
 v = [[cos(a), sin(a)] for a in w]

 ANSWER:
 [ ] Yes, the above is just unreadable.
 [ ] No, I can read the above just fine.  It is crystal clear.


  -- 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: How can calculate the time of execution of a command in sage

2009-07-14 Thread Gustavo Rama

But how con you get the time of execution in a variable?

On Jul 2, 10:33 am, William Stein wst...@gmail.com wrote:
 On Thu, Jul 2, 2009 at 1:31 PM, pangpablo.ang...@uam.es wrote:

  Watch also for cputime  and  walltime, which are very general and
  easy to use. Sometimes time and timeit are not convenient to use
  if you have more than one statement.

 One nice trick:  If you're in the notebook and you put

 %time

 as the first line of a notebook cell, then the entire block of code is timed.

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