[sage-support] benchmarking 2D numerical integration

2010-04-19 Thread wb
I've tried to do timing of simple 2D integrals using sage/mpmath vs. mathematica. Example: === sage: version() 'Sage Version 4.3.3, Release Date: 2010-02-21' sage: %time quadgl(lambda x,y: sin(x)*cos(y)/(x**2+y**2+1),[-8, 10], [-6,10]) CPU times:

Re: [sage-support] benchmarking 2D numerical integration

2010-04-19 Thread William Stein
On Mon, Apr 19, 2010 at 12:15 AM, wb torree...@yahoo.com wrote: I've tried to do timing of simple 2D integrals using sage/mpmath vs. mathematica. Example: === sage: version() 'Sage Version 4.3.3, Release Date: 2010-02-21' sage: %time

[sage-support] Undo function not working properly?

2010-04-19 Thread John Cremona
For the first time, I just tried using the Undo function on a worksheet since I had messed something up. But all the revisions I was offered, even those from a day ago, look the same as the current version! This is 4.3.5 running on a 64-bit ubuntu server. I have found it very useful that my

[sage-support] reset()

2010-04-19 Thread bb
I have some problem with reset(): sage: reset() sage: x x sage: a --- NameError Traceback (most recent call last) /home/bb/sage-4.3.5/local/lib/python2.6/site-packages/sage/all_cmdline.pyc

[sage-support] Re: reset()

2010-04-19 Thread Harald Schilly
On Apr 19, 11:36 am, bb bblo...@arcor.de wrote: There is magically declared a variable x, even after each reset()? Is this a feature or a bug? Short answer: feature ;) (and there are also other magically declared variables, like RDF ...) H -- To post to this group, send email to

[sage-support] Conversion from number field to polynomial

2010-04-19 Thread samuele.anni
Hello, I'm trying to implement an algorithm for complete my thesis work about congruence between modular forms and Galois representation. A step of the algorithm I am working on consists in replacing a generator of the number field with a fixed value obtained, clearly the command substitute cannot

[sage-support] Re: Conversion from number field to polynomial

2010-04-19 Thread luisfe
On 19 abr, 12:07, samuele.anni samuele.a...@gmail.com wrote: Hello, I'm trying to implement an algorithm for complete my thesis work about congruence between modular forms and Galois representation. A step of the algorithm I am working on consists in replacing a generator of the number

Re: [sage-support] Re: reset()

2010-04-19 Thread bb
Harald Schilly schrieb: On Apr 19, 11:36 am, bb bblo...@arcor.de wrote: There is magically declared a variable x, even after each reset()? Is this a feature or a bug? Short answer: feature ;) (and there are also other magically declared variables, like RDF ...) H Tnx! Is

Re: [sage-support] Re: Conversion from number field to polynomial

2010-04-19 Thread Samuele Anni
Thank you very much, it woks perfectly. Samuele 2010/4/19 luisfe lftab...@yahoo.es: On 19 abr, 12:07, samuele.anni samuele.a...@gmail.com wrote: Hello, I'm trying to implement an algorithm for complete my thesis work about congruence between modular forms and Galois representation. A step

Re: [sage-support] Re: reset()

