[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
Hi Andrew! On Sep 2, 6:56 pm, andrew ewart aewartma...@googlemail.com wrote: ... degx= f.degree(z1) degy= f.degree(z2) degree=2*degx*degy ...           for q in xrange(0,degree+1):                 for ja in range(0,degx):                    

[sage-support] plot 3d complex function

2010-09-03 Thread sps
Can I have a 3d plot graph about a complex funtion in sage? For example: f(z)=abs(1/(z-z0))? I've just tried by the function complex_plot but output is 2d graph! What command I have to use? Thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this

[sage-support] netcdf error in sage-4.5.2

2010-09-03 Thread samrat
Hi, I am using CentOS 5.5 x86_86. I've managed to successfully compile sage-4.5.2. Now i wish to add netcdf capabilities to sage. So as instructed in the python version of netcdf -- netCDF4-0.9.1 --- i have installed the dependencies hdf5, szip and netcdf-4.1.1. On running sage -python setup.py

Re: [sage-support] Re: rexpression of lists

2010-09-03 Thread andrew ewart
want i want to compute is a vector for each power of ad^j that lists all the coefficients wrt t and y which will have length at most (degree+1)*degx of course if it is shorter i want to stick 0's on the end until i get to this length -- To post to this group, send email to

Re: [sage-support] Re: rexpression of lists

2010-09-03 Thread andrew ewart
so for ad^0 i should get out [1,0,0,0,0,...,0] -- 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 URL:

[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
Hi Andrew! On Sep 3, 12:28 pm, andrew ewart aewartma...@googlemail.com wrote: so for ad^0 i should get out [1,0,0,0,0,...,0] What you can use is padded_list! Example: sage: R.x=QQ[] sage: p = R.random_element() sage: p 3/4*x^2 + 1/2*x - 1 sage: p.padded_list(5) [-1, 1/2, 3/4, 0, 0] The

Re: [sage-support] Re: rexpression of lists

2010-09-03 Thread andrew ewart
finally getting somewhere now get this output [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0] [0, 0] [0, 0] [0, 0] [0, 0] [0, 0] [0, 0] [0, 0] [0, 0] [t, 0, t, 0, 2*t, 0, 3*t, 0, 0] [0, 1] [0, 0] [0, 1] [0, 0] [0, 2] [0, 0] [0, 3] [0, 0] [0, 0] this is very close all i want to do is now join each collection

[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
On Sep 3, 1:42 pm, andrew ewart aewartma...@googlemail.com wrote: ... this is very close all i want to do is now join each collection of lists together so get outputs [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] and [0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0] thoughts?

[sage-support] Graphs and flows

2010-09-03 Thread ma...@mendelu.cz
Dear sage support trying to learn how to use Sage in graph theory. I do not know the terminology in this area of mathematics. Is the flow and the edge_cut the two quantities which are equal by ford fulkerson theorem http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem ? I consider the following

[sage-support] Re: Graphs and flows

2010-09-03 Thread ma...@mendelu.cz
On 3 zář, 15:54, ma...@mendelu.cz ma...@mendelu.cz wrote: Dear sage support trying to learn how to use Sage in graph theory. I do not know the terminology in this area of mathematics. Is the flow and the edge_cut the two quantities which are equal by ford fulkerson

[sage-support] Re: line and RDF.restric_angle

2010-09-03 Thread Sébastien Barthélemy
This is a matplotlib bug which has nothing to do with sage. I filed a bug: https://sourceforge.net/tracker/?func=detailaid=3058804group_id=80706atid=560720 and emailed them: http://sourceforge.net/mailarchive/message.php?msg_name=AANLkTimVZgO_e6iYvQpcCA4JDaxwjuWLvg-yJSXjW%3DCO%40mail.gmail.com

[sage-support] Re: plot 3d complex function

2010-09-03 Thread kcrisman
Yes, complex_plot is similar to a Mathematica function of the same type. To plot such a function the way you are indicating, we need to have the fast_float/fast_callable functions which do (very fast, as the name indicates) evaluation of functions to be plotted to work with complex input. This

[sage-support] Re: Where can I find the Windows VirtualBox version of Sage?

2010-09-03 Thread Niko
Thanks Seb. I actually ran the VMWare installation in the end but I'm sure the guide you wrote below will prove helpful to others that find themselves similarly confused. Cheers. On Aug 29, 7:10 am, Seb Taylor pruvit2me...@gmail.com wrote: hey nick, i too am a complete newbie to this sage/

Re: [sage-support] Re: plot 3d complex function

2010-09-03 Thread Eckhard Kosin
Am Freitag, den 03.09.2010, 07:58 -0700 schrieb kcrisman: Yes, complex_plot is similar to a Mathematica function of the same type. To plot such a function the way you are indicating, we need to have the fast_float/fast_callable functions which do (very fast, as the name indicates)

[sage-support] Implication

2010-09-03 Thread tvn
Hi, I wonder if there's any 'imply' kind of function in Sage ? For example eq1 = x -y == 0 eq2 = x^2 - y^2 == 0 eq1 implies eq2(but not the other way around). If no then is there any efficient way to do it ?one way I can think of (that might not work) is get the factor_list of eq1

[sage-support] Re: plot 3d complex function

2010-09-03 Thread kcrisman
On Sep 3, 11:56 am, Eckhard Kosin e...@mathematik-service-kosin.de wrote: Am Freitag, den 03.09.2010, 07:58 -0700 schrieb kcrisman: Yes, complex_plot is similar to a Mathematica function of the same type. To plot such a function the way you are indicating, we need to have the

[sage-support] Nested if statements inside sum

2010-09-03 Thread Kim
Hi, I want to make a function for a sum that has two different options for each term, depending on a condition. E.g. F(m) = sum(n=1, 10, if( m*n0, m*n+2, m*n+8)) How do I put the else if m*n0 then m*n+8 into the Sage statement: sum( m*n +2 for n in range(1,10) if m*n0 ) ? Thank you Kim --

Re: [sage-support] Nested if statements inside sum

2010-09-03 Thread Mike Hansen
One option is: sage: def F(m): :return sum([(m*n+2 if m*n 0 else m*n+8) for n in range(1, 10)]) sage: F(2) 162 sage: F(-2) -72 --Mike -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

[sage-support] Number of CPUs?

2010-09-03 Thread Simon King
Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but: 1) each computation uses 3 processes (Sage, GAP, Singular) 2) it is probably not nice to other users if parallel computation uses all available CPUs. I'd

[sage-support] Re: Graphs and flows

2010-09-03 Thread Nathann Cohen
Btw, I observed that converting to undirected graph gives the same edge_cut, 31. Does edge_cut assume implicitly that the graph is undirected? No, it has two behaviours depending on the type of Graph. I am trying to find out where it comes from, but for the moment I am a bit stuck O_o What I

[sage-support] Re: Implication

2010-09-03 Thread Jason Bandlow
Hello, For polynomial equations, the following should work in general. sage: R.x,y = CC['x','y'] sage: f = x-y sage: g = x^2 - y^2 sage: I = R.ideal([f]).radical() sage: g in I True In general, to see if the equation g == 0 is implied by the equations f1==0, f2==0, ..., fn==0 you can do I =

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi! I guess I can answer the question about number of cpus myself (google was my friend, after all...): import multiprocessing multiprocessing.cpu_count() However, I'd appreciate to get an answer to the sage -t question. Cheers, Simon -- To post to this group, send email to

[sage-support] Re: Number of CPUs?

2010-09-03 Thread John H Palmieri
On Sep 3, 10:47 am, Simon King simon.k...@nuigalway.ie wrote: Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but:   1) each computation uses 3 processes (Sage, GAP, Singular)   2) it is probably not nice to

