[sage-support] Test if p(x) is in a ring generated by polynomials

2010-09-07 Thread Cary Cherng
I am not familiar with algebraic geometry or its terminology and new to sage. p_1,...p_n and q are elements of Z[x_1,...,x_n]. In my context I have some evidence that q can be written as something like q = p_1*p_2 + ... + p_5*p_6. In other words q is a degree 2 polynomial in the p_i's. Can Sage fi

[sage-support] Re: Graphics3d Object face_list()

2010-09-07 Thread TeamTeamUSA
It seems as if the the Graphics3d Object's face_list() returns a list of 3-tuples or 4-tuples depending upon which plot3d method you call: implicit_plot3d - returns an array of 3-tuples [[(1.8974358974358974, -0.5641025641025641, -0.28205128205128216), (1.9014844804318489, -0.5641025641025641, -0.

[sage-support] Re: Testing if polynomial is in ideal

2010-09-07 Thread Cary Cherng
nevermind I solved my problem. On Sep 7, 5:49 pm, Cary Cherng wrote: > This works but is too slow for more complicated examples. Is there a > way to speed up "x in I" for much bigger examples? Or does this > already use the fastest algorithm based on groebner basis or something > else. > > On Sep

[sage-support] Re: Problem doing symbolic computations (bug in Pynac ?)

2010-09-07 Thread kcrisman
On Sep 7, 5:26 pm, Burcin Erocal wrote: > Hi, > > Here is a short example to replicate the first error mentioned below: > > b = [var('b_%s'%i) for i in range(4)] > > precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) > - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) -

[sage-support] Re: Testing if polynomial is in ideal

2010-09-07 Thread Cary Cherng
This works but is too slow for more complicated examples. Is there a way to speed up "x in I" for much bigger examples? Or does this already use the fastest algorithm based on groebner basis or something else. On Sep 6, 9:22 pm, Alex Ghitza wrote: > On Mon, 6 Sep 2010 20:42:43 -0700 (PDT), Cary C

[sage-support] Re: Disappearing notebook

2010-09-07 Thread Innigo
Now I've added $SAGE_ROOT to my PATH and exported SAGE_ROOT and it echo's OK but yea, verily it doth appear at this stage that every morning I'll have to do: $sage -i sagenb Off it goes Extracting package from /home/me -rw-r--r-- ... spkg/standard/sagenb-0.8.2.spkg tar: This does not look like

[sage-support] Re: installation of Sage

2010-09-07 Thread Innigo
Is it possilbe it's just because "the sage install tree may have moved"? There seems to be a fair few import errors and a lot not found. Suse 11 should have the latest gcc shouldn't it? It's not just a permissions or $PATH thing? Apologies in advance if this is naively hopeful. -- To post to this

Re: [sage-support] Problem doing symbolic computations (bug in Pynac ?)

2010-09-07 Thread Burcin Erocal
Hi, Here is a short example to replicate the first error mentioned below: b = [var('b_%s'%i) for i in range(4)] precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9) + (2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) -

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread Jason Grout
On 9/7/10 4:04 PM, Nils Bruin wrote: On Sep 7, 1:34 pm, tvn wrote: Hi John and Jason, thanks -- the inject_variables() did what I want. I have another question below and hope you can help what if I already have create a function call f = x - y as below sage: vs = var('x y') sage: f = x -

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread tvn
Nils, thanks -- I think I was able to do what I want using your code snippet def foo(f1,f2,vs): R = PolynomialRing(QQ,vs) f1_ = R(f1) f2_ = R(f2) I = R*[f1_] G = I.radical().groebner_basis() res = f2_.reduce(G) return res == 0 On Sep 7, 3:04 pm, Nils Bruin wrote

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread Nils Bruin
On Sep 7, 1:34 pm, tvn wrote: > Hi John and Jason,  thanks  --  the inject_variables() did what I > want. > > I have another question below and hope you can help > > what if I already have create a function call f = x - y as below > > sage: vs = var('x y') > sage: f = x - y > sage: type(f) > The

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread tvn
There's still one type error about parent mismatch in my code. Basically I want to write a function foo like below def foo(f1,f2,vs): R = PolynomialRing(QQ,vs) f1_ = f1.polynomial(QQ) f2_ = f2.polynomial(QQ) I = R*[f1_] G = I.radical().groebner_basis() res = f2_.reduce(G

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread tvn
ah thanks much -- I also just found it by just trial and error. On Sep 7, 2:39 pm, Jason Grout wrote: > On 9/7/10 3:34 PM, tvn wrote: > > > > > > > Hi John and Jason,  thanks  --  the inject_variables() did what I > > want. > > > I have another question below and hope you can help > > > what if

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread Jason Grout
On 9/7/10 3:34 PM, tvn wrote: Hi John and Jason, thanks -- the inject_variables() did what I want. I have another question below and hope you can help what if I already have create a function call f = x - y as below sage: vs = var('x y') sage: f = x - y sage: type(f) now I want to conve

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread tvn
Hi John and Jason, thanks -- the inject_variables() did what I want. I have another question below and hope you can help what if I already have create a function call f = x - y as below sage: vs = var('x y') sage: f = x - y sage: type(f) now I want to convert f to sage.rings.polynomial.mu

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread Jason Grout
On 9/7/10 12:47 PM, tvn wrote: Hi, given a list of variable names as strings (e.g., l = ['a','b','c','d']) I try to make those become variables in a Polynomial Ring. One way is to do something like R.=CC['a','b','c','d'] , after this the type of a or b or c or d is . How can I do this in a

