Ask Your Question

Revision history [back]

These are two different methods, with the same name, on different classes (symbolic expressions and symbolic dense matrices respectively). The documentation for the matrix method does not mention keyword arguments, and indeed none are accepted, as you have seen. As an alternative you can apply the symbolic expression method to each entry:

sage: var('a,b')
sage: m=matrix(SR,2,[[(a*b-a)/a,0],[0,1]])
sage: m.apply_map(lambda z: z.simplify_rational(algorithm='simple'))
[b - 1     0]
[    0     1]

It would be nice if the matrix method accepted the same arguments. If you want, someone could open an enhancement ticket on trac.