sympy/sympy — pull request #1965 by mrocklin (2013-04-03 18:23:15+00:00)
Title: Theano matrix printing and Derivative

Two somewhat separate contributions

1. Uses `theano.Rop` for derivatives rather than `theano.grad`. This is more robust
2. Adds theano translations for MatrixSlice (Subtensor) and BlockMatrix (join)
3. Extends `block_collapse` functionality to transposes and inverses.
4. Improve the application strategy for `block_collapse`. Use `bottom_up` rather than `top_down` and put in a short circuit to check for BlockMatrix elements.

As a result of 2 and 3 I can execute most (all?) of Matrix expressions through Theano. I can also build blocked computations pretty smoothly well.