Re: [sage-support] 3D plots fail using VirtualBox Sage 4.21 on old XP computer
As reported here in other threads it seems that jmol-based 3-graphics fails in FireFox under Windows XP. I am not sure if it is all configurations anv versions or only some but I do have one laptop running Windows XP and the most recent version of FireFox and this still fails with the newest version of Sage on a remote server. If this is the same problem then I am quite sure it is not a virtual machine problem. It was my understanding that someone (the original jmol developer?) was aware of and working on this problem. No? On Fri, Dec 4, 2009 at 11:59 AM, William Stein wst...@gmail.com wrote: Hi, 1) Try reducing the amount of memory allocated to the Sage Virtual machine from 512MB to 384MB. 2) Windows XP (even with only 1GB) is a very important platform for Sage, IMHO. -- William On Fri, Dec 4, 2009 at 10:21 AM, Michael Madison madison.mich...@gmail.com wrote: I am running Sage 4.2.1 on a old 1GB ram XP computer with the VirtualBox binary distribution. In the notebook if I try a 3D graph Firefox shuts down and kills the Sage session. This is the same problem I had with the VirtualBox Sage version 4.2. I have also created a separate Ubuntu 9.1 vm in VirtualBox, where I loaded all the stuff needed to run and compile Sage 4.21. This included the FireFox upgrades needed to run the 3D plots from a notebook. To this vm I added a second network connection which is a VirtualBox host only, just like in the binary VirtualBox Sage 4.21. I compiled Sage 4.21. When I run the notebook sage using the Firefox inside the Ubuntu 9.1 vm everything works great and I get 3D graphs. I can also start a Sage notebook with a IP address and access it from my Windows Firefox. This works fine until I run a 3D graph and then the windows Firefox closes down, just like in the binary distribution for VirtualBox Sage 4.21. However, if I start Firefox in Ubuntu I can get into the same sheet and run the 3D graph with no problem and Sage has not shut down. I suspect the problem with the 3D graph is from the VirtualBox host connection. I don't know if it is just because of my XP system. -- 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.sagemath.org
[sage-support] Re: noncommutative polynomials and free differential calculus
Nicholas, Its possible that Axiom's XPOLY non-commutative polynomial domain might be of some help. E.g. sage: x=axiom('x::XDistributedPolynomial(Symbol,Integer)') sage: y=axiom('y::XDistributedPolynomial(Symbol,Integer)') sage: z=axiom('z::XDistributedPolynomial(Symbol,Integer)') sage: p=2*x*y*z sage: q=z*x*y+3*z sage: pq=p*q sage: pq 2 2 6x y z + 2x y z x y sage: pq.leadingCoefficient() 2 sage: pq.leadingMonomial() 2 x y z x y sage: pq.reductum() 2 6x y z But note that XPOLY does not allow negative exponents and you would have to build the derivative operations. Implementing non-commutative Laurent polynomials in Axiom/FriCAS would not be difficult (There is already a commutative Laurent polynomial domain which can serve as a model.) Adding free derivatives would be a little more involved. If you are at all interested, please let me know. In any case, XPOLY might serve as a starting point for something similar in Sage. Regards, Bill Page. On Thu, Aug 13, 2009 at 11:39 AM, Nicholas Jacksonnicholas.jack...@warwick.ac.uk wrote: I'm trying to use SnapPy [1] to calculate Alexander polynomials of knot complements. SnapPy (which interfaces nicely with Sage) will happily give me a presentation of the fundamental group of the knot complement, and I want to take this and calculate the free derivatives of the group's relators by the recursive formula d(uv) = du + u * dv d(u^-1) = -u^-1 * du d(1) = 0 For a word w in the generators, we define the free derivative dw/dx to be the coefficient of dx in the expression for dw - this will in general be a polynomial in the (noncommuting) generators for the fundamental group. I'm having a little difficult figuring out the best way to deal with this in Sage - I need multivariate Laurent polynomials with noncommuting variables - and wondered if anyone has any recommendations. I've been trying to use a FreeAlgebra or FreeAlgebraQuotient but I'm not quite sure how to go about this. Any suggestions would be very welcome. Nicholas [1] http://www.math.uic.edu/~t3m/SnapPy/doc/ --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Handling Axiom crashes in Sage
But On Fri, Jul 24, 2009 at 6:08 AM, David D. wrote: Yes, I just downloaded the sage-vmware-4.0.1.zip file from sagemath.org, installed VMWare Player (2.5.2 build-156735), and opened sage_vmx.vmx. I would've either installed fricas simply through an install_package('fricas-1.0.3.p0') command in the Firefox session, or with a sage -i -fricas-1.0.3.p0 from the command line. So as far as I can tell he is using FriCAS built with clisp. Perhaps someone should try David's example with FriCAS built with ECL. It will probably take me a couple of days to be able to be in a position to do that. Regards, Bill Page. On Fri, Jul 24, 2009 at 10:43 AM, William Steinwst...@gmail.com wrote: On Fri, Jul 24, 2009 at 1:36 AM, Martin Rubeymartin.ru...@math.uni-hannover.de wrote: If you are running longer jobs with fricas, you should consider switching to a faster lisp implementation. For FriCAS, clisp is aboutthe slowest. We don't use clisp for Sage anymore. We dumped clisp for ECL a couple of months ago. William from the INSTALL file of FriCAS: All Lisp impementations should give essentially the same functionality, however performance (speed) may differ quite a lot. On 64-bit AMD64 on average sbcl is the fastest one (7 times faster than clisp), Closure CL the second (about 2.5 times slower than sbcl), than gcl and ECL (about 3 times slower than sbcl) and clisp is the slowest one. Note: older versions of ECL were much (about 4 times) slower, you should use newest version if you care about speed. Martin -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Handling Axiom crashes in Sage
On Thu, Jul 23, 2009 at 10:25 PM, David D.wrote: Hi, I'm trying to run a simple script that basically loops through a long list of polynomials, does some things with them in Axiom, and imports the results back to Sage. I am very interested in your use of Axiom in Sage. I was beginning to think I was the only one doing this sort of thing. :-( After running for a while (60-90 minutes) it will hang with the message Axiom crashed -- automatically restarting. At this point I have to Interrupt and manually restart the loop at the point where it failed. I am not so sure about the origin of the Axiom crashed ... message but besides an actual program crash, I think it might also simply indicate a communication failure between Sage and FriCAS. There have been problems with that on some platforms in the past. I have been running a slightly modified version of your code (modified for compatibility with an older version of Sage 3.2 and Mike Hansen's patches for Axiom) on a fairly fast processor for more than 3 hours. Output from a 'print a,b,c' debugging statement currently shows: ... -8 0 3 -8 0 4 (x^4 - 8*x^3 + 4*x + 1, [2, (3*y/4 + 3*x^2/2 - 3*x/2 - 3/4)/x^2]) -8 0 5 ... -8 2 0 -8 2 1 -8 2 2 ... With no failures so far. Is there any way to catch this error automatically so I can continue processing without having to manually restart? I'd like to be able to leave it running overnight or for days at a time, and manually restarting it every hour is at best annoying. I've tested and the crash doesn't happen at any specific point in the input or even on a specific axiom command, but it does seem to occur after the same amount of time roughly (1-1.5 hours) even with different input, so I don't believe it's a coding flaw (even though that would probably be the easiest thing to fix). I'm more interested in finding a way to handle this error, though, than preventing it from happening. I realize that you are more interested in a work-a-round than in finding the cause of the problem but as both a Sage user and an Axiom developer I am motivated to look into this problem a little further. Running Sage 4.0.1 and Fricas 1.0.3 on Windows Vista. By running on Windows Vista, I presume that you mean you are running Sage (and FriCAS) on a virtual machine under Windows. Can you be more precise about exactly what versions you are running? What Sage source code or binary file did you download and build or install? How did you install Fricas 1.0.3? Was it built using clisp or ecl? How much memory is allocated for the virtual machine? Here's the actual code I'm running, if it helps: ... Thanks. I changed only two lines in your code: # if (gcd(D,diff(D,x)) != 1): return [0,0] if (axiom.gcd(D,diff(D,x)) != 1): return [0,0] # axiom.set('F', D) axiom('F:=%s'%axiom(D).name()) The first one calls the FriCAS version of gcd since the native gcd in Sage-3.2 was not able to handle some of your polynomials. The second change is just for compatibility with the older version of the FriCAS/Axiom interface. It works around a bug that I think is fixed in more recent versions of Sage. As far as I can tell these changes should not prevent the problem you are seeing. I expect that it is a deeper problem relating to memory and/or lisp version. If you are using FriCAS with ecl that is one of the first things I might suspect. In my case I am running an older version of Sage but a somewhat newer version of FriCAS. FriCAS is compiled with clisp under 32-bit Debian 5.0 on a 3.0 GHz processor with a large cache and 4 Gbytes memory. Sage 3.2 was built from source plus Mike Hansen's patched for axiom.py from trac (I believe these patches must have been included in Sage 4.0.1). I installed FriCAS 1.0.5 from http://sage.math.washington.edu/home/page/packages/fricas-1.0.5.spkg which I assembled from the build machinery in the spkg for fricas-1.0.3.p0 plus the newer FriCAS sources. --- I will let the current test run to completion (if possible) and let you know the result. If this succeeds, I will try building a new version of Sage and FriCAS that is closer to what you are running and try again to see if I am able to reproduce the problem. Regards, Bill Page. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Is it possible to replace the list built-in type in Sage?
[ x ] No, I can read the above just fine. It is crystal clear. ... but of course unnecessarily verbose. In my opinion a more common notation in Sage: sage: x=2*vector(range(10))+vector(10*[3]) sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x))) is superior to Mathematica. On Tue, Jul 14, 2009 at 6:35 PM, William Stein wrote: 2009/7/14 Carlos Córdoba ccordob...@gmail.com: Thanks John, I'd seen Python comprehensions before, but since I was trying to do all in a one-liner, I think I overlooked your elegant and simple solution. One comprehension at a time is quite neat, but several is just unreadable. That could be a function of familiarity. Quick poll -- Do you find the following just unreadable? x = [1,2,3] y = [2*a for a in x] z = [b + 3 for b in y] w = [a/max(z) for a in z] v = [[cos(a), sin(a)] for a in w] ANSWER: [ ] Yes, the above is just unreadable. [ ] No, I can read the above just fine. It is crystal clear. -- William --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Is it possible to replace the list built-in type in Sage?
[ x ] No, I can read the above just fine. It is crystal clear. ... but of course unnecessarily verbose. In my opinion a more common notation in Sage: sage: x=2*vector(range(10))+vector(10*[3]) sage: list_plot(map(lambda a:[cos(a),sin(a)],x/max(x))) is superior to Mathematica. On Tue, Jul 14, 2009 at 6:35 PM, William Stein wrote: 2009/7/14 Carlos Córdoba ccordob...@gmail.com: Thanks John, I'd seen Python comprehensions before, but since I was trying to do all in a one-liner, I think I overlooked your elegant and simple solution. One comprehension at a time is quite neat, but several is just unreadable. That could be a function of familiarity. Quick poll -- Do you find the following just unreadable? x = [1,2,3] y = [2*a for a in x] z = [b + 3 for b in y] w = [a/max(z) for a in z] v = [[cos(a), sin(a)] for a in w] ANSWER: [ ] Yes, the above is just unreadable. [ ] No, I can read the above just fine. It is crystal clear. -- William --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Thu, May 14, 2009 at 1:56 AM, Robert Bradshaw wrote: On May 13, 2009, at 9:11 PM, Bill Page wrote: On Wed, May 13, 2009 at 11:54 PM, Robert Bradshaw wrote: This is because the branch in which the positive real root is real is taken. We're opting for continuity and consistency with complex numbers. If I wrote: sage: ComplexField(53)(-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I that looks ok to me, but sage: RealField(53)(-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I looks very strange. Could you explain the advantage? I can try :) Thanks. I appreciate your willingness to re-hash this old subject. :-) sage: a -2.00 sage: a^(1/3) # what should happen here? The real field automatically promotes to complex in many instances (e.g. sqrt, or all other non-integral powers or negative numbers), so that's why I don't find it too strange. Also, it provides continuity in the exponent: sage: [(-2.0)^a for a in [0..1, step=1/10]] [1.00, 1.01931713553736 + 0.331196214043796*I, 0.929316490603148 + 0.675187952399881*I, 0.723648529606410 + 0.996016752925812*I, 0.407750368641006 + 1.25492659684357*I, 8.65956056235493e-17 + 1.41421356237309*I, -0.468382177707358 + 1.44153211743623*I, -0.954859959434831 + 1.31425198474794*I, -1.40858040033850 + 1.02339356496073*I, -1.77473421303888 + 0.576646101394740*I, -2.00] I would find it odd if every other value here were real. I would not find it odd and I guess in a way it is just a matter of taste. But 1/3 is an element of a Rational Field. It is not naturally continuous anyway. sage: b=1/3 sage: parent(b) Rational Field sage: (-2.0)^b ... On the other hand if I wrote: sage: b=1.0/3.0 sage: parent(b) Real Field with 53 bits of precision sage: (-2.0)^b 0.629960524947437 + 1.09112363597172*I I can explain this result as you indicate above. Note that we're not the only ones doing this: sage: mathematica((-2.0)^(1/3)) 0.6299605249474367 + 1.0911236359717214*I sage: maple((-2.0)^(1/3);) .6299605250+1.091123636*I sage: matlab((-2.0)^(1/3);) 0.6300 + 1.0911i sage: pari((-2.0)^(1/3);) 0.629960524947437 + 1.09112363597172*I The difference is that none of these system have the notion of type (or parent). Regards, Bill Page. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Thu, May 14, 2009 at 4:59 AM, John Cremona wrote: This debate has been going on for as long as computers have been in existence. Yes, there is a case to be made the odd roots of negative reals should return a negative real instead of the principal complex root. But that leads to more subtle problems in other places. Granted. Choose your poison. If all of mathematica, maple and matlab do the non-obvious thing there must be a good reason for it! There is but I think these reasons do not necessarily apply to Sage. And as Mike said, you can always get the real root by inserting brackets. ??? Consider the problem to define f(x) = x^(1/3) so that it takes the real branch for x 0. The best I have been able to come up with so far is: sage: f = lambda x: RealField(53)(x).sign()*(RealField(53)(x).sign()*x)^(1/3) sage: plot(f,(-2,2)) I think there should be a more obvious way. Regards, Bill Page. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Thu, May 14, 2009 at 11:06 AM, Jason Grout wrote: Bill Page wrote: Consider the problem to define f(x) = x^(1/3) so that it takes the real branch for x 0. The best I have been able to come up with so far is: sage: f = lambda x: RealField(53)(x).sign()*(RealField(53)(x).sign()*x)^(1/3) sage: plot(f,(-2,2)) plot(lambda x: RR(x).nth_root(3), -5, 5, plot_points=20) This is from a mailing list discussion last year (Feb 2008?) on the same issue. In fact, there have been several discussions of this. Search sage-devel for plotting cube roots, for example. Ok thanks. I recall the discussion and I can indeed write: sage: f=lambda x:RR(x).nth_root(3) sage: f(-2.0) -1.25992104989487 but I think I'll let my earlier comment stand: I think there should be a more obvious way. Regards, Bill Page. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Thu, May 14, 2009 at 12:34 PM, Jason Grout wrote: Bill Page wrote: Ok thanks. I recall the discussion and I can indeed write: sage: f=lambda x:RR(x).nth_root(3) sage: f(-2.0) -1.25992104989487 but I think I'll let my earlier comment stand: I think there should be a more obvious way. Of course, you're welcome to suggest a way. Note that in earlier threads, having a switch that determines which root to pick has been negatively viewed. -1 What about changing the name of the above function to: RR(x).real_root(3) ? That would certainly be easier to find and would be a bit more descriptive. Of course, right now, there is an nth_root function for complex numbers that also would have to be addressed. -0 Or what about making real_root a method for any number (or real_nth_root, or make nth_root take an argument for a target domain, like RR or RDF)? Perhaps we should continue this discussion on sage-devel if there is some reall interest in resolving this issue? What I personally would really prefer is that x^(1/3) call '.nth_root(3)' because (1/3) is an element of Rational Field. I suppose this requires some small change to the coercion system. Then x^(1.0/3.0) or equivalently x^RR(1/3) could continue to behave as it does now. Regards, Bill Page. --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] cube roots
Can someone explain this apparently inconsistent result? -- | Sage Version 3.4, Release Date: 2009-03-11 | | Type notebook() for the GUI, and license() for information.| -- sage: a=-2.0^(1/3);a -1.25992104989487 sage: parent(a) Real Field with 53 bits of precision sage: b=-2.0;b -2.00 sage: parent(b) Real Field with 53 bits of precision sage: c=b^(1/3);c 0.629960524947437 + 1.09112363597172*I sage: parent(c) Complex Field with 53 bits of precision sage: Why are the values of 'a' and 'c' different? Shouldn't Sage return the same root in both cases? Why is 'c' complex while 'a' is real? --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Wed, May 13, 2009 at 10:46 PM, Mike Hansen wrote: On Wed, May 13, 2009 at 6:58 PM, Bill Page wrote: Can someone explain this apparently inconsistent result? It's just operator precedence: sage: -(2.0^(1/3)) -1.25992104989487 sage: (-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I Clear. Thanks. Why this particular root? --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Wed, May 13, 2009 at 11:23 PM, Alex Ghitza wrote: On Thu, May 14, 2009 at 1:19 PM, Bill Page wrote: On Wed, May 13, 2009 at 10:46 PM, Mike Hansen wrote: On Wed, May 13, 2009 at 6:58 PM, Bill Page wrote: Can someone explain this apparently inconsistent result? It's just operator precedence: sage: -(2.0^(1/3)) -1.25992104989487 sage: (-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I Clear. Thanks. Why this particular root? I believe that it is the real 3rd root of 2 times the natural primitive 6th root of 1, i.e. exp(2*pi*i/6). In most cases (e.g. plot) isn't the real root more desirable? --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: cube roots
On Wed, May 13, 2009 at 11:54 PM, Robert Bradshaw wrote: This is because the branch in which the positive real root is real is taken. We're opting for continuity and consistency with complex numbers. If I wrote: sage: ComplexField(53)(-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I that looks ok to me, but sage: RealField(53)(-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I looks very strange. Could you explain the advantage? --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Public SAGE servers at SSCC
On February 6, 2007 10:38 AM Timothy Clemans wrote: Is there a way to get your DNS to make a subdomain like notebook1.sage.math.washington.edu/sage? On 2/6/07, William Stein wrote: ... Unfortunately, I simply don't know how to run the notebook through port 80 with apache yet. Also, two professional sysadmins tried quite hard to figure this out (without changing how the notebook works), and neither figured it out. Figuring out how to do this is important to me, but it's not so trivial as you might think. It will likely require rewriting a bunch of the notebook's code itself. William, If you can establish an alias for your server such as notebook.sage.math.washington.edu which simply maps to the same ip address as sage.math.washington.edu i.e. an alias for the machine name, then setting up a proxy using Apache in the same way that it is done at http://sage-notebook.axiom-developer.org is very easy. What is hard is trying to make a url like http://sage.math.washington.edu/notebook work the same way. Normally this also would be possible but some coding in the notebook itself gets in the way. Why not just ask your network administration to add an alias for you? Regards, Bill Page. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~--~~~~--~~--~--~---