[sage-support] Complex exp() and abs() inside a plot function

2010-10-25 Thread Dawes, Andrew M.
I have noticed unexpected behavior when trying to take the absolute value of a complex exponential (e^{i\theta}). For example, the following command fails with "unable to simplify to float approximation": plot(abs(exp(i*pi*x)),x,0,3) However, the following gives the correct plot (of constant val

[sage-support] problems installing mayavi2/ets

2010-10-25 Thread Jorge E . ´Sanchez Sanchez
Dear Jaap, I have made an ETS-3.5.0-20101024.p0.spkg (I've just modified the spkg-install, and every setup.cfg and setup.py for each one of the functions according to the ones you have in the ETS-3.2 spkg), everything compiles OK, but at the end I get this message: ===

[sage-support] Re: magma to SAGE

2010-10-25 Thread Jason Grout
On 10/25/10 11:32 AM, andrew ewart wrote: f = z*x^3+x*y^3+y*z^3; H = f.diff(2) If you can just treat f as a symbolic polynomial, you can use the symbolic expressions to compute the hessian. Here are several ways to do this: sage: f(x,y,z) = z*x^3+x*y^3+y*z^3 # note this makes x,y,z sym

[sage-support] snappy install on sage in ubuntu 10.10

2010-10-25 Thread hypermonkey2
Hi all, I recently tried to install sage in ubuntu 10.10 (no problems), and then I tried to install the latest version of SnapPy. Following the instructions, at the setup.py install step, i get the following error when trying to build the snappy.CyOpenGL extension: building 'snappy.CyOpenGL' ex

[sage-support] Re: polynomial constructor from roots

2010-10-25 Thread John Cremona
Andrew, Read up on resultants: sage: R.=QQ[] sage: f=x^2+a1*x+a2 sage: g=x^2+b1*x+b2 sage: f(x=y).resultant(g(x=x-y),variable=y) a1^2*b1*x + a1*b1^2*x + a1^2*x^2 + 3*a1*b1*x^2 + b1^2*x^2 + 2*a1*x^3 + 2*b1*x^3 + x^4 + a1*a2*b1 + a2*b1^2 + a1^2*b2 + a1*b1*b2 + 2*a1*a2*x + 2*a2*b1*x + 2*a1*b2*x + 2*

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Cristóvão Sousa
I made a modification so it can take 1, 3, 4, ... number of operands nicely. def symround(x, ndigits=0): if hasattr(x,'operator') and x.operator(): o = map( lambda y : symround(y,ndigits=ndigits) , x.operands() ) r = o[0] for i in xrange(1,x.nops()): r = x.operator(

[sage-support] magma to SAGE

2010-10-25 Thread andrew ewart
I want to translate the following code from magma to SAGE KK := CyclotomicField(21); ze := ep^3; RR := PolynomialRing(KK,3); PP := Proj(RR); F := z*x^3+x*y^3+y*z^3; H := 1/2*Determinant(1/3*Matrix(3,3, [Derivative(Derivative(F,RR.i),RR.j) : i in [1..3], j in [1..3]])); Flex := Points(Scheme(PP,[F,

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin, On 25 Okt., 15:26, Burcin Erocal wrote: > This initializes a list with a single element for objects which return > None for operator() now. IMHO, this approach is inefficient. In this > case, you should act on the object directly. I didnt claim that it was efficient - my code was inte

Re: [sage-support] Re: Round symbolic expressions

2010-10-25 Thread Burcin Erocal
Hi Simon, On Mon, 25 Oct 2010 06:09:16 -0700 (PDT) Simon King wrote: > On 25 Okt., 14:39, Burcin Erocal wrote: > > If we return an identity operator for these cases, how do you plan > > to test for it in your code: > > Something like this: > > L = x.operands() > if len(L)>1: > return x.op

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
PS: I know that testing "is None" is faster than "len(L)>1" and wouldn't insist that there *has* to be an identity operator. One has to consider two different cases anyway. However, if there *is* an operator, s==s.operator()(*s.operands()) should hold. Cheers, Simon -- To post to this group, s

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin! On 25 Okt., 14:39, Burcin Erocal wrote: > If we return an identity operator for these cases, how do you plan to > test for it in your code: Something like this: L = x.operands() if len(L)>1: return x.operator()(*map(lambda ..., L)) else: try: return x.operator()(round

Re: [sage-support] Re: Round symbolic expressions

2010-10-25 Thread Burcin Erocal
Hi Simon, On Mon, 25 Oct 2010 05:09:06 -0700 (PDT) Simon King wrote: > I only opened one ticket, namely #10169, aiming at making > s==s.operator()(*s.operands()) work uniformely. I don't think this makes sense for variables, numeric objects, or constants, in other words, objects for which .ope

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin, On 25 Okt., 11:04, Burcin Erocal wrote: > I suggest we raise a ValueError when there is no operator or operands. > This is already done for iterators of symbolic expressions in #7537: > > http://trac.sagemath.org/sage_trac/ticket/7537 > > Can you open a ticket to do the same for operan

Re: [sage-support] Re: Round symbolic expressions

2010-10-25 Thread Burcin Erocal
Hi Simon, On Mon, 25 Oct 2010 00:41:07 -0700 (PDT) Simon King wrote: > @symbolic experts (Burcin et al): > Is it really necessary that x.operator() returns None and x.operands() > returns []? What about an identity operator? The operator and operands don't have a meaning if you have a single va

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Cristóvão! On 25 Okt., 03:30, Cristóvão Sousa wrote: > ... > It just has a minor bug when the operator has more than two operands, > like x+y+z, but I'll try to fix it as I got the picture now. Yes, to my surprise, the "add" operator only accepts two arguments, but the list of operands of a s