[sage-support] Re: creating variables in Polynomial Ring

2010-09-07 Thread John H Palmieri
On Sep 7, 10:47 am, tvn wrote: > Hi, given a list of variable names as strings (e.g.,  l = > ['a','b','c','d'])  I try to make those become variables in a > Polynomial Ring.  One way is to do something like > R.=CC['a','b','c','d'] ,  after this the type of a or b or c > or d is   'sage.rings.poly

[sage-support] creating variables in Polynomial Ring

2010-09-07 Thread tvn
Hi, given a list of variable names as strings (e.g., l = ['a','b','c','d']) I try to make those become variables in a Polynomial Ring. One way is to do something like R.=CC['a','b','c','d'] , after this the type of a or b or c or d is . How can I do this in a more automatic way that can tak

Re: [sage-support] Computing the Galois group of a degree 12 polynomial

2010-09-07 Thread William Stein
On Tue, Sep 7, 2010 at 6:55 AM, pgdoyle wrote: > I tried using Sage to compute the Galois group of a polynomial of > degree 12, using the following code: > > p= -98298717579910546875000 + > 36091888356881423583984375* x - > 1193313058398713452148437500* x^2 + 75475954392871

[sage-support] Re: Text in plot3d

2010-09-07 Thread kcrisman
Maybe this should be more prominent. http://www.sagemath.org/doc/reference/plot3d.html is not so hot, http://www.sagemath.org/doc/reference/sage/plot/plot3d/examples.html is worse, and both are sad compared to http://www.sagemath.org/doc/reference/sage/plot/plot.html . Doing so is now http://t

Re: [sage-support] Re: function correlation

2010-09-07 Thread Justin C. Walker
On Sep 7, 2010, at 08:57 , andrew ewart wrote: ah found why got that missed brqacket on end of g.unit() now by using g.factor how do i express the factors of a polynomial in a list eg g=x^2+x g.factor= x(x+1) so want something that does list(g) giving output [x,x+1] g.factor() returns someth

[sage-support] Re: Text in plot3d

2010-09-07 Thread Jason Grout
On 9/7/10 11:04 AM, Dan Aldrich wrote: OK, this should be simple enough, but haven't found a way to add some text to simple 3d plot: f(x,y) = x^2 + y^2 plot3d(f, (x,-10,10), (y,-10,10)) sage: f(x,y)=x^2+y^2 sage: p=plot3d(f,(x,-10,10),(y,-10,10)) sage: p+text3d('hi',(1,1,1)) Jason -- To po

[sage-support] Text in plot3d

2010-09-07 Thread Dan Aldrich
OK, this should be simple enough, but haven't found a way to add some text to simple 3d plot: f(x,y) = x^2 + y^2 plot3d(f, (x,-10,10), (y,-10,10)) Any suggestions? Thanks, -d -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

Re: [sage-support] Re: function correlation