2010-04-19 Thread Alex Ghitza
On Mon, 19 Apr 2010 13:09:34 +0200, bb bblo...@arcor.de wrote: Tnx! Is there any explanation why the magic ends with del ? sage: del x sage: x --- NameError Traceback (most recent call

Re: [sage-support] Re: reset()

2010-04-19 Thread bb
Alex Ghitza schrieb: On Mon, 19 Apr 2010 13:09:34 +0200, bb bblo...@arcor.de wrote: Tnx! Is there any explanation why the magic ends with del ? sage: del x sage: x --- NameError

[sage-support] Re: Vector solutions, a basic question.

2010-04-19 Thread Jason Grout
On 04/16/2010 03:46 PM, Alec Mihailovs wrote: On Apr 16, 4:01 pm, Alexander Shyrokovsjc...@gmail.com wrote: I have derived the equation, which looks like this: ((T - (E -T) *(H.dot(N) - T.dot(N))/(E - T).dot(N) - H) / S) == Mp I'll take a look at it later. But in general, if you have a

[sage-support] Re: Saving 3D plots

2010-04-19 Thread kcrisman
Dear Dox, I don't know that you can do it via Jmol, but perhaps via Tachyon. sage: sage.plot.plot3d.tachyon? I imagine that looking more in depth at the Tachyon documentation (not just the result of the above command) might help you more. I am sorry that I don't know the answer to this,

[sage-support] Sage/Maxima desolve_rk4 problem

2010-04-19 Thread jvkersch
Hi all, Technically, this is not a Sage problem, but I figured I would post it here anyway since others might have run into the same problem, and I'm also trying to solve the problem using some Sage/python trickery. The problem concerns the use of symbolic constants such as pi in numerical

[sage-support] allocation in a list?

2010-04-19 Thread bb
sage: x=[a=5, a+=5, a-=3, a*=5, a/=8] File ipython console, line 1 x=[a=Integer(5), a+=Integer(5), a-=Integer(3), a*=Integer(5), a/=Integer(8)] ^ SyntaxError: invalid syntax sage: x=[1,2+5,3] sage: x [1, 7, 3] sage:

Re: [sage-support] allocation in a list?

2010-04-19 Thread bb
bb schrieb: sage: x=[a=5, a+=5, a-=3, a*=5, a/=8] File ipython console, line 1 x=[a=Integer(5), a+=Integer(5), a-=Integer(3), a*=Integer(5), a/=Integer(8)] ^ SyntaxError: invalid syntax sage: x=[1,2+5,3] sage: x [1, 7,

Re: [sage-support] allocation in a list?

2010-04-19 Thread Martin Albrecht
On Monday 19 April 2010, bb wrote: sage: x=[a=5, a+=5, a-=3, a*=5, a/=8] This is really a question about Python syntax, but here's a way: sage: a= 5 sage: x = [a,a+5,a-3,a/8] Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99 _otr:

Re: [sage-support] allocation in a list?

2010-04-19 Thread Alex Leone
In python, assignment is a statement, not an expression (it has no return value). This is unlike many other programming languages, such as C: if ( (r = result()) == 3) { // do something with r } In python: (a = 10) + 2 File stdin, line 1 (a = 10) + 2 ^ SyntaxError: invalid syntax

[sage-support] Re: Hensel lifting

2010-04-19 Thread John Cremona
A3(list(P)) works here -- answering the easier of your two questions! John Cremona On Apr 19, 2:33 am, vdelecroix 20100.delecr...@gmail.com wrote: Hello, I'm trying to implement an algorithm for factorization of bivariate polynomials. A step of the algorithm is Hensel lifting and I was not

[sage-support] Re: How convert sage matrix to numpy array?

2010-04-19 Thread Bastian Weber
Hi Minh, Minh Nguyen wrote: (Where should I have looked in the documentation to find out by myself?, Maybe there are more useful hints.) The numpy() method you are referring to is in the file SAGE_ROOT/devel/sage-main/sage/matrix/matrix_real_double_dense.pyx Thanks for that hint.

[sage-support] Re: Hensel lifting

2010-04-19 Thread Simon King
Hi! On 19 Apr., 03:33, vdelecroix 20100.delecr...@gmail.com wrote: My two attempts were the followings {{{ sage: K.t = PolynomialRing(QQ,'t') sage: A2 = QuotientRing(K, Ideal(t^2)) sage: A3 = QuotientRing(K, Ideal(t^3)) sage: P = A2(t^4 + 3*t + 1) }}} First method: try to coerce {{{

[sage-support] Re: Sage/Maxima desolve_rk4 problem

2010-04-19 Thread Robert Dodier
Looks like the rk function in Maxima doesn't try hard enough to float-ify its argument. I haven't looked at the code, but maybe rk can call COERCE-FLOAT-FUN to construct a function to evaluate the expression. At least that would bring it into line with other Maxima functions which evaluate

[sage-support] power function with runtime error

2010-04-19 Thread bb
sage: 2^3^4^5 --- RuntimeError Traceback (most recent call last) /home/bb/sage-4.3.5/ipython console in module() /home/bb/sage-4.3.5/local/lib/python2.6/site-packages/sage/rings/integer.so in

Re: [sage-support] power function with runtime error

2010-04-19 Thread bb
bb schrieb: sage: 2^3^4^5 --- RuntimeError Traceback (most recent call last) /home/bb/sage-4.3.5/ipython console in module()

Re: [sage-support] power function with runtime error

2010-04-19 Thread Mike Hansen
On Mon, Apr 19, 2010 at 11:52 AM, bb bblo...@arcor.de wrote: I get a runtime error, but just would expect infinity! Is there something wrong or any explanation? This is because when you do 2^3^4^5 you are computing that number exactly as an integer, and that number is definitely not infinity.

[sage-support] list vs. integer instances

2010-04-19 Thread wb
coming from C I'm confused about this behavior in assignment: 1) using only integers -- sage: a=2 sage: b=2 sage: b=b+a sage: b 4 sage: a 2 so (at least), after b=b+a, 'b' seems to have gotten its own instance, however 2) using lists

[sage-support] Re: sage 4.3.4 or 4.3.5 on solaris sparc

2010-04-19 Thread adrian
IT WORKED!!! I just heard from the systems administrator, and the problem was, indeed, the path to the gcc libraries. Everything works so far. Thank you very much for your patience and prompt answer. -Adrian. On Apr 2, 1:58 pm, Dr. David Kirkby david.kir...@onetel.net wrote: adrian wrote:

[sage-support] Re: list vs. integer instances

2010-04-19 Thread D. Monarres
Here is the way that I do this when I want copy vs reference for lists. a = [1,2] b = a[:] b[0] = a[0] + b[0] b [2, 2] a [1, 2] the a[:] does a copy of the list while a=b creates a reference. It is a little hard to get used to at first. On Apr 19, 2:50 pm, wb torree...@yahoo.com wrote:

Re: [sage-support] list vs. integer instances

2010-04-19 Thread Robert Bradshaw
On Apr 19, 2010, at 2:50 PM, wb wrote: coming from C I'm confused about this behavior in assignment: Since you know C, it may make sense to think of lists as being similar to pointers. 1) using only integers -- sage: a=2 sage: b=2 sage: b=b+a sage: b 4

[sage-support] Re: list vs. integer instances

2010-04-19 Thread wb
On Apr 20, 12:25 am, Robert Bradshaw rober...@math.washington.edu wrote: On Apr 19, 2010, at 2:50 PM, wb wrote: coming from C I'm confused about this behavior in assignment: Since you know C, it may make sense to think of lists as being similar   to pointers. that makes sense - I guess

[sage-support] Re: How convert sage matrix to numpy array?

2010-04-19 Thread Jason Grout
On 04/19/2010 12:58 PM, Bastian Weber wrote: The question is: Where should I have found the information about the existence of .numpy? And where will the next one with that problem find it? Is there something like the scipy cookbook for sage where this could be added? In Sage, you can use

[sage-support] Re: How convert sage matrix to numpy array?

2010-04-19 Thread Jason Grout
On 04/16/2010 05:41 AM, Bastian Weber wrote: Hi, what is the proper way to convert a sage matrix to a numpy 2d-array? The obvious way, i.e. a=np.array(matrix([3 4])) produces a 0d-array (thus a.shape is an empty tuple) which is not what I want. To answer your original question, I think

[sage-support] Re: How convert sage matrix to numpy array?

2010-04-19 Thread Jason Grout
On 04/19/2010 07:18 PM, Jason Grout wrote: On 04/16/2010 05:41 AM, Bastian Weber wrote: Hi, what is the proper way to convert a sage matrix to a numpy 2d-array? The obvious way, i.e. a=np.array(matrix([3 4])) produces a 0d-array (thus a.shape is an empty tuple) which is not what I want.

Re: [sage-support] Is there any way to get old VMware versions?

2010-04-19 Thread William Stein
On Sat, Apr 3, 2010 at 4:08 PM, Rob furit...@gmail.com wrote: I've officially given up on ever getting VirtualBox to work properly on my netbook (I'm pretty sure it's just a memory issue), so I'd like to go back to the last VMware version (4.1.2, I guess). I can find where to find the source