Re: [sage-support] Number of CPUs?

2010-09-03 Thread didier deshommes
On Fri, Sep 3, 2010 at 12:47 PM, Simon King simon.k...@nuigalway.ie wrote: Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but:  1) each computation uses 3 processes (Sage, GAP, Singular)  2) it is probably not

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi Didier and John! On 3 Sep., 20:02, didier deshommes dfdes...@gmail.com wrote: Besides, a while ago I asked how one can execute the sage test script on a string, *without* saving that string into a file and *without* forking a sage -t subprocess. Do you see a way? Sounds like you want

[sage-support] Re: Graphs and flows

2010-09-03 Thread Nathann Cohen
I'll post a followup to this thread when I will have found the cause :-) I re-read thirty times the code and even tried to debug the LP solver themselves. It went easier when I had the smart idea to read what was written and not what I intended to write. The line :

[sage-support] Re: Implication

2010-09-03 Thread JamesHDavenport
On Sep 3, 6:56 pm, Jason Bandlow jband...@gmail.com wrote: For polynomial equations, the following should work in general. sage: R.x,y = CC['x','y'] sage: f = x-y sage: g = x^2 - y^2 sage: I = R.ideal([f]).radical() sage: g in I True In general, to see if the equation g == 0 is implied

[sage-support] Re: Implication

