[sage-support] Re: Re : slow code, what can I do?

2011-05-16 Thread Vahid
thanks a lot for help. On May 16, 12:32 pm, Nathann Cohen wrote: > > I have written a function which takes a long time to be run. How can I > > make it faster? > > That's an easy one :-) > > First, you create very *BIG* objects, and you create them "twice" each, > because you convert to a list so

[sage-support] problem with roots of cubic poly, field extension by the roots

2011-05-16 Thread zsharon
Hi, Here's the code I'm interested in using: L. = NumberField(x^3 -2*x +5) G=L.galois_group(names="b") x = var('x') eqn = x^3 - 2*x + 5 == 0 a = solve(eqn, x)[0].rhs() G.1(a) This gives an error: TypeError: -1/2*(I*sqrt(3) + 1)*(1/18*sqrt(3)*sqrt(643) - 5/2)^(1/3) + 1/3*(I*sqrt(3) - 1)/(1/18*s

[sage-support] Re: solving for x in different theory

2011-05-16 Thread Nils Bruin
On May 16, 3:10 pm, tvn wrote: > So Is it possible to force x to be in the theory of Integer so that solving > for 2*x == 1 will return Not Possible or something similar  ?   If you formulate the problem as finding the integer roots of an integer polynomial, you get what you probably want: sage:

[sage-support] Re: solving for x in different theory

2011-05-16 Thread tvn
Note: I can use SMT solver to solve such problem (though theory of integer is not decidable in general case). However just want to know if somehow I can do this in Sage since I don't want to call external SMT. -- To post to this group, send email to sage-support@googlegroups.com To unsubs

[sage-support] solving for x in different theory

2011-05-16 Thread tvn
if I have the equation 2*x == 1 , solving for x using solve(2*x==1,x) returns x == 1/2 . In other words, this equation is satisfied in the theory of rational (and others that include rational), because there exists a value x = 1/2 that makes 2*x == 1. But in a different theory, say inte

[sage-support] Re: Slow serialization of sparse array

2011-05-16 Thread Volker Braun
For the record, this was solved by serializing the sparse value dictionary m.dict() -- 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.

Re: [sage-support] Slow serialization of sparse array

2011-05-16 Thread Robert Bradshaw
Are you suer that savetxt has sparse representations? I bet it's saving a whole bunch or 0's (though the numpy list would be the place to ask for sure, and for a replacement). On Mon, May 16, 2011 at 10:29 AM, akm wrote: > Would it be expected behavior for a 26k x 26k sparse array to take more th

[sage-support] Slow serialization of sparse array

2011-05-16 Thread akm
Would it be expected behavior for a 26k x 26k sparse array to take more than two hours to serialize using numpy.savetxt on a modern Apple laptop? Thanks Andrew -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsub

[sage-support] Re: operations with images

2011-05-16 Thread kcrisman
On May 15, 9:18 am, MathLynx wrote: > Both Maple and Mathematica allow the user to move around within plots > - zooming and translating (and rotating in 3-d).  Is there any such > functionality with Sage plots?  I have already noted that one can use > a mouse to rotate 3-d plots. Jmol plots can

[sage-support] Re: serious usability problem with unsaved notebooks

2011-05-16 Thread kcrisman
> > > I keep getting notebooks that are messed up: text and formulas have been > > randomly moved around and some are missing.  I think this happens when > > closing the Sage notebook without either saving or discarding the changes. > >  I haven't changed any of the default settings.  Unfortunately

[sage-support] Re: Ppc64 debian

2011-05-16 Thread kcrisman
On May 15, 6:01 pm, Leon Swinkels wrote: > Hello everyone, > > I have a multiprocessor ppc64 system that I would like to use as a > sage server. I understand that there is no ready-to-run port for this > and I would be willing to try and construct one. At the moment I run > into some errors when

[sage-support] Finding common root of few polynomials

2011-05-16 Thread Santanu Sarkar
I have three polynomials f=x^2 + y^2 + z^2 - 1 g= x^2+2*y*z h= (y+z+2*x)^2+2*x^2 -1. I want to find the common roots in real. What should be approach in complex? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+uns

[sage-support] Need arbitrary Singular term orders

2011-05-16 Thread Jeff Stroomer
Sage Folks, I need to be able to use arbitrary Singular term orders. This showed up as a Sage bug a couple years ago: http://www.google.com/url?sa=D&q=http://trac.sagemath.org/sage_trac/ticket/5326 Do you think this might get fixed soon? I’m running Sage 4.6.2, which I think is the latest.

[sage-support] Re : slow code, what can I do?

2011-05-16 Thread Nathann Cohen
> > I have written a function which takes a long time to be run. How can I > make it faster? That's an easy one :-) First, you create very *BIG* objects, and you create them "twice" each, because you convert to a list something which is already a list (which actually copies it). Why do you

[sage-support] slow code, what can I do?

2011-05-16 Thread Vahid
Hi , I have written a function which takes a long time to be run. How can I make it faster? def urn(number,k1,delta): p = list(SetPartitions(number).list()) # set of all partitions p1 = list(SetPartitions(number,k1).list()) p2 = list(SetPartitions(number,(k1+delta)).list()) l1