DOC
factor() takes a polynomial and factors it into irreducible factors over the rational numbers. For example:
https://docs.sympy.org/latest/tutorials/intro-tutorial/simplification.html#factor
sympyの Matrix.inv()のfactor()
# ver0.1
from sympy import *
var('a,b,c,d',real=True)
A=Matrix([[a,b],[c,d]])
print("#", A )
print("#", A.inv() )
print("#", factor(A.inv()) )
# print("#", (A.inv()).factor()) # エラーがでます。
# print("#", A.inv() .factor()) # エラーがでます。
# Matrix([[a, b], [c, d]])
# Matrix([[d/(a*d - b*c), -b/(a*d - b*c)], [-c/(a*d - b*c), a/(a*d - b*c)]])
# Matrix([[d/(a*d - b*c), -b/(a*d - b*c)], [-c/(a*d - b*c), a/(a*d - b*c)]])
# AttributeError: 'MutableDenseMatrix' object has no attribute 'factor'
# AttributeError: 'MutableDenseMatrix' object has no attribute 'factor'