On Dec 31, 2007 9:00 PM, Mike Hansen <[EMAIL PROTECTED]> wrote: > > Hello, > > Sympy provides it's own matrices. As mentioned before, there needs to > be more work done with sympy in Sage so that what you tried does work. > In the meantime, look at the following example: > > sage: import sympy > sage: x = sympy.Symbol('x') > sage: m = sympy.Matrix([[1,x],[x,1]]) > sage: m > 1 x > x 1 > sage: m^int(2) > 1 + x**2 2*x > 2*x 1 + x**2
BTW, we just fixed this ugly output of matrices in sympy, but I didn't yet update the spkg. > But sympy is still way faster and is symbolic: > > sage: from sympy import Symbol, sin > sage: x = Symbol('x') > sage: time sum(((x+sin(i))/x+(x-sin(i))/x).expand() for i in xrange(100)) > 200 > Time: CPU 0.09 s, Wall: 0.09 s > > which is why it's a good thing that sympy is the future of symbolic > computation in Sage :-). I think those timings are wrong, because sympy uses caching: sage: from sympy import Symbol, sin sage: x = Symbol('x') sage: time sum(((x+sin(i))/x+(x-sin(i))/x).expand() for i in xrange(100)) CPU times: user 0.57 s, sys: 0.00 s, total: 0.57 s Wall time: 0.57 200 sage: time sum(((x+sin(i))/x+(x-sin(i))/x).expand() for i in xrange(100)) CPU times: user 0.10 s, sys: 0.00 s, total: 0.10 s Wall time: 0.09 200 See my previous email in this thread for more accurate timings. Anyway, if you find any bugs in SymPy, please report them to sympy, so that we can fix them. Ondrej --~--~---------~--~----~------------~-------~--~----~ 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/ -~----------~----~----~----~------~----~------~--~---