[sage-support] Re: Why plot() won't plot this function?
Hi Jason, It think that find_root does use fast_float, but it compiles the fast_float function every time it is called. This makes it very slow if I want to find the roots of f for all values of b between say -3 and -1. Therefore, I would like to be able to compile a fast_float function of e.g. 'b' and 'x', then pluck in different values for b and call find_root repeatedly to find the roots. The partial trick did it, but it would be great if this could be made more intuitively and part of fast_float, as you suggested. Since fast_float can be defined for an arbitrary number of variables, I think that it should be possible to generate a fast_float expression for any symbolic equation, and if this was a callable function or even worked with .subs() it would be a huge enhancement. Thanks again, Stan Jason Grout wrote: Unfortunately, I don't that will ever work, as Python does not do automatic currying (did I use the right term?). The list comprehension in python is a special case, where the function is not evaluated until you have a value for x. However, in the case of plot, the function ff is evaluated first, and since x is missing, there is an error. However, in your case, it would probably make a lot more sense to do this: f = a*x^3+b*x^2+c*x+d plot(f.subs(a=1,b=2,c=3,d=4), (x, 0, 6)) This uses the fact that f is a symbolic expression, then the subs command substitutes in variables and returns another expression. fast_float is called by plot automatically. If find_root doesn't automatically use fast_float (it should!), then you could do something like: f = a*x^3+b*x^2+c*x+d find_root(fast_float(f.subs(a=1,b=2,c=3,d=4), 'x'), (x, 0, 6)) (or whatever the syntax is). Again, this only works for Sage symbolic expressions... Sorry I didn't think of this earlier. For general python functions, you could use the partial trick we talked about. It might make sense to have some sort of partial evaluation available for fast_float functions, so if a few arguments were given, it behaved like the partial trick above. Thanks, Jason -- Stan Schymanski Scientist Max Planck Institute for Biogeochemistry Postfach 10 01 64 D-07701 Jena Phone: +49.3641.576264 Fax: +49.3641.577274 WWW: http://www.bgc-jena.mpg.de/~sschym Biospheric Theory and Modelling Group http://www.bgc-jena.mpg.de/bgc-theory/ _ --~--~-~--~~~---~--~~ 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 plot() won't plot this function?
On Apr 23, 2009, at 12:09 AM, Stan Schymanski wrote: Hi Jason, It think that find_root does use fast_float, but it compiles the fast_float function every time it is called. This makes it very slow if I want to find the roots of f for all values of b between say -3 and -1. Therefore, I would like to be able to compile a fast_float function of e.g. 'b' and 'x', then pluck in different values for b and call find_root repeatedly to find the roots. The partial trick did it, but it would be great if this could be made more intuitively and part of fast_float, as you suggested. Creating fast_float (or, now, fast_callable) objects should be much faster with the new symbolics. Since fast_float can be defined for an arbitrary number of variables, I think that it should be possible to generate a fast_float expression for any symbolic equation, and if this was a callable function or even worked with .subs() it would be a huge enhancement. A partial function application would be a great thing to add to this class, though I'm not sure how much effort should be put into simplification (probably just change inputs to constants). Thanks again, Stan Jason Grout wrote: Unfortunately, I don't that will ever work, as Python does not do automatic currying (did I use the right term?). The list comprehension in python is a special case, where the function is not evaluated until you have a value for x. However, in the case of plot, the function ff is evaluated first, and since x is missing, there is an error. However, in your case, it would probably make a lot more sense to do this: f = a*x^3+b*x^2+c*x+d plot(f.subs(a=1,b=2,c=3,d=4), (x, 0, 6)) This uses the fact that f is a symbolic expression, then the subs command substitutes in variables and returns another expression. fast_float is called by plot automatically. If find_root doesn't automatically use fast_float (it should!), then you could do something like: f = a*x^3+b*x^2+c*x+d find_root(fast_float(f.subs(a=1,b=2,c=3,d=4), 'x'), (x, 0, 6)) (or whatever the syntax is). Again, this only works for Sage symbolic expressions... Sorry I didn't think of this earlier. For general python functions, you could use the partial trick we talked about. It might make sense to have some sort of partial evaluation available for fast_float functions, so if a few arguments were given, it behaved like the partial trick above. Thanks, Jason -- Stan Schymanski Scientist Max Planck Institute for Biogeochemistry Postfach 10 01 64 D-07701 Jena Phone: +49.3641.576264 Fax: +49.3641.577274 WWW: http://www.bgc-jena.mpg.de/~sschym Biospheric Theory and Modelling Group http://www.bgc-jena.mpg.de/bgc-theory/ _ --~--~-~--~~~---~--~~ 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: scipy compatibility
I still don't understand why the solution you propose in the wiki is necessary Unless sage is passing (to the ppf function) something other than standard python's ints and floats. Is this the case? I just tested the same code snippet in a %python cell (in a notebook) and it works as expected ( without the int()s and float()s). However, when I try to run it the same code in a module that is imported (in a %python cell) I get the error. I didn't expect that. I think that any code that runs in straight python should run on %python blocks, even imported code. I tried to run the same module via load instead of import, but load was trying to load from the ~/.sage directory instead of the directory where I started sage, (is this a bug?). Also load also gave me a syntax error when gave it a path : load somedir/test.py. Shouldn't load take full paths instead of only filenames? Flávio On 22 abr, 15:55, William Stein wst...@gmail.com wrote: On Wed, Apr 22, 2009 at 7:19 AM, Flavio Coelho fccoe...@gmail.com wrote: Hi anyone know why this simple python code fails in sage? from scipy import stats stats.uniform(0,15).ppf([0.5,0.7]) This has been a show stopper for me as need to do statistics... This questions was answered incorrectly (and hard to find) in the SAGE Faq, so I've put in a correct answer. See: http://wiki.sagemath.org/faq#Typeissuesusingscipy.2Ccvxoptornumpyfrom... 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: scipy compatibility
I think it will be hard to convice the scipy folks that this is a bug since it runs perfectly in Python, and scipy is not supposed to handle foreign types anyway... On 22 abr, 19:45, Ondrej Certik ond...@certik.cz wrote: On Wed, Apr 22, 2009 at 7:55 AM, William Stein wst...@gmail.com wrote: On Wed, Apr 22, 2009 at 7:19 AM, Flavio Coelho fccoe...@gmail.com wrote: Hi anyone know why this simple python code fails in sage? from scipy import stats stats.uniform(0,15).ppf([0.5,0.7]) This has been a show stopper for me as need to do statistics... This questions was answered incorrectly (and hard to find) in the SAGE Faq, so I've put in a correct answer. See: http://wiki.sagemath.org/faq#Typeissuesusingscipy.2Ccvxoptornumpyfrom... Just to make it sure -- it's a bug in scipy right? They should not only check for int/float, but also if the thing has __float__ or __int__ implemented. So that the user (Sage) can pass anything in there. Ondrej --~--~-~--~~~---~--~~ 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: scipy compatibility
On Thu, Apr 23, 2009 at 3:34 AM, Flavio Coelho fccoe...@gmail.com wrote: I still don't understand why the solution you propose in the wiki is necessary Unless sage is passing (to the ppf function) something other than standard python's ints and floats. Is this the case? Yes. I just tested the same code snippet in a %python cell (in a notebook) and it works as expected ( without the int()s and float()s). However, when I try to run it the same code in a module that is imported (in a %python cell) I get the error. I didn't expect that. I think that any code that runs in straight python should run on %python blocks, even imported code. I tried to run the same module via load instead of import, but load was trying to load from the ~/.sage directory instead of the directory where I started sage, (is this a bug?). No. Also load also gave me a syntax error when gave it a path : load somedir/test.py. Shouldn't load take full paths instead of only filenames? Yes. That definitely sounds like a bug. Thanks for reporting it. Flávio I think it will be hard to convice the scipy folks that this is a bug since it runs perfectly in Python, and scipy is not supposed to handle foreign types anyway... Bug or not, at some point either the scipy/numpy developers or the Sage developers will absolutely have to modify both scipy and numpy to fix this problem.Either that will happen via them better supporting other data types besides float/int, or we will have to significantly patch the versions of numpy/scipy that we ship with Sage. One or the other solution will inevitably happen. William -- 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: snapshot saving
I have used snapshots when I forgot to save a notebook under a new name before making big changes and then wanted to revert to the original. It wasn't very convenient, as the plots are not saved, so I could not easily recognise the right version. However, it saved my day! I like the idea of just saving the last 30 or so snapshots. I had numerous computer crashes while working with notebooks, but I never lost any data. Is this not due to the snapshots? Cheers, Stan William Stein wrote: Hi, Does anybody here ever use snapshots? This is what implements the Undo button. I never use it. 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: scipy compatibility
I think I may have found a good argument to ask for better type checking in scipy: In [4]: stats.randint(1.,15.).ppf([.1,.2,.3,.4,.5]) Out[4]: array([ 2., 3., 5., 6., 7.]) when you call stats.randint with floats as parameters you get floats as results, which is clearly wrong and should be fixed. Maybe the solution to this may bring us closer to a general solution for the incompatibility between sage types and Numpy/Scipy's. I'll post this error to the numpy list and see what kind of response I get. Flávio On 23 abr, 12:21, Flavio Coelho fccoe...@gmail.com wrote: On 23 abr, 11:47, William Stein wst...@gmail.com wrote: I tried to run the same module via load instead of import, but load was trying to load from the ~/.sage directory instead of the directory where I started sage, (is this a bug?). No. then the How to use the Sage Notebook help page should be fixed because it says, and I quote: Use load filename.sage and load filename.py. Load is relative to the path you started the notebook in. The .sage files are preparsed and .py files are not. You may omit the .sage or .py extension. Files may load other files. Also load also gave me a syntax error when gave it a path : load somedir/test.py. Shouldn't load take full paths instead of only filenames? Yes. That definitely sounds like a bug. Thanks for reporting it. Flávio I think it will be hard to convice the scipy folks that this is a bug since it runs perfectly in Python, and scipy is not supposed to handle foreign types anyway... Bug or not, at some point either the scipy/numpy developers or the Sage developers will absolutely have to modify both scipy and numpy to fix this problem. Either that will happen via them better supporting other data types besides float/int, or we will have to significantly patch the versions of numpy/scipy that we ship with Sage. One or the other solution will inevitably happen. William -- William What I did in my module, was to force every argument to stats.distribution and the .ppf call, to be floats whether they be ints or floats. That fixed it for now. --~--~-~--~~~---~--~~ 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] Symbolic algebra expansion of products of sums
Hi, I was wondering why Sage expands products of sums in an unexpected order: var('a0,a1,b0,b1,b2,c0,c1,c2,c3,d0,d1,d2,d3,d4') expand((a0+a1)*(b0+b1)) a1*b1 + a0*b1 + a1*b0 + a0*b0 expand((a0+a1)*(b0+b1+b2)*(c0+c1+c2+c3)*(d0+d1+d2+d3+d4)) a1*b2*c3*d4 + a0*b2*c3*d4 + a1*b1*c3*d4 + a0*b1*c3*d4 + a1*b0*c3*d4 + a0*b0*c3*d4 + a1*b2*c2*d4 + a0*b2*c2*d4 + a1*b1*c2*d4 + a0*b1*c2*d4 + a1*b0*c2*d4 + a0*b0*c2*d4 + a1*b2*c1*d4 + a0*b2*c1*d4 + a1*b1*c1*d4 + a0*b1*c1*d4 + a1*b0*c1*d4 + a0*b0*c1*d4 + a1*b2*c0*d4 + a0*b2*c0*d4 + a1*b1*c0*d4 + a0*b1*c0*d4 + a1*b0*c0*d4 + a0*b0*c0*d4 + a1*b2*c3*d3 + a0*b2*c3*d3 + a1*b1*c3*d3 + a0*b1*c3*d3 + a1*b0*c3*d3 + a0*b0*c3*d3 + a1*b2*c2*d3 + a0*b2*c2*d3 + a1*b1*c2*d3 + a0*b1*c2*d3 + a1*b0*c2*d3 + a0*b0*c2*d3 + a1*b2*c1*d3 + a0*b2*c1*d3 + a1*b1*c1*d3 + a0*b1*c1*d3 + a1*b0*c1*d3 + a0*b0*c1*d3 + a1*b2*c0*d3 + a0*b2*c0*d3 + a1*b1*c0*d3 + a0*b1*c0*d3 + a1*b0*c0*d3 + a0*b0*c0*d3 + a1*b2*c3*d2 + a0*b2*c3*d2 + a1*b1*c3*d2 + a0*b1*c3*d2 + a1*b0*c3*d2 + a0*b0*c3*d2 + a1*b2*c2*d2 + a0*b2*c2*d2 + a1*b1*c2*d2 + a0*b1*c2*d2 + a1*b0*c2*d2 + a0*b0*c2*d2 + a1*b2*c1*d2 + a0*b2*c1*d2 + a1*b1*c1*d2 + a0*b1*c1*d2 + a1*b0*c1*d2 + a0*b0*c1*d2 + a1*b2*c0*d2 + a0*b2*c0*d2 + a1*b1*c0*d2 + a0*b1*c0*d2 + a1*b0*c0*d2 + a0*b0*c0*d2 + a1*b2*c3*d1 + a0*b2*c3*d1 + a1*b1*c3*d1 + a0*b1*c3*d1 + a1*b0*c3*d1 + a0*b0*c3*d1 + a1*b2*c2*d1 + a0*b2*c2*d1 + a1*b1*c2*d1 + a0*b1*c2*d1 + a1*b0*c2*d1 + a0*b0*c2*d1 + a1*b2*c1*d1 + a0*b2*c1*d1 + a1*b1*c1*d1 + a0*b1*c1*d1 + a1*b0*c1*d1 + a0*b0*c1*d1 + a1*b2*c0*d1 + a0*b2*c0*d1 + a1*b1*c0*d1 + a0*b1*c0*d1 + a1*b0*c0*d1 + a0*b0*c0*d1 + a1*b2*c3*d0 + a0*b2*c3*d0 + a1*b1*c3*d0 + a0*b1*c3*d0 + a1*b0*c3*d0 + a0*b0*c3*d0 + a1*b2*c2*d0 + a0*b2*c2*d0 + a1*b1*c2*d0 + a0*b1*c2*d0 + a1*b0*c2*d0 + a0*b0*c2*d0 + a1*b2*c1*d0 + a0*b2*c1*d0 + a1*b1*c1*d0 + a0*b1*c1*d0 + a1*b0*c1*d0 + a0*b0*c1*d0 + a1*b2*c0*d0 + a0*b2*c0*d0 + a1*b1*c0*d0 + a0*b1*c0*d0 + a1*b0*c0*d0 + a0*b0*c0*d0 This ordering makes it extremely difficult to do index association from the j-th term of the expansion back into constituent indices of each sum (i0,i1,i2,i3); for example, (0,1,2,3) corresponds to a0*b1*c2*d3 and is associated with j=33. A more intuitive left to right product expansion would have been simpler and more useful when working with these expansions. Also, other math packages expand these products in a different order than what's seen in Sage. In the simpler case (a0+a1)*(b0+b1) I would expect the accepted FOIL ordering of terms. What was the rationale? Given j, how would you calculate (i0,i1,i2,i3,...,ik) considering Sage's expansion order? Your help is appreciated, philabuster --~--~-~--~~~---~--~~ 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] %pdb not working?
Hi, what is the curently recomended way to debug code from within a notebook? I found %pdb (as suggested in documentation) does not work in 3.4. Also the standard python way: import pdb;pdb.run(call) also does not work. thanks Flávio --~--~-~--~~~---~--~~ 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: scipy compatibility
On Apr 23, 2009, at 3:37 AM, Flavio Coelho wrote: I think it will be hard to convice the scipy folks that this is a bug since it runs perfectly in Python, and scipy is not supposed to handle foreign types anyway... This can be reproduced in Pure Python--just make a class that has an __int__ or __float__ method and try to use it. The only difference with Sage is that our literals are not ints/floats. - Robert --~--~-~--~~~---~--~~ 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: Symbolic algebra expansion of products of sums
On Thu, Apr 23, 2009 at 6:44 AM, philabuster pollock.p...@gmail.com wrote: Hi, I was wondering why Sage expands products of sums in an unexpected order: var('a0,a1,b0,b1,b2,c0,c1,c2,c3,d0,d1,d2,d3,d4') The ordering of these terms is determined by maxima -- Sage doesn't control that at all, just leaving them in the default order maxima chooses. expand((a0+a1)*(b0+b1)) a1*b1 + a0*b1 + a1*b0 + a0*b0 And in Maxima: wst...@geom:~/db/wuthrich-twist/data$ sage -maxima Maxima 5.16.3 http://maxima.sourceforge.net Using Lisp CLISP 2.47 (2008-10-23) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) expand((a0+a1)*(b0+b1)); (%o1)a1 b1 + a0 b1 + a1 b0 + a0 b0 We are currently making a push to rewrite the symbolic calculus part of Sage using the Ginac C++ library instead of Maxima. When that happens, the above will be: sage: var('a0 a1 b0 b1',ns=1) # ns=1 sets a preview mode that enables new symbolics (a0, a1, b0, b1) sage: expand((a0+a1)*(b0+b1)) a0*b0 + a0*b1 + a1*b0 + a1*b1 New symbolics also tend to be easier to work with term-by-term: sage: v = expand((a0+a1)*(b0+b1)) sage: v[0] a0*b0 sage: v[1] a0*b1 sage: v[2] a1*b0 sage: v[3] a1*b1 expand((a0+a1)*(b0+b1+b2)*(c0+c1+c2+c3)*(d0+d1+d2+d3+d4)) a1*b2*c3*d4 + a0*b2*c3*d4 + a1*b1*c3*d4 + a0*b1*c3*d4 + a1*b0*c3*d4 + a0*b0*c3*d4 + a1*b2*c2*d4 + a0*b2*c2*d4 + a1*b1*c2*d4 + a0*b1*c2*d4 + a1*b0*c2*d4 + a0*b0*c2*d4 + a1*b2*c1*d4 + a0*b2*c1*d4 + a1*b1*c1*d4 + a0*b1*c1*d4 + a1*b0*c1*d4 + a0*b0*c1*d4 + a1*b2*c0*d4 + a0*b2*c0*d4 + a1*b1*c0*d4 + a0*b1*c0*d4 + a1*b0*c0*d4 + a0*b0*c0*d4 + a1*b2*c3*d3 + a0*b2*c3*d3 + a1*b1*c3*d3 + a0*b1*c3*d3 + a1*b0*c3*d3 + a0*b0*c3*d3 + a1*b2*c2*d3 + a0*b2*c2*d3 + a1*b1*c2*d3 + a0*b1*c2*d3 + a1*b0*c2*d3 + a0*b0*c2*d3 + a1*b2*c1*d3 + a0*b2*c1*d3 + a1*b1*c1*d3 + a0*b1*c1*d3 + a1*b0*c1*d3 + a0*b0*c1*d3 + a1*b2*c0*d3 + a0*b2*c0*d3 + a1*b1*c0*d3 + a0*b1*c0*d3 + a1*b0*c0*d3 + a0*b0*c0*d3 + a1*b2*c3*d2 + a0*b2*c3*d2 + a1*b1*c3*d2 + a0*b1*c3*d2 + a1*b0*c3*d2 + a0*b0*c3*d2 + a1*b2*c2*d2 + a0*b2*c2*d2 + a1*b1*c2*d2 + a0*b1*c2*d2 + a1*b0*c2*d2 + a0*b0*c2*d2 + a1*b2*c1*d2 + a0*b2*c1*d2 + a1*b1*c1*d2 + a0*b1*c1*d2 + a1*b0*c1*d2 + a0*b0*c1*d2 + a1*b2*c0*d2 + a0*b2*c0*d2 + a1*b1*c0*d2 + a0*b1*c0*d2 + a1*b0*c0*d2 + a0*b0*c0*d2 + a1*b2*c3*d1 + a0*b2*c3*d1 + a1*b1*c3*d1 + a0*b1*c3*d1 + a1*b0*c3*d1 + a0*b0*c3*d1 + a1*b2*c2*d1 + a0*b2*c2*d1 + a1*b1*c2*d1 + a0*b1*c2*d1 + a1*b0*c2*d1 + a0*b0*c2*d1 + a1*b2*c1*d1 + a0*b2*c1*d1 + a1*b1*c1*d1 + a0*b1*c1*d1 + a1*b0*c1*d1 + a0*b0*c1*d1 + a1*b2*c0*d1 + a0*b2*c0*d1 + a1*b1*c0*d1 + a0*b1*c0*d1 + a1*b0*c0*d1 + a0*b0*c0*d1 + a1*b2*c3*d0 + a0*b2*c3*d0 + a1*b1*c3*d0 + a0*b1*c3*d0 + a1*b0*c3*d0 + a0*b0*c3*d0 + a1*b2*c2*d0 + a0*b2*c2*d0 + a1*b1*c2*d0 + a0*b1*c2*d0 + a1*b0*c2*d0 + a0*b0*c2*d0 + a1*b2*c1*d0 + a0*b2*c1*d0 + a1*b1*c1*d0 + a0*b1*c1*d0 + a1*b0*c1*d0 + a0*b0*c1*d0 + a1*b2*c0*d0 + a0*b2*c0*d0 + a1*b1*c0*d0 + a0*b1*c0*d0 + a1*b0*c0*d0 + a0*b0*c0*d0 This ordering makes it extremely difficult to do index association from the j-th term of the expansion back into constituent indices of each sum (i0,i1,i2,i3); for example, (0,1,2,3) corresponds to a0*b1*c2*d3 and is associated with j=33. A more intuitive left to right product expansion would have been simpler and more useful when working with these expansions. Also, other math packages expand these products in a different order than what's seen in Sage. In the simpler case (a0+a1)*(b0+b1) I would expect the accepted FOIL ordering of terms. What was the rationale? Given j, how would you calculate (i0,i1,i2,i3,...,ik) considering Sage's expansion order? Your help is appreciated, philabuster -- 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: How to stop wiki?
This bug *was* fixed, and the patch is on trac. http://trac.sagemath.org/sage_trac/ticket/1871 On Apr 18, 1:08 pm, Kevin Horton khorto...@rogers.com wrote: That works. Thank you very much. It was getting tiresome to reboot the computer after every wiki config adjustment. -- Kevin Horton On 18 Apr 2009, at 15:43, William Stein wrote: This is a known bug which will be fixed. For now, do ctrl-z kill %1 William On Sat, Apr 18, 2009 at 11:41 AM, Kevin Horton khorto...@rogers.com wrote: I've searched sage-support, all the docs, the MoinMoin docs and done a bunch of Googling, but I have not learned how to stop the wiki. A ctrl-C kills it, but it immediately starts up again, but with the port number incremented by one. Same thing if I use kill to stop the wiki's twisted server PID. Any hints would be appreciated. -- Kevin Horton Ottawa, Canada --~--~-~--~~~---~--~~ 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: Symbolic algebra expansion of products of sums
On 23 Dub, 20:38, William Stein wst...@gmail.com wrote: On Thu, Apr 23, 2009 at 6:44 AM, philabuster pollock.p...@gmail.com wrote: Hi, I was wondering why Sage expands products of sums in an unexpected order: var('a0,a1,b0,b1,b2,c0,c1,c2,c3,d0,d1,d2,d3,d4') The ordering of these terms is determined by maxima -- Sage doesn't control that at all, just leaving them in the default order maxima chooses. expand((a0+a1)*(b0+b1)) a1*b1 + a0*b1 + a1*b0 + a0*b0 And in Maxima: wst...@geom:~/db/wuthrich-twist/data$ sage -maxima Maxima 5.16.3http://maxima.sourceforge.net Using Lisp CLISP 2.47 (2008-10-23) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) expand((a0+a1)*(b0+b1)); (%o1) a1 b1 + a0 b1 + a1 b0 + a0 b0 You can use commands orderless and ordergreat in Maxima to change the default behavior. see http://maxima.sourceforge.net/docs/manual/en/maxima_6.html#Item_003a-ordergreat Works in Maxima but not in Sage :-(- even if I use unorder first. Robert --~--~-~--~~~---~--~~ 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: How to stop wiki?
On Thu, Apr 23, 2009 at 12:55 PM, Kevin Horton khorto...@rogers.com wrote: But, the trac_1871-b patch does not seem applicable to the version of moin that ships with sage. Is there a patch available for moin-1.5.7p2? No. We really should upgrade moinmoin included in Sage. The only reason we haven't is that the official moinmoin scripts for converting moinmoin installs from their old format to their new format doesn't work very reliably, so if we make this switch, anybody serving a moinmoin wiki from Sage will (1) suddenly find that all of their wikis are totally broken, and (2) they will have almost no clue what to do to fix this problem.I'm fine with (1), if (2) is addressed, but my strong impression is that the patches up don't address (2) very well yet. I suspect that after the pynac switchover for symbolics happens, probably Mike Hansen will have time to work on (2). -- William On 23 Apr 2009, at 15:21, Robert Miller wrote: This bug *was* fixed, and the patch is on trac. http://trac.sagemath.org/sage_trac/ticket/1871 On Apr 18, 1:08 pm, Kevin Horton khorto...@rogers.com wrote: That works. Thank you very much. It was getting tiresome to reboot the computer after every wiki config adjustment. -- Kevin Horton On 18 Apr 2009, at 15:43, William Stein wrote: This is a known bug which will be fixed. For now, do ctrl-z kill %1 William On Sat, Apr 18, 2009 at 11:41 AM, Kevin Horton khorto...@rogers.com wrote: I've searched sage-support, all the docs, the MoinMoin docs and done a bunch of Googling, but I have not learned how to stop the wiki. A ctrl-C kills it, but it immediately starts up again, but with the port number incremented by one. Same thing if I use kill to stop the wiki's twisted server PID. Any hints would be appreciated. -- Kevin Horton Ottawa, Canada -- Kevin Horton 6730 Parkway Road Greely, ON K4P 1E3 Canada 613-821-7862 (H) 613-952-4319 (W) -- 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: snapshot saving
Hi, I've written a patch against 3.4.1: http://trac.sagemath.org/sage_trac/ticket/5880 which simply greatly reduces the number of situations that result in snapshots. Basically, now you get them when you click save. There is no autosave. Please try/test. -- William On Thu, Apr 23, 2009 at 6:29 AM, kcrisman kcris...@gmail.com wrote: I definitely agree with those who would keep snapshot. Having a list of commands is not the same - for one thing, log does not save the whole worksheet, only commands (i.e. not TinyMCE stuff); for another, it logs notebook-wide, so it becomes a bit of a jaunt to find stuff. That said, I also agree that, given log's presence, worksheet snapshots could be much less frequent - which I don't think anyone has disagreed with in any case. - kcrisman -- 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: snapshot saving
On Thu, Apr 23, 2009 at 4:34 PM, William Stein wst...@gmail.com wrote: Hi, I've written a patch against 3.4.1: http://trac.sagemath.org/sage_trac/ticket/5880 which simply greatly reduces the number of situations that result in snapshots. Basically, now you get them when you click save. There is no autosave. I think this is a really bad idea. It's inconvenient to manually save changes. Currently you have to scroll to the top. At least in Google Docs you can use CTRL-S. I much prefer your earlier suggestion of just keeping the last 30 snapshots. If we're going to get rid of auto-save, I think we should make it more convenient to manually save and have reminders to save. I used to use the notebook for tutoring and would loose work a lot and it was really annoying. This would just make things worst. Please try/test. -- William On Thu, Apr 23, 2009 at 6:29 AM, kcrisman kcris...@gmail.com wrote: I definitely agree with those who would keep snapshot. Having a list of commands is not the same - for one thing, log does not save the whole worksheet, only commands (i.e. not TinyMCE stuff); for another, it logs notebook-wide, so it becomes a bit of a jaunt to find stuff. That said, I also agree that, given log's presence, worksheet snapshots could be much less frequent - which I don't think anyone has disagreed with in any case. - kcrisman -- 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: snapshot saving
On Thu, Apr 23, 2009 at 2:13 PM, Timothy Clemans timothy.clem...@gmail.com wrote: On Thu, Apr 23, 2009 at 4:34 PM, William Stein wst...@gmail.com wrote: Hi, I've written a patch against 3.4.1: http://trac.sagemath.org/sage_trac/ticket/5880 which simply greatly reduces the number of situations that result in snapshots. Basically, now you get them when you click save. There is no autosave. I think this is a really bad idea. It's inconvenient to manually save changes. Currently you have to scroll to the top. At least in Google Docs you can use CTRL-S. I much prefer your earlier suggestion of just keeping the last 30 snapshots. If we're going to get rid of auto-save, I think we should make it more convenient to manually save and have reminders to save. I used to use the notebook for tutoring and would loose work a lot and it was really annoying. This would just make things worst. So with the current snapshot system you already lost a lot of work? Why? 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: snapshot saving
On Thu, Apr 23, 2009 at 5:14 PM, William Stein wst...@gmail.com wrote: On Thu, Apr 23, 2009 at 2:13 PM, Timothy Clemans timothy.clem...@gmail.com wrote: On Thu, Apr 23, 2009 at 4:34 PM, William Stein wst...@gmail.com wrote: Hi, I've written a patch against 3.4.1: http://trac.sagemath.org/sage_trac/ticket/5880 which simply greatly reduces the number of situations that result in snapshots. Basically, now you get them when you click save. There is no autosave. I think this is a really bad idea. It's inconvenient to manually save changes. Currently you have to scroll to the top. At least in Google Docs you can use CTRL-S. I much prefer your earlier suggestion of just keeping the last 30 snapshots. If we're going to get rid of auto-save, I think we should make it more convenient to manually save and have reminders to save. I used to use the notebook for tutoring and would loose work a lot and it was really annoying. This would just make things worst. So with the current snapshot system you already lost a lot of work? Why? The intervals were too big. For awhile users have been able to change the auto-save interval. I changed mine to 1. That really helped. 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] notebook very slow
Hi All, When I try to work on some of the tutorials (Calculus, Matrix algebra) sws files, then the notebook becomes extremely slow. Yesterday the notebook was crashing IE so I was asked to upgrade JRE. After the java upgrade, the notebook is very slow especially on big files like the calculus tutorial etc. It can't even evaluate cells with just var('x y') command. I use IE7 on Win XP SP3. I run Sage 3.2.3 Please help Thanks SG --~--~-~--~~~---~--~~ 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: notebook very slow
On Thu, Apr 23, 2009 at 2:40 PM, SG srikanth.gane...@gmail.com wrote: Hi All, When I try to work on some of the tutorials (Calculus, Matrix algebra) sws files, then the notebook becomes extremely slow. Yesterday the notebook was crashing IE so I was asked to upgrade JRE. After the java upgrade, the notebook is very slow especially on big files like the calculus tutorial etc. It can't even evaluate cells with just var('x y') command. I use IE7 on Win XP SP3. I run Sage 3.2.3 Please help You could start by switching to firefox, at least for Sage: www.mozilla.com/firefox/ William Thanks SG -- 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] Slackware/Zenwalk package
Greetings from Franconia. I tried to use the compiler to build Sage in my Zenwalk system (Zenwalk is based on Slackware Linux), but this time it did't work (might be due to the antique hardware I am using this time). I would like to put a request for a Zenwalk-package of Sage to the Zenwalk commulity, because I consider myself not experienced enough to build one. Would it be o.k. to do that, I mean concerning legal matters? Thanks --~--~-~--~~~---~--~~ 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: Slackware/Zenwalk package
On Apr 23, 4:28 pm, littlemathteacher relational...@gmail.com wrote: Greetings from Franconia. Hi, I tried to use the compiler to build Sage in my Zenwalk system (Zenwalk is based on Slackware Linux), but this time it did't work (might be due to the antique hardware I am using this time). Could you elaborate what happened, i.e. post a link to the compressed install.log from your build. I would like to put a request for a Zenwalk-package of Sage to the Zenwalk commulity, because I consider myself not experienced enough to build one. Would it be o.k. to do that, I mean concerning legal matters? Do you mean that the distribution packages and redistributes Sage? Yes, that is allowed and would be welcome from our end. Thanks Cheers, Michael --~--~-~--~~~---~--~~ 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: Slackware/Zenwalk package
Dear Michael, thanks. When I returned home this evening the process and the whole system seemed to be frozen as if by memory overload. I slowly tried to close some applications and among them accidentally was the bash in which I had opened the file manager (by su root) to cd into the sage folder in order to run the make - and by chain reaction the file manager and then the bash with the sage compilation closed. So I can't even say that the compilation literally crashed or froze, only that I am a little too stupid to let it do it's job. Maybe it was wrong to put it into the lib folder. I am still new to linux and this time a wanted sage not to live in any home directory. Which linux folder would you recommend to extract sage into? Maybe it was also wrong to run it from within a root bash while logged in as user (but in ubuntu I did it just this way). I made a compressed archive file out of the install.log and now I am thinking about where to save is so that it can be linked to. In the meantime maybe the last lines might be significant to you: [Code] make[5]: Entering directory `/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/interfaces/sage' /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H - I. -I../.. -I../.. -I. -I../../linbox -g -I/lib/sage/sage-3.4/local/ include/linbox -I/lib/sage/sage-3.4/local/include -O2 - DDISABLE_COMMENTATOR -I/lib/sage/sage-3.4/local/include -I/lib/sage/ sage-3.4/local/include -I/lib/sage/sage-3.4/local/include -g -fPIC - I/lib/sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/ include/linbox -L/lib/sage/sage-3.4/local/lib -I/lib/sage/sage-3.4/ spkg/build/linbox-1.1.6/src -I/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/linbox -I/lib/sage/sage-3.4/local/include -I/lib/ sage/sage-3.4/local/include -D__LINBOX_HAVE_CBLAS -c -o linbox-sage.lo linbox-sage.C mkdir .libs g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I. -I../../linbox -g -I/lib/ sage/sage-3.4/local/include/linbox -I/lib/sage/sage-3.4/local/include - O2 -DDISABLE_COMMENTATOR -I/lib/sage/sage-3.4/local/include -I/lib/ sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/include -g - fPIC -I/lib/sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/ include/linbox -L/lib/sage/sage-3.4/local/lib -I/lib/sage/sage-3.4/ spkg/build/linbox-1.1.6/src -I/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/linbox -I/lib/sage/sage-3.4/local/include -I/lib/sage/ sage-3.4/local/include -D__LINBOX_HAVE_CBLAS -c linbox-sage.C -fPIC - DPIC -o .libs/linbox-sage.o [End Code] But please don't put too much effort into helping me make sage run on this old notebook, Michael. I've got two other instances of sage running fine. And I am getting more and more familiar with using the sage notebook online. On the long run this might be better anyway for most purposes. Thanks again and have a nice evening (or whatever time it is now at your location)! Markus --~--~-~--~~~---~--~~ 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: Slackware/Zenwalk package
On Apr 23, 5:41 pm, littlemathteacher relational...@gmail.com wrote: Dear Michael, Hi Markus, thanks. When I returned home this evening the process and the whole system seemed to be frozen as if by memory overload. I slowly tried to close some applications and among them accidentally was the bash in which I had opened the file manager (by su root) to cd into the sage folder in order to run the make - and by chain reaction the file manager and then the bash with the sage compilation closed. So I can't even say that the compilation literally crashed or froze, only that I am a little too stupid to let it do it's job. Actually it just takes a while to build LinBox and its Sage extension if you have little, i.e. less than 300 or so MB memory available. This does depend on the gcc though an gcc 4.x is worst in that regard than gcc 3.4.x. Maybe it was wrong to put it into the lib folder. I am still new to linux and this time a wanted sage not to live in any home directory. Which linux folder would you recommend to extract sage into? Maybe it was also wrong to run it from within a root bash while logged in as user (but in ubuntu I did it just this way). I made a compressed archive file out of the install.log and now I am thinking about where to save is so that it can be linked to. In the meantime maybe the last lines might be significant to you: [Code] SNIP g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I. -I../../linbox -g -I/lib/ sage/sage-3.4/local/include/linbox -I/lib/sage/sage-3.4/local/include - O2 -DDISABLE_COMMENTATOR -I/lib/sage/sage-3.4/local/include -I/lib/ sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/include -g - fPIC -I/lib/sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/ include/linbox -L/lib/sage/sage-3.4/local/lib -I/lib/sage/sage-3.4/ spkg/build/linbox-1.1.6/src -I/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/linbox -I/lib/sage/sage-3.4/local/include -I/lib/sage/ sage-3.4/local/include -D__LINBOX_HAVE_CBLAS -c linbox-sage.C -fPIC - DPIC -o .libs/linbox-sage.o [End Code] I have seen this one take 8 hour on a PS3 since it has only about 220 MB physical RAM available, so no surprises there. But please don't put too much effort into helping me make sage run on this old notebook, Michael. I've got two other instances of sage running fine. And I am getting more and more familiar with using the sage notebook online. On the long run this might be better anyway for most purposes. Yes, I would recommend to use a remove Sage server in this case :) Thanks again and have a nice evening (or whatever time it is now at your location)! Thanks, and the same to you. Markus Cheers, Michael --~--~-~--~~~---~--~~ 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: Slackware/Zenwalk package
Hi Markus, On Fri, Apr 24, 2009 at 12:41 AM, littlemathteacher relational...@gmail.com wrote: Dear Michael, thanks. When I returned home this evening the process and the whole system seemed to be frozen as if by memory overload. I slowly tried to close some applications and among them accidentally was the bash in which I had opened the file manager (by su root) to cd into the sage folder in order to run the make - and by chain reaction the file manager and then the bash with the sage compilation closed. So I can't even say that the compilation literally crashed or froze, only that I am a little too stupid to let it do it's job. Maybe it was wrong to put it into the lib folder. I am still new to linux and this time a wanted sage not to live in any home directory. Which linux folder would you recommend to extract sage into? Maybe it was also wrong to run it from within a root bash while logged in as user (but in ubuntu I did it just this way). Over a year ago, I was trying to compile Sage and running all the tests under Slackware 10.0 on an old IBM Thinkpad (perhaps R40?). At first the compilation failed due to system resource issues. But I edited my /etc/inittab to boot into a text based session, rather than a graphical session such as Gnome, KDE or XFCE. So after logging into a text based session as a normal user, I was able to successfully compile Sage. It took about 2 to 3 hours, though. For what it's worth, I've written up my work around on the Sage wiki at http://wiki.sagemath.org/faq#Otherquestions The work around is explained in response to the question When I compile Sage my computer beeps and shuts down or hangs. I made a compressed archive file out of the install.log and now I am thinking about where to save is so that it can be linked to. In the meantime maybe the last lines might be significant to you: [Code] make[5]: Entering directory `/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/interfaces/sage' /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H - I. -I../.. -I../.. -I. -I../../linbox -g -I/lib/sage/sage-3.4/local/ include/linbox -I/lib/sage/sage-3.4/local/include -O2 - DDISABLE_COMMENTATOR -I/lib/sage/sage-3.4/local/include -I/lib/sage/ sage-3.4/local/include -I/lib/sage/sage-3.4/local/include -g -fPIC - I/lib/sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/ include/linbox -L/lib/sage/sage-3.4/local/lib -I/lib/sage/sage-3.4/ spkg/build/linbox-1.1.6/src -I/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/linbox -I/lib/sage/sage-3.4/local/include -I/lib/ sage/sage-3.4/local/include -D__LINBOX_HAVE_CBLAS -c -o linbox-sage.lo linbox-sage.C mkdir .libs g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I. -I../../linbox -g -I/lib/ sage/sage-3.4/local/include/linbox -I/lib/sage/sage-3.4/local/include - O2 -DDISABLE_COMMENTATOR -I/lib/sage/sage-3.4/local/include -I/lib/ sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/include -g - fPIC -I/lib/sage/sage-3.4/local/include -I/lib/sage/sage-3.4/local/ include/linbox -L/lib/sage/sage-3.4/local/lib -I/lib/sage/sage-3.4/ spkg/build/linbox-1.1.6/src -I/lib/sage/sage-3.4/spkg/build/ linbox-1.1.6/src/linbox -I/lib/sage/sage-3.4/local/include -I/lib/sage/ sage-3.4/local/include -D__LINBOX_HAVE_CBLAS -c linbox-sage.C -fPIC - DPIC -o .libs/linbox-sage.o [End Code] But please don't put too much effort into helping me make sage run on this old notebook, Michael. I've got two other instances of sage running fine. And I am getting more and more familiar with using the sage notebook online. On the long run this might be better anyway for most purposes. Thanks again and have a nice evening (or whatever time it is now at your location)! -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: derivative of a composition
Hmm, implementing the chain rule is trickier than i thought. My straightforward plan of attack was to write a function that differentiates a symbolic expression as usual but when it comes to a composition f o g, it uses the chain rule and returns the appropriate entry of the matrix (Df o g)Dg. Problems: (a) How do you split apart a symbolic expression to scan for compositions? (b) How do you construct Df so that you can compose it with g? Both thwart me and my white belt Sage-fu. Any helpful suggestions for (a), (b), or the general project? Alex On Apr 23, 1:43 pm, Alex Raichev tortoise.s...@gmail.com wrote: Never mind. I'll just right a short recursive function. It's easy enough. Alex On Apr 23, 11:10 am, Alex Raichev tortoise.s...@gmail.com wrote: Hi all: Do any of you know how to get Sage to use the chain rule and expand the derivative of a composition involving one or two callable symbolic functions? Here's an example with one callable symbolic function. -- | Sage Version 3.4, Release Date: 2009-03-11 | | Type notebook() for the GUI, and license() for information. | -- sage: var('x,y,t') (x, y, t) sage: f= function('f',x,y) sage: g= exp(I*t) sage: diff(f(g,g^2),t).expand() diff(f(e^(I*t), e^(2*I*t)), t, 1) The reason i ask is that i have to take higher-order derivatives of a composition f o g of two callable symbolic multivariate functions. I want the expanded form so that i can evaluate at a certain point c and solve a linear system to get the derivatives of f at g(c). (I know the values of the derivatives f o g and g at c.) I could write a Sage function to expand the derivatives of f o g using Faà di Bruno's formula, but before i do so, i was wondering if there's an easier way. Alex --~--~-~--~~~---~--~~ 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: derivative of a composition
On Thu, Apr 23, 2009 at 7:18 PM, Alex Raichev tortoise.s...@gmail.com wrote: Hmm, implementing the chain rule is trickier than i thought. My straightforward plan of attack was to write a function that differentiates a symbolic expression as usual but when it comes to a composition f o g, it uses the chain rule and returns the appropriate entry of the matrix (Df o g)Dg. Problems: (a) How do you split apart a symbolic expression to scan for compositions? (b) How do you construct Df so that you can compose it with g? Both thwart me and my white belt Sage-fu. Any helpful suggestions for (a), (b), or the general project? Alex Picking apart expressions will change significantly soon in Sage, when we switch over to using Pynac for basic symbolic manipulation. The plan is to do this switch by May 15. -- William On Apr 23, 1:43 pm, Alex Raichev tortoise.s...@gmail.com wrote: Never mind. I'll just right a short recursive function. It's easy enough. Alex On Apr 23, 11:10 am, Alex Raichev tortoise.s...@gmail.com wrote: Hi all: Do any of you know how to get Sage to use the chain rule and expand the derivative of a composition involving one or two callable symbolic functions? Here's an example with one callable symbolic function. -- | Sage Version 3.4, Release Date: 2009-03-11 | | Type notebook() for the GUI, and license() for information. | -- sage: var('x,y,t') (x, y, t) sage: f= function('f',x,y) sage: g= exp(I*t) sage: diff(f(g,g^2),t).expand() diff(f(e^(I*t), e^(2*I*t)), t, 1) The reason i ask is that i have to take higher-order derivatives of a composition f o g of two callable symbolic multivariate functions. I want the expanded form so that i can evaluate at a certain point c and solve a linear system to get the derivatives of f at g(c). (I know the values of the derivatives f o g and g at c.) I could write a Sage function to expand the derivatives of f o g using Faà di Bruno's formula, but before i do so, i was wondering if there's an easier way. Alex -- 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: snapshot saving
On Apr 22, 5:36 pm, William Stein wst...@gmail.com wrote: Does anybody here ever use snapshots? I have never used a snapshot, that I am aware of. I've lost a cell or two due to crashes, but I think this was always due to my flaky USB hard drive setup and not Sage's fault. And it was always just messing around while writing lecture notes, or something similarly not too important. I like the way the proposed patch wipes the slate fairly clean. But I sort of hope it is temporary and at some point a rational autosave strategy of some sort is implemented.There was an attempt to not create a snapshot if there were no changes, but I don't think that worked as advertised. And the auto-save interval was more like save if there is a trigger and it has been *longer* than the interval It would be nice if (a) autosave, or not, was user-configurable from the notebook settings by user (b) autosave interval could be set to *any* integer number of seconds/ minutes (maybe 0 means don't) in notebook settings (c) There really weren't ever identical snapshots created (d) William's idea of phased snapshots (fewer as they age) was implemented since it is a good idea. Is it problematic to spawn a thread that just sleeps for an interval and then wakes up to consider making a snapshot? Anyway, this isn't meant to be a proposal, just the suggestion that if properly designed, then a useful, unobtrusive backup system should be possible. I hope to review William's patch soon, but will let this thread run its course first. Rob --~--~-~--~~~---~--~~ 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: derivative of a composition
Thanks for the news, William. I will hold off on this chain rule business till the new symbolics arrive. Alex On Apr 24, 3:43 pm, William Stein wst...@gmail.com wrote: On Thu, Apr 23, 2009 at 7:18 PM, Alex Raichev tortoise.s...@gmail.com wrote: Hmm, implementing the chain rule is trickier than i thought. My straightforward plan of attack was to write a function that differentiates a symbolic expression as usual but when it comes to a composition f o g, it uses the chain rule and returns the appropriate entry of the matrix (Df o g)Dg. Problems: (a) How do you split apart a symbolic expression to scan for compositions? (b) How do you construct Df so that you can compose it with g? Both thwart me and my white belt Sage-fu. Any helpful suggestions for (a), (b), or the general project? Alex Picking apart expressions will change significantly soon in Sage, when we switch over to using Pynac for basic symbolic manipulation. The plan is to do this switch by May 15. -- William On Apr 23, 1:43 pm, Alex Raichev tortoise.s...@gmail.com wrote: Never mind. I'll just right a short recursive function. It's easy enough. Alex On Apr 23, 11:10 am, Alex Raichev tortoise.s...@gmail.com wrote: Hi all: Do any of you know how to get Sage to use the chain rule and expand the derivative of a composition involving one or two callable symbolic functions? Here's an example with one callable symbolic function. -- | Sage Version 3.4, Release Date: 2009-03-11 | | Type notebook() for the GUI, and license() for information. | -- sage: var('x,y,t') (x, y, t) sage: f= function('f',x,y) sage: g= exp(I*t) sage: diff(f(g,g^2),t).expand() diff(f(e^(I*t), e^(2*I*t)), t, 1) The reason i ask is that i have to take higher-order derivatives of a composition f o g of two callable symbolic multivariate functions. I want the expanded form so that i can evaluate at a certain point c and solve a linear system to get the derivatives of f at g(c). (I know the values of the derivatives f o g and g at c.) I could write a Sage function to expand the derivatives of f o g using Faà di Bruno's formula, but before i do so, i was wondering if there's an easier way. Alex -- William Stein Associate Professor of Mathematics University of Washingtonhttp://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] A problem with the simplify command
Hi all: I am using Sage Version 3.4, Release Date: 2009-03-11. I asked Sage to simplify the following expression: -q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 + 1) *x2^2 + sqrt(q) by calling the simplify command: simplify(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)* (q^2 + 1)*x2^2 + sqrt(q)) but the output was exactly the same as what I put in. In my code ahead of this I have R=PolynomialRing(ZZ,'q') var('q') Any suggestions would be much appreciated. Thanks, Dylan --~--~-~--~~~---~--~~ 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: A problem with the simplify command
On Apr 23, 2009, at 9:32 PM, drupel wrote: Hi all: I am using Sage Version 3.4, Release Date: 2009-03-11. I asked Sage to simplify the following expression: -q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 + 1) *x2^2 + sqrt(q) by calling the simplify command: simplify(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)* (q^2 + 1)*x2^2 + sqrt(q)) but the output was exactly the same as what I put in. In my code ahead of this I have R=PolynomialRing(ZZ,'q') var('q') Any suggestions would be much appreciated. It's unclear what you want simplify to do. Maybe you could try expand or factor. - Robert --~--~-~--~~~---~--~~ 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: A problem with the simplify command
Hi Dylan, On Fri, Apr 24, 2009 at 4:32 AM, drupel dylanru...@gmail.com wrote: Hi all: I am using Sage Version 3.4, Release Date: 2009-03-11. I asked Sage to simplify the following expression: -q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 + 1) *x2^2 + sqrt(q) by calling the simplify command: simplify(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)* (q^2 + 1)*x2^2 + sqrt(q)) but the output was exactly the same as what I put in. In my code ahead of this I have R=PolynomialRing(ZZ,'q') var('q') Any suggestions would be much appreciated. Try this: [mv...@sage ~]$ sage -- | Sage Version 3.4.1, Release Date: 2009-04-21 | | Type notebook() for the GUI, and license() for information.| -- sage: q, x2 = var(q, x2) sage: simplify(expand(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 q^(3/2)*x2^2 + sqrt(q) -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: A problem with the simplify command
On Fri, Apr 24, 2009 at 4:37 AM, Minh Nguyen nguyenmi...@gmail.com wrote: Hi Dylan, On Fri, Apr 24, 2009 at 4:32 AM, drupel dylanru...@gmail.com wrote: Hi all: I am using Sage Version 3.4, Release Date: 2009-03-11. I asked Sage to simplify the following expression: -q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 + 1) *x2^2 + sqrt(q) by calling the simplify command: simplify(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)* (q^2 + 1)*x2^2 + sqrt(q)) but the output was exactly the same as what I put in. In my code ahead of this I have R=PolynomialRing(ZZ,'q') var('q') Any suggestions would be much appreciated. Try this: Should be this [mv...@sage ~]$ sage -- | Sage Version 3.4.1, Release Date: 2009-04-21 | | Type notebook() for the GUI, and license() for information.| -- sage: q, x2 = var(q, x2) sage: simplify(expand(-q^(5/2)*(q^2*x2^4 + q*x2^2) + q^(9/2)*x2^4 + q^(3/2)*(q^2 + 1)*x2^2 + sqrt(q))) q^(3/2)*x2^2 + sqrt(q) Sorry about the noise. -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---