This is a bug. In master, I get a different error
Traceback (most recent call last):
File "<mypython-4>", line 1, in <module>
B.inv()
File "./sympy/matrices/matrices.py", line 2797, in inv
return self._eval_inverse(**kwargs)
File "./sympy/matrices/dense.py", line 260, in _eval_inverse
rv = M.inverse_GE(iszerofunc=iszerofunc)
File "./sympy/matrices/matrices.py", line 2710, in inverse_GE
red = big.rref(iszerofunc=iszerofunc, simplify=True)[0]
File "./sympy/matrices/matrices.py", line 889, in rref
normalize_last=normalize_last)
File "./sympy/matrices/matrices.py", line 544, in _eval_rref
zero_above=True)
File "./sympy/matrices/matrices.py", line 660, in _row_reduce
get_col(piv_col)[piv_row:], iszerofunc, simpfunc)
File "./sympy/matrices/matrices.py", line 4130, in _find_reasonable_pivot
if x.equals(S.Zero):
File "./sympy/core/expr.py", line 657, in equals
constant = diff.is_constant(simplify=False, failing_number=True)
File "./sympy/core/expr.py", line 606, in is_constant
deriv = expr.diff(w)
File "./sympy/core/expr.py", line 2967, in diff
return Derivative(self, *new_symbols, **assumptions)
File "./sympy/core/function.py", line 1137, in __new__
if v._diff_wrt:
AttributeError: 'MatrixSymbol' object has no attribute '_diff_wrt'
Also, ideally you would be able to just do MatrixSymbol('b', 3,
3).inv().as_explicit(), but apparently that doesn't work either.
I have opened
https://github.com/sympy/sympy/issues/13541 for this.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/sympy.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/c0ca19a8-4269-bac2-74dc-99283d3f5305%40grinta.net.
> For more options, visit
https://groups.google.com/d/optout.