2

I'm familiar with sympy, the matlab symbolic package, reduce, and have tried out a few other computer algebra systems. However, as far as I can tell, none of them seem to be able to do algebra on variable sized matrices - they can only work with fixed sized matrices.

Are there any that can do algebra for variable sized matrices? I understand there would be quite a few gross cases but I feel like there is a significant amount that is doable simply because of the ease of many simplifications/algebra one can do by hand in with matrices in R^nxn.

It is possible to just work with non-communiative algebraic elements in many of these, and so that covers addition and Hadamard product with matrices, which is useful and a start. However it covers a very small portion of what one actually does with matrices (say, transpose, inverses, eigenvalue decomposition, using matrices in R^nxm, etc.). Does any more general software exist?

Phylliida
  • 4,217
  • 3
  • 22
  • 34
  • i've often wondered this but never got around to asking – Sean Nov 21 '15 at 00:57
  • I reposted this question [here](http://mathoverflow.net/questions/224188/computer-algebra-systems-that-support-variable-sized-matrices) for anyone that is interested. – Phylliida Nov 21 '15 at 17:39

1 Answers1

0

SymPy has a matrix expressions module that does this. Example:

>>> from sympy import MatrixSymbol, Matrix, symbols
>>> n, m = symbols('n m', integer=True)
>>> X = MatrixSymbol('X', n, m)
>>> Y = MatrixSymbol('Y', m, n)
>>> (X*Y).T
Y'*X'

Matrix expressions can have symbolic sizes (like n and m) or explicit integer sizes, in which case they can be combined with explicit matrices.

It's also worth noting that there are a lot of things that aren't documented in the doc page I linked to, so take a look at https://github.com/sympy/sympy/tree/master/sympy/matrices/expressions for the full functionality.

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • You can also look at this [talk](https://www.youtube.com/watch?v=nVt24G_2VC0) which uses this module, along with some modules that are separate from SymPy. – asmeurer Nov 23 '15 at 17:27