I have two small but very complicated matrices that I want to multiply. I've done this using sympy:
C=sympy.MatMul(A,B,hold=True)
This gives me a MatMul object which saves a huge amount of time, and I'm not interested in a symbolic expression anyway, rather I want to evaluate at specific points later on.
If this was the end of my calculation it would be fine, but I then need to use elements of C in order to define a new equation, however, I cannot index it. I get the following,
In [286]: C[0]
Traceback (most recent call last):
File "<ipython-input-286-829e2440bf19>", line 1, in <module>
C[0]
File "C:\Anaconda3\lib\site-packages\sympy\matrices\expressions\matexpr.py", line 242, in __getitem__
raise IndexError("Single index only supported for "
IndexError: Single index only supported for non-symbolic matrix shapes.
Is it possible to somehow index such an object? For example, in maple I can use a semi-colon which suppresses the output, while retaining information about the structure of the resulting object so I can index it.