2010-09-03 Thread Simon King
Hi! On 3 Sep., 21:37, JamesHDavenport j.h.davenp...@bath.ac.uk wrote: On Sep 3, 6:56 pm, Jason Bandlow jband...@gmail.com wrote: For polynomial equations, the following should work in general. sage: R.x,y = CC['x','y'] sage: f = x-y sage: g = x^2 - y^2 sage: I = R.ideal([f]).radical()

[sage-support] Re: plot 3d complex function

2010-09-03 Thread Marshall Hampton
Here's a slightly different workaround that doesn't require any lambda expressions: var('z,z0,x,y') f=abs(1/(z-z0)).subs({z:x+I*y,z0:1/2+i}) ff = fast_callable(f,vars=[x,y],domain=CDF) plot3d(ff,(x,-2,2),(y,-2,2)) -Marshall -- To post to this group, send email to sage-support@googlegroups.com

Re: [sage-support] Re: Number of CPUs?

2010-09-03 Thread Dr. David Kirkby
On 09/ 3/10 07:00 PM, John H Palmieri wrote: On Sep 3, 10:47 am, Simon Kingsimon.k...@nuigalway.ie wrote: I'd like to restrict @parallel(ncpus=...), where ... is something like 1/2 (or 1/3?) of the available CPUs. But how can I determine this number? From sage (or python): sage:

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi David! On 4 Sep., 01:01, Dr. David Kirkby david.kir...@onetel.net wrote: Be aware, that for hyperthreaded machines, the number of CPUs may exceed the number of cores. Ah. I guess that I wanted the number of cores. If, as you say, half the CPUs is enough to occupy all resources, then I'd

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Nils Bruin
On Sep 3, 11:13 am, Simon King simon.k...@nuigalway.ie wrote: Probably not. I guess what I am asking is whether the functionality of the sage-test script is available as a function that can be imported into sage. Since up to now no-one seems to be able to answer that question, I'll speculate.

Re: [sage-support] Number of CPUs?

2010-09-03 Thread Robert Bradshaw
On Fri, Sep 3, 2010 at 10:47 AM, Simon King simon.k...@nuigalway.ie wrote: Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but:  1) each computation uses 3 processes (Sage, GAP, Singular)  2) it is probably not

Re: [sage-support] Re: Number of CPUs?

2010-09-03 Thread Dr. David Kirkby
On 09/ 4/10 12:10 AM, Simon King wrote: Hi David! On 4 Sep., 01:01, Dr. David Kirkbydavid.kir...@onetel.net wrote: Be aware, that for hyperthreaded machines, the number of CPUs may exceed the number of cores. Ah. I guess that I wanted the number of cores. If, as you say, half the CPUs is

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi David, On 4 Sep., 01:53, Dr. David Kirkby david.kir...@onetel.net wrote: Is SAGE_NCPUS used anywhere? Well, I was not suggesting to introduce an environment variable that is used anywhere in Sage except to tame my test script. Of course, if there already is an environment variable that

Re: [sage-support] Number of CPUs?

2010-09-03 Thread didier deshommes
On Fri, Sep 3, 2010 at 12:47 PM, Simon King simon.k...@nuigalway.ie wrote: Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but:  1) each computation uses 3 processes (Sage, GAP, Singular)  2) it is probably not

Re: [sage-support] Re: Number of CPUs?

2010-09-03 Thread didier deshommes
On Fri, Sep 3, 2010 at 8:01 PM, Simon King simon.k...@nuigalway.ie wrote: Hi David, On 4 Sep., 01:53, Dr. David Kirkby david.kir...@onetel.net wrote: Is SAGE_NCPUS used anywhere? Well, I was not suggesting to introduce an environment variable that is used anywhere in Sage except to tame my

[sage-support] Factoring denominator of a rational function

2010-09-03 Thread Cary Cherng
I have a rational function P(x)/Q(x) with numerators and denominators of very large degree. From the context I know that a certain polynomial p(x) should divide the denominator. If I multiply the numerator by p(x) giving p(x)*P(x)/Q(x) how do I get sage to cancel p(x) with the factor in Q(x)? In