[sympy] Re: symbolic matrix differentiaton

2011-06-30 Thread Amit
Hello Sherjil, Sorry for the misunderstanding, it isn't a line of code but latex math expression (or at least supposed to be :-)) An example (in latex syntax) would be: \partial(X^{-1}) = - X^{-1}(\partial X ) X^{-1} Thanks, Amit On Jun 30, 9:21 am, SherjilOzair wrote: > Hello Amit, > The line

[sympy] Re: symbolic matrix differentiaton

2011-06-30 Thread Amit
Hello Aaron, Thanks for pointing out this thread (I did search the group but missed it): http://groups.google.com/group/sympy/browse_thread/thread/7a4ab2af17b3c10d/90ba1a6bebb59eb9 I am talking about a similar idea but I am looking also for calculus operations like differentiation. Thanks, Amit

[sympy] Re: Matrix Symbol

2011-06-30 Thread Amit
Hi, I am not familiar with the internals of sympy. But I suggest that if you start working on the implementation of symbolic matrices, you should take into consideration more complicated operators like differentiation. 'The Matrix Cookbook' has many matrix equalities that maybe can be implemented

Re: [sympy] Re: symbolic matrix differentiaton

2011-06-30 Thread Aaron Meurer
By the way, if you don't actually need any specific attributes of matrices other than non-commutativity (and you're assuming everything is square n x n), you can already do this in SymPy: In [10]: a, b = symbols('a b', commutative=False) In [15]: diff(f(a)*g(a), a) Out[15]: d d f(a)

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Aaron Meurer
As I pointed out in the other thread, non-commutative differentiation already works in SymPy, so doing this should not be difficult. Aaron Meurer On Thu, Jun 30, 2011 at 1:58 AM, Amit wrote: > Hi, > > I am not familiar with the internals of sympy. But I suggest that if > you start working on the

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Alan Bromborsky
Differentiation would only work with a scalar (communicative) differentiation operator. If the matrix function is a function of a vector or matrix one would have to define the directional derivative for each case (which would be a scalar differential operator) and use the results of that opera

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Matthew Rocklin
I agree that support for derivatives on matrices is important; I would like this myself. I haven't thought much about it in the context of SymPy before though so thank you for bringing it up. I haven't solidified my understanding of this problem but it seems like there are a few concepts of a deri

Re: [sympy] Tuple and Dict

2011-06-30 Thread Chris Smith
Thanks for the details. The link is http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2011-the-data-structures-of-python-4898160 -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscr

[sympy] Re: __init__ and __new__

2011-06-30 Thread Adam Moore
Ok, that make sense, thanks for the quick reply! Adam On Jun 29, 12:16 pm, Mateusz Paprocki wrote: > Hi, > > On 29 June 2011 18:53, Adam Moore wrote: > > > Ok, so I've been trying to understand how SmyPy performs basic > > simplification. I've traced through to when __add__(self, other) is > >

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Aaron Meurer
On Thu, Jun 30, 2011 at 7:17 AM, Matthew Rocklin wrote: > I agree that support for derivatives on matrices is important; I would like > this myself. I haven't thought much about it in the context of SymPy before > though so thank you for bringing it up. > I haven't solidified my understanding of t

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Matthew Rocklin
Where is the best place to read about the new assumptions system? On Thu, Jun 30, 2011 at 1:18 PM, Aaron Meurer wrote: > On Thu, Jun 30, 2011 at 7:17 AM, Matthew Rocklin > wrote: > > I agree that support for derivatives on matrices is important; I would > like > > this myself. I haven't thought

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Ronan Lamy
Le jeudi 30 juin 2011 à 13:25 -0500, Matthew Rocklin a écrit : > Where is the best place to read about the new assumptions system? I'm afraid that the best place is the source code in sympy/assumptions/. I'm not aware of any comprehensive and current write-up on the new assumptions. > > On Thu, J

Re: [sympy] Tuple and Dict

2011-06-30 Thread Matthew Rocklin
My understanding is that I can either use abstract base classes or maintaining 2.5 compatibility. I assume 2.5 takes precedence. What should I do with this branch? On Thu, Jun 30, 2011 at 8:40 AM, Chris Smith wrote: > Thanks for the details. The link is > > > http://blip.tv/pycon-us-videos-2009

[sympy] Using pattern matching with Expr's

