[sage-support] Re: sage server problem
On Mar 27, 9:46 pm, gerhard ge01...@yahoo.de wrote: The solution for me was to omit the serverpool=[...] argument Thanks Gerhard! It is working now. But... I'm still a bit nervous. Having read the documentation on the server_pool option, I see that it specifies that worksheet processes run as a separate user. I'm a bit unclear on exactly what that's supposed to mean but it makes me wonder what might happen if a large number of people log on? In particular, what might happen if I have 20 students in a class working on individual worksheets simultaneously? Will there be a problem because worksheet processes aren't running simultaneously? Also, will the ulimit option really work? Thanks, Mark -- 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 To unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[sage-support] Re: sage server problem
On Mar 28, 8:32 am, mark mcclure mcmcc...@unca.edu wrote: Having read the documentation on the server_pool option, I see that it specifies that worksheet processes run as a separate user. I'm a bit unclear on exactly what that's supposed to mean but it makes me wonder what might happen if a large number of people log on? OK, searching around a bit more in the newsgroups, I find that the server_pool option is required to really run the notebook securely. Evidently, an option of the form server_pool=['sage_server_n...@myserver.edu'] specifies the user name that the worksheets run under. I *think* that otherwise, every user runs with the same permissions as the user who started notebook. In my case, I am not a privileged user on the system so that might not be a problem for the system, but it is still a problem for the Sage notebook. In order to use the server_pool option, you must create and account (or accounts) that requires no password, i.e. the command 'ssh sage_server_n...@myserver.edu' should run with no password. I don't have the ability to do this so I'd have to ask our sys admin. I wonder if he would have any reason to balk at that? Mark -- 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 To unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[sage-support] Running sage notebook as a daemon
After a bit of work, I've finally got a Sage installation on a globally accessible machine here running RedHat Linux. I've successfully started up the Sage Notebook and accessed it from home, but I can't stay logged into the server. How can I, as a standard non-root user, run the server as a daemon process so that I can log out while the server still runs. Mark McClure -- 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: Something like Mathematica's `Interact`?
On Nov 21, 5:11 pm, William Stein wst...@gmail.com wrote: Let's get real about this math software patent discussion. Mathematica, Magma, and Maple have no software patents. Matlab, on the other hand... This link gives *97* (!) registered patents by Mathworks (makers of MATLAB): ... Let's put Mathworks out of business. This seems to me to be an overly harsh statement towards a generally respectable company. While no company is perfect, The Mathworks has long been a huge supporter of some of the most fundamental and important open source, mathematical software. Cleve Moler, who founded The Mathworks, was one of the primary authors of two important and freely distributable computational libraries in the 1970s: Linpack (the predecessor to Lapack) and Eispack. While no member of The Mathworks is listed as an author of Lapack, the company plays an active role in its development. I believe the same is true of Blas. Moler has long been on the directory board of Netlib, which is certainly the largest repository of freely available software for numerical analysis in existence, and a number of other Mathworks employees are involved with Netlib as well. Mark McClure -- 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: Cython and SciPy special functions
On Oct 5, 1:19 pm, Robert Bradshaw rober...@math.washington.edu wrote: you might want to call these functions in SciPy directly as C functions. (You'd have to look up the SciPy headers to see what to call them.) That was my first thought, in fact. I'm not certain, but it appears that SciPy is ultimately calling Fortran code, which I'm not eager to delve into. Your suggestions did provide a further modest speedup but not another 50%. I really think that the airy function is the likely culprit. Thanks, Mark --~--~-~--~~~---~--~~ 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: Cython and SciPy special functions
On Oct 5, 8:40 pm, Robert Bradshaw rober...@math.washington.edu wrote: Try replacing the airy function with both math.sqrt, and math.h's sqrt, and see what the timings are, which for benchmarking purposes should give you a good idea if it's really the airy function. If it is, I doubt we're going to be writing a faster one ourselves... Sure enough. I generated the Julia set for the complex cosine function using almost identical code. The Cython speedup was a factor of 50. The result is here: http://sagenb.org/home/pub/1028/ Thanks for the help Robert, Mark --~--~-~--~~~---~--~~ 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] Cython and SciPy special functions
I'm investigating the complex dynamics of Airy functions with Python and I wonder if I can speed up the process significantly with Cython. I've successfully sped up the code by about 50% but I might expect much greater speed improvement. I'm guessing the problem is that Cython can't deal with SciPy's complex valued airy function. 1) Am I likely correct that the airy function is the culprit? 2) If so, is it likely that Cython will be eventually expanded to include the complex valued special functions of SciPy? If you're interested in the specific code, you can view it as a Sage notebook here: http://sagenb.org/home/pub/1013/ Thanks, Mark McClure --~--~-~--~~~---~--~~ 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: drawing graphs
On Jun 16, 2:36 am, Rado rki...@gmail.com wrote: Here, for example, is the Cayley graph of the alternating group A5: A = AlternatingGroup(5) G = Graph(A.cayley_graph()) s = G.graphviz_string() f = open('graphfile.dot', 'w') f.write(s) f.close() Actually for this example graphviz's neato (i.e. spring model) doesn't do much better than SAGE's spring. What Sage seems to be missing completely is the functionality of dot, which is for acyclic directed graphs, but works with all graphs (i.e. acyclicity is not enforced). Yes, I think I agree. Before posting, I checked this on my laptop, which has the old Pixelglow version of Graphviz on it. The result looks vastly superior to Sage's and appears to be layed out in the hierarchical fashion specified by dot. Although, I did nothing to request that layout format. Mark --~--~-~--~~~---~--~~ 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: drawing graphs
On Jun 15, 10:38 am, William Stein wst...@gmail.com wrote: On Mon, Jun 15, 2009 at 12:55 PM, Dominique Manchonmanc...@math.univ-bpclermont.fr wrote: Hello! I'm a newcomer into Sage and Python. When I want to draw some graphical representation of graphs I get problems Despite years of work, drawing graphs in Sage is still pretty broken. Graph drawing works well enough for me, when I just want a quick idea of what's going on. If I need a well drawn graph, I just export to Graphviz. Graphviz is open source but I seem to recall that its license is not Sage compatible. It is, nonetheless, freely available. Here, for example, is the Cayley graph of the alternating group A5: A = AlternatingGroup(5) G = Graph(A.cayley_graph()) s = G.graphviz_string() f = open('graphfile.dot', 'w') f.write(s) f.close() If you now open graphfile.dot in Graphviz, you should get a an interpretable version of quite a complicated graph. Mark McClure --~--~-~--~~~---~--~~ 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: paste a picture to the notebook worksheet
On Apr 9, 3:46 pm, lmc70 limingche...@gmail.com wrote: Is it possible to paste a picture, like a snapshot of a pdf file, on the notebook worksheet? I haven't figured out how to insert a PDF file, but you can insert a PNG image, or any other image type that your browser will display easy enough. To do so, access the TinyMCE code editor by shift-clicking between cells. A small word processor looking window will appear right in the notebook, complete with toolbars. The 'insert/edit image' button is on the right side of the bottom toolbar. You must specify the image by URL but you should be able to use an image stored with your sage worksheets easily enough. Mark McClure --~--~-~--~~~---~--~~ 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: Using html between cells in a notebook
I really like the feature of adding html between cells. Is it only possible to do this by switching to Edit-mode and manually putting in the html? No. Typically, you click between cells to add a new computational cell. Shift-click between cells to add a new text cell. This adds a TinyMCE editor window that, when saved, is HTML. You can double click on a section of text to open it up in it's own editor. Mark McClure --~--~-~--~~~---~--~~ 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: find_root reports zeroes of denominator as roots
On Mar 16, 6:14 am, jpc pedrocruzave...@gmail.com wrote: like matlab fzero command, the numerical answer of the equation is $x \approx 0$ because of the change of sign of $1/x \in [-1,1]$. This is not really a complete description of Matlab's behavior in this situation. If you simply define f(x) = 1/x and apply fzero, without requesting any additional information, you get: f = @(x) 1/x; fzero(f,-1,1) ans = -2.6773e-16 However, you can ask Matlab to provide more information via: [x,fval,exitflag,output] = fzero(f,-1,1); Now, fval is a huge number and output.message indicates that the function might be singular. Similarly, Mathematica yields a numerical zero but issues a warning. Now, you can find that Sage uses SciPy's implementation of Brent's algorithm when tackling this problem by typing find_root?? and SciPy provides similar functionality as Matlab, in this case. What I find particularly puzzling, though, is that scipy.opitimize.brentq, raises an error for this problem, at least when applied to the interval [-1.0, 1.0]. On the other hand, brentq runs without reporting a complaint when applied to the interval [1.0, pi]. See below. Mark McClure from scipy.optimize import brentq def f(x): return 1/x [x,info] = brentq(f, -1.0, pi, full_output=True) [x,info.converged] [-1.155868814851219e-12, True] brentq(f, -1.0, 1.0, full_output=True) Traceback (most recent call last): File stdin, line 1, in module File /Users/markmcclure/.sage/sage_notebook/worksheets/admin/31/ code/16.py, line 9, in module [a,b] = brentq(f, -_sage_const_1p0 , _sage_const_1p0 , full_output=True) File /Applications/Sage.app/Contents/Resources/sage/local/lib/ python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module File /Applications/Sage.app/Contents/Resources/sage/local/lib/ python2.5/site-packages/scipy/optimize/zeros.py, line 223, in brentq r = _zeros._brentq(f,a,b,xtol,maxiter,args,full_output,disp) File /Users/markmcclure/.sage/sage_notebook/worksheets/admin/31/ code/16.py, line 8, in f def f(x): return _sage_const_1 /x File element.pyx, line 1201, in sage.structure.element.RingElement.__div__ (sage/structure/element.c: 9116) File coerce.pyx, line 672, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/ coerce.c:5437) ZeroDivisionError: float division --~--~-~--~~~---~--~~ 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: Variable plot limits
On Mar 10, 1:10 pm, roleic rol...@vtxmail.ch wrote: In integrals variable integration limits work fine with sage. Now I would like to plot the variable integration range with plot3d or parametric_plot3d using variable plot range limits: u,v = var('u v') parametric_plot3d([u, v, u*0.1], (u, 0, 6), (v, 0, u)) In this example at least, you can parameterize the surface more carefully. Since x = u, y = u*v maps a square in the uv-plane to a triangle in the xy-plane, (u, u*v, f(u, u*v)) parameterizes the portion of the surface you want over the region of interest. More generally, x = u, y = (1-v)*g(u) + v*h(u) parameterizes the region between the graphs of the functions g and h. Thus, you could do your example like so: (x,y,u,v) = var('x,y,u,v') f(x,y) = 0.1*x; parametric_plot3d([u,u*v,f(u,u*v)], (u,0,2), (v,0,2)) Have fun, Mark McClure --~--~-~--~~~---~--~~ 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: Why can't do integrate( abs( sin(t^2) ), t, 0, 3) ?
On Mar 11, 2:46 pm, David Joyner wdjoy...@gmail.com wrote: sage: t = var(t) sage: numerical_integral(abs(sin(t^2)),0,3) (1.7024100330599248, 1.5397333279914378e-06) because AFAIK, integrate(abs(sin(t*t)),t,0,3) cannot be computed in closed form. Mathematica returns the result in terms of Fresnel functions. Maxima can find the indefinite integral in terms of the error function. What Maxima *can't* do is deal with absolute values in a definite integral. Try: integrate(abs(sin(t)), t, 0, pi) The result returns unevaluated, even though the integrand is positive on the integral. I think I saw that on the Maxima discussion group a bit ago. Mark McClure --~--~-~--~~~---~--~~ 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: Problem installing on Mac OS X 10.5
On Mar 10, 8:35 pm, william wll...@gmail.com wrote: Platform/OS: MAC OS X 10.5.6 SAGE Version 3.0.2, Release Date: 2008-05-24 I have loaded Sage onto my system from a DVD and put it in my application folder and am stuck on the README instructions. It says to double click on the sage icon and then: When I double click on a Sage 3.0 icon, it opens in emacs! More likely for you, it opens up the Terminal application. This is a very simple text based interface into which you can type commands. Type notebook() into the Terminal and you'll enter a graphic environment in your web-browser. If something else happens, simply cntrl-click on the Sage icon to pull up a contextual menu. From there you can choose Open with and select the Terminal application which is in Applications/Utitlites. You can also choose Get Info from the textual menu and then click a box to make this the default behavior. Choose Applications, then select All Applications in the Enable: drop down. Change the Applications drop down to Utilities. On the left, scroll and select Terminal. Click Open, then in the next dialog select Update Choose Applications from where? I don't know what is meant by this. I can't find an Enable drop down menu either. This behavior happens sometimes when Mac OS doesn't know what to open a file with. This depends on your preference settings and I guess it didn't happen in your case. I think there will be a nice clickable Mac App soon. Have fun, Mark McClure --~--~-~--~~~---~--~~ 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: Unable to run Sage Version 3.2.3 on OS X (10.5 Intel): Runtime Error: Unable to Start Maxima
On Feb 23, 1:17 pm, dr dprangel...@gmail.com wrote: I am considering using SAGE for instruction in the classroom for come courses. However, I use an OS 10.5 Intel Mac for preparing materials and want to have a local installation of SAGE to work on worksheets for class and to have as backup in case the server is ever down or I have limited network access in class. However, I downloaded and installed SAGE 3.2.3 as instructed and followed the previous posts on this forum regarding a common runtime error: Unable to start maxima. Has anyone resolved this issue? This looks like the issue I was having and Michael Abshoff fixed it in the latest release, which is 3.3. I don't think that will be released in binary but the source code is available, if you can build it. Supposedly, 3.4 will be out soon. Mark McClure --~--~-~--~~~---~--~~ 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: calling SAGE from C or Mathematica
On May 23, 5:52 pm, William Stein [EMAIL PROTECTED] wrote: Why don't you do child.expect('sage: ') Because, I was too focused on using child.after, instead of child.before, but your suggestion works great; thanks for that. So I incorporated your suggestion and re-worked and expanded my examples of calling Sage from Mathematica. The new version seems to work fairly well and is posted in the old spot: http://facstaff.unca.edu/mcmcclur/Mathematica/Sage/ The examples are all graph-theoretic and illustrate that Sage is generally faster than Combinatorica. I also exported a Sage notebook to a webpage comparing Sage's is_isomorphic to Combinatorica's IsomorphicQ: http://facstaff.unca.edu/mcmcclur/Mathematica/Sage/GraphIsomorphism.html Mark --~--~-~--~~~---~--~~ 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://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: calling SAGE from C or Mathematica
On May 7, 2:41 am, Amir [EMAIL PROTECTED] wrote: Can I start a Sage session from C? I would need to pass commands, set and get variables, and cleanly terminate the session. I would like to do this as a mathlink module to call Sage from Mathematica. As a fan of both Sage and Mathematica, I found this to be an interesting question. For example, the graph theoretic tools in Sage, via Networkx and N.I.C.E., are generally better than those currently in Mathematica. The graph visualization seems to be better in Mathematica at this point. So it's nice to use the tools together. I've got a sample notebook that does a couple things like this here: http://facstaff.unca.edu/mcmcclur/Mathematica/Sage/ It's pretty basic at the moment - mainly proof of concept, but it demonstrates a workable approach. The basic idea is to use Pythonika to access Sage via pexpect. I do have a question, as I'm fairly new to Python and Sage. I have several Python lines that look something like this: import pexpect child = pexpect.spawn('/Applications/sage/sage') child.expect('.*') while child.after[-6:] != 'sage: ': child.expect('.*') The point behind the while statement is to continue reading until the next prompt is reached. I wonder how robust this is? Or whether there is a more standard approach? Mark --~--~-~--~~~---~--~~ 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://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Plotting x^x
On May 16, 2:44 am, Dan Pillone [EMAIL PROTECTED] wrote: Is there a way to plot x^x correctly? A lovely article by Mark Meyerson entitled The x^x Spindle appeared in Mathematics Magazine back in June of 96. The article shows how to interpret the graph of x^x in 3-space, using the complex values of x^x. This may be plotted in sage as follows: def f(x,k): if x != 0: z = exp(x*(maxima.log(x) + 2*I*pi*k)) return [x, real(z), imag(z)] else: return [0, 1, 0] dx = 0.02 pic = line([[0,1,0],[0,1,0]]); for k in range(-3,4): points = [f(x*dx,k) for x in range(-4/dx,2/dx)] pic = pic + line(points) pic.show(frame_aspect_ratio=[2,1,1], figsize=8) The above commands take *way* too long, presumably due to the repeated calls to maxima's complex log function. Sage's log function doesn't work. I was able to perform the loop in maxima, but I was unable to get the result back into sage for plotting. The result is quite nice, though. There are countably many different threads, corresponding to the different branches of the complex log; they all spiral about the x-axis. You can see the graph here: https://www.sagenb.org/home/pub/1830/ The published notebook also shows a plot of x^x for x0 together with points of the form (-p/q)^(-p/q) for odd q. These points all lie where one of the threads pierces the x-re(z) plane. Mark --~--~-~--~~~---~--~~ 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://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Plotting x^x
On May 21, 1:07 pm, William Stein [EMAIL PROTECTED] wrote: Since I know a bit more about how to optimize code in Sage, I redid your function but using more tricks. The result draws the above in 0.09 seconds (yep!). And Marshall wrote: Arg, you beat me to it. I have a solution that takes about twice as long as yours; I didn't you could use _fast_float_ like that: Hey thanks guys! Maybe, I'll learn these little tricks sometime, too. Mark --~--~-~--~~~---~--~~ 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://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Counting complex number in a Tuples
On May 9, 4:16 pm, Rose [EMAIL PROTECTED] wrote: No I am not sure I need Tuple(). I am trying to draw some polygons on the complex plane, so I put the coordinates of the vertex (I am not sure it is the good word) in a Turple(). Do you think there is a better way to do that? How about something like the following: cpoints = [0, 1, 1+I] points = [[real(z), imag(z)] for z in cpoints] polygon(points).show(figsize=[8,8]) Mark --~--~-~--~~~---~--~~ 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://www.sagemath.org -~--~~~~--~~--~--~---