2010-09-07 Thread andrew ewart
ah found why got that missed brqacket on end of g.unit() now by using g.factor how do i express the factors of a polynomial in a list eg g=x^2+x g.factor= x(x+1) so want something that does list(g) giving output [x,x+1] > > -- To post to this group, send email to sage-support@googlegroups.com T

Re: [sage-support] Re: function correlation

2010-09-07 Thread andrew ewart
when i try that i get these errors Traceback (most recent call last): File "quickfact2.py", line 21, in ef=poly_ran() File "quickfact2.py", line 13, in poly_ran if g[_sage_const_0 ][_sage_const_0 ]*g.unit==f: File "element.pyx", line 1436, in sage.structure.element.RingElement.__mul_

[sage-support] Re: function correlation

2010-09-07 Thread Jason Grout
On 9/7/10 9:36 AM, andrew ewart wrote: ef is the resultant of poly_ran Ah. So you need to make that assignment (outside of the function): ef=polyran() quickfactor(ef) or even shorter: quickfactor(polyran()) Note that the ef defined inside of polyran is local to that function; it is not v

Re: [sage-support] Re: function correlation

2010-09-07 Thread andrew ewart
ef is the resultant of poly_ran -- 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: http://www.sagemat

[sage-support] Re: function correlation

2010-09-07 Thread Jason Grout
On 9/7/10 9:19 AM, andrew ewart wrote: code S=GF(5) R.=PolynomialRing(S, 2, "z") T.=PolynomialRing(S) def poly_ran(): ef=R(1) eye=0 if eye<10: f=R.random_element() g=f.factor(proof=false) if g[0][0]*g.unit==f: ef=ef*f eye=eye+1

Re: [sage-support] Re: function correlation

2010-09-07 Thread andrew ewart
code S=GF(5) R.=PolynomialRing(S, 2, "z") T.=PolynomialRing(S) def poly_ran(): ef=R(1) eye=0 if eye<10: f=R.random_element() g=f.factor(proof=false) if g[0][0]*g.unit==f: ef=ef*f eye=eye+1 else: eye=eye else:

[sage-support] Re: function correlation

2010-09-07 Thread Jason Grout
On 9/7/10 8:52 AM, andrew ewart wrote: suppose i have a funciton def_f1(f) f=2 return f how do i then make the output f the input of a antother function def_eg1(f) g=f^2 return g as at the moment its telling me that f isnt defined Can you include a complete code

[sage-support] Computing the Galois group of a degree 12 polynomial

2010-09-07 Thread pgdoyle
I tried using Sage to compute the Galois group of a polynomial of degree 12, using the following code: p= -98298717579910546875000 + 36091888356881423583984375* x - 1193313058398713452148437500* x^2 + 754759543928715527343750* x^3 + 1582754650853547656250* x^4 - 364

[sage-support] function correlation

2010-09-07 Thread andrew ewart
suppose i have a funciton def_f1(f) f=2 return f how do i then make the output f the input of a antother function def_eg1(f) g=f^2 return g as at the moment its telling me that f isnt defined -- To post to this group, send email to sage-support@googlegroups.com To unsub

[sage-support] Re: showing multiple polygons

2010-09-07 Thread kcrisman
Without more specific information, it's hard to say, but it's almost certain that you could use a loop structure to do this. Also, I often do G = Graphics() # makes empty graphic G += polygon(...) G += polygon(...) G += plot(...) G += plot_slope_field(...) show(G) or something like that, which a

[sage-support] Re: netcdf error in sage-4.5.2

2010-09-07 Thread samrat
Hi, Thanks for your replies. No one replied for a couple of days and so i thought that it would remain status quo. So - well - i compiled netcdf-4.1.1 with the -fPIC flag. As you said netcdf-4.1.1 does not have the default compile time option of shared libs being built. Enabling build of shared li

[sage-support] Re: EllipticCurve_from_plane_curve (y^2=Quartic to Weierstass Elliptic Curve form)

2010-09-07 Thread John Cremona
You did not say what your difficulty actually was, but let me guess. At present this functionality is provided in Sage *only* by calling Magma, and that will only work if you have Magma (which is not free!) installed on your machine. Secondly, I believe that it has only been implemented for plane