2011-06-30 Thread Sean Vig
Hi everyone, For a part of my project I tried using pattern matching with .match and Wild, as described here http://docs.sympy.org/0.7.0/tutorial.html#pattern-matching, to match some instances of a class I am working on, however it does not currently work as I'd hoped in trying to match objects of

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread François
I had a quick look at it. I think it goes down better than sympy-0.6.7, there are a few minor doctests to fix (some answers are now x+2 instead of 2+x) but some code in sage needs adjusting before we ship: File "/usr/share/sage/devel/sage-main/sage/calculus/test_sympy.py", line 294, in __main__.

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
I assume you mean doctests in sage. If you're referring to a doctest in SymPy, please point it out to us, as to our knowledge there are none in the release. And let us know if it's necessary to patch SymPy, so we can fix it upstream. Oh, and I happen to know that Sage uses symbols(each_char=Fals

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
Oh, and if this version works better in Sage than the previous one, it's because we actually ran the Sage tests before releasing this time :) (there were a ton of errors, many existing before the previous release or two). Aaron Meurer On Thu, Jun 30, 2011 at 4:44 PM, Aaron Meurer wrote: > I assu

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Francois Bissey
> I assume you mean doctests in sage. If you're referring to a doctest > in SymPy, please point it out to us, as to our knowledge there are > none in the release. > I meant in sage. No issue in sympy. sympy-0.6.6 works fine with sage, 0.6.7 doesn't and the stuff that I pasted is the only thing o

Re: [sympy] Re: Matrix Symbol

2011-06-30 Thread Aaron Meurer
There's some info at http://docs.sympy.org/0.7.0/modules/assumptions.html. Aaron Meurer On Thu, Jun 30, 2011 at 12:35 PM, Ronan Lamy wrote: > Le jeudi 30 juin 2011 à 13:25 -0500, Matthew Rocklin a écrit : >> Where is the best place to read about the new assumptions system? > > I'm afraid that th

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
By the way, this is because we (finally) changed the default ordering in the printer to lexicographic (no more "backwards" 2 + x). Regarding the test failure, it's a little hard to tell what's going on from the traceback (and with no knowledge of Sage code), but it's perhaps caused by the fact tha

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Francois Bissey
> By the way, this is because we (finally) changed the default ordering > in the printer to lexicographic (no more "backwards" 2 + x). > > Regarding the test failure, it's a little hard to tell what's going on > from the traceback (and with no knowledge of Sage code), but it's > perhaps caused by

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
Looking deeper, I think the problem might be with S.NegativeInfinity._sage_: In [48]: source((-oo)._sage_) In file: ./sympy/core/numbers.py def _sage_(self): import sage.all as sage #XXX: fixme, this should work: #return sage.Integer(self[0])/sage.Integer(self[1])

Re: [sympy] Using pattern matching with Expr's

2011-06-30 Thread Aaron Meurer
What does your CG subclass from? If it's a Function, I think it should automatically work, like In [50]: a = Wild('a') In [51]: f(1, 2).match(f(a, 2)) Out[51]: {a: 1} Aaron Meurer On Thu, Jun 30, 2011 at 3:04 PM, Sean Vig wrote: > Hi everyone, > For a part of my project I tried using pattern

Re: [sympy] Tuple and Dict

2011-06-30 Thread Aaron Meurer
Well, you are right that we can't break Python 2.5 compatibility. However, both abc and collections are written in Python, so we could copy the necessary code to compatibility.py if necessary. For example, do import abc import _abcoll # The abc collections are actually here source(abc) source(_a

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Francois Bissey
> Looking deeper, I think the problem might be with > S.NegativeInfinity._sage_: > > In [48]: source((-oo)._sage_) > In file: ./sympy/core/numbers.py > def _sage_(self): > import sage.all as sage > #XXX: fixme, this should work: > #return sage.Integer(self[0])/sage.Inte

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
On Thu, Jun 30, 2011 at 5:57 PM, Francois Bissey wrote: >> Looking deeper, I think the problem might be with >> S.NegativeInfinity._sage_: >> >> In [48]: source((-oo)._sage_) >> In file: ./sympy/core/numbers.py >> def _sage_(self): >> import sage.all as sage >> #XXX: fixme, thi

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Francois Bissey
> I think I found it: > class Infinity(RationalConstant): > __metaclass__ = Singleton > > defines > def _sage_(self): > import sage.all as sage > return sage.oo > > But: > class NegativeInfinity(RationalConstant): > __metaclass__ = Singleton > > doesn't have an equiva

Re: [sympy] Using pattern matching with Expr's

2011-06-30 Thread Sean Vig
CG subclasses from AtomicExpr. On Thu, Jun 30, 2011 at 18:50, Aaron Meurer wrote: > What does your CG subclass from? If it's a Function, I think it > should automatically work, like > > In [50]: a = Wild('a') > > In [51]: f(1, 2).match(f(a, 2)) > Out[51]: {a: 1} > > Aaron Meurer > > On Thu, Jun

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
OK. I will send in a patch to SymPy that fixes this upstream. Aaron Meurer On Thu, Jun 30, 2011 at 6:05 PM, Francois Bissey wrote: >> I think I found it: >> class Infinity(RationalConstant): >> __metaclass__ = Singleton >> >> defines >> def _sage_(self): >> import sage.all as sa

Re: [sympy] Using pattern matching with Expr's

2011-06-30 Thread Ronan Lamy
Le jeudi 30 juin 2011 à 19:12 -0500, Sean Vig a écrit : > CG subclasses from AtomicExpr. Why did you choose that? "Atomic" means that it's not made up of other sympy objects and that methods like .match() will therefore not recurse inside your object. So if you can derive directly from Expr instea

Re: [sympy] Using pattern matching with Expr's

2011-06-30 Thread Sean Vig
I guess I didn't know what Atomic meant; thanks for pointing that out, it works fine now. Sean On Thu, Jun 30, 2011 at 19:57, Ronan Lamy wrote: > Le jeudi 30 juin 2011 à 19:12 -0500, Sean Vig a écrit : > > CG subclasses from AtomicExpr. > > Why did you choose that? "Atomic" means that it's not

Re: [sympy] SymPy 0.7.0 Released

2011-06-30 Thread Aaron Meurer
See https://github.com/sympy/sympy/pull/474. Aaron Meurer On Thu, Jun 30, 2011 at 6:14 PM, Aaron Meurer wrote: > OK.  I will send in a patch to SymPy that fixes this upstream. > > Aaron Meurer > > On Thu, Jun 30, 2011 at 6:05 PM, Francois Bissey > wrote: >>> I think I found it: >>> class Infini

[sympy] MathJax for the Sphinx docs

2011-06-30 Thread Aaron Meurer
Hi. I just discovered how to use MathJax in our Sphinx docs, and it's really easy. You just have to copy a file to the doc/src directory and make a couple of changes to the conf.py file. I have done this at my mathjax branch (https://github.com/asmeurer/sympy/tree/mathjax). More information (als

[sympy] Re: MathJax for the Sphinx docs

2011-06-30 Thread Aaron Meurer
I've made this easer for people who just want to play around with what it looks like by pushing a demo up to docs.sympy.org. Go to http://docs.sympy.org/mathjax/ and navigate to a LaTeX intensive page (the mpmath function pages are good examples). Then compare against the same page replacing "math

[sympy] Re: MathJax for the Sphinx docs

2011-06-30 Thread Aaron Meurer
I just tried this on my iPod touch, and it works. It takes a little while to render the math, due to the slower processor, but once it does, it's worth it, because it's way crisper when you zoom in, which you tend to do a lot on these mobile devices with their small screens. And anyway, like I sa

Re: [sympy] Re: MathJax for the Sphinx docs

2011-06-30 Thread Brian Granger
We are using MathJax for the new IPython notebook and it is really great, so I think this would be a good move. Is there anyway of getting latex output in the sympy code samples? Cheers, Brian On Thu, Jun 30, 2011 at 11:11 PM, Aaron Meurer wrote: > I just tried this on my iPod touch, and it w

Re: [sympy] Re: MathJax for the Sphinx docs

2011-06-30 Thread Aaron Meurer
You mean the docstrings? I'm not sure. Sphinx doesn't seem to be built to combine rendered math and doctests. If you add something like >>> something `\pi` or >>> something :math:`\pi` in a doctest, it will just render it as >>> something \(\pi\) So it doesn't seem like it would be as easy

Re: [sympy] Re: MathJax for the Sphinx docs

2011-06-30 Thread Aaron Meurer
I figured out why some documents give "Undefined control sequence" errors. In conf.py there is a pngmath_latex_preamble, which defines a bunch of \newcommands that are recognized by pngmath and math_dollar, but not mathjax. There isn't anything in the mathjax sphinx extension docs or the mathjax.