ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 15 Feb 2020 11:03:18 -0600<symbolic matrix>.simplify_rational() accepts no keywords?http://ask.sagemath.org/question/49934/symbolic-matrixsimplify_rational-accepts-no-keywords/I have a symbolic matrix whose entries I would like to simplify for display. Minimal working example (in the `sage` REPL):
```
a,b=var('a,b'); m=matrix(SR,2,[[(a*b-a)/a,0],[0,1]]).simplify_rational()
```
works fine and upon calling `m` produces
```[b - 1 0]
[ 0 1]
```
as expected. On the other hand, running
```
a,b=var('a,b'); m=matrix(SR,2,[[(a*b-a)/a,0],[0,1]]).simplify_rational(algorithm='simple')
```
as per the documentation produces
TypeError Traceback (most recent call last)
<ipython-input-30-3edf7642200d> in <module>()
----> 1 a,b=var('a,b'); m=matrix(SR,Integer(2),[[(a*b-a)/a,Integer(0)],[Integer(0),Integer(1)]]).simplify_rational(algorithm='simple')
TypeError: simplify_rational() takes no keyword argument
If I apply the method to a *single* expression it works fine:
```
((a*b-a)/a).simplify_rational(algorithm='simple')
```
gives back `b-1`.
grobberSat, 15 Feb 2020 11:03:18 -0600http://ask.sagemath.org/question/49934/Optimal method to invert symbolic matrixhttp://ask.sagemath.org/question/47401/optimal-method-to-invert-symbolic-matrix/ If I read the source code correctly, a matrix defined over SR is inverted by the Moore-Penrose pseudo-inversion. For a real, symmetric, symbolic, full-rank matrix, is this algorithm optimal? Or is there another algorithm that would be a) less memory intensive, and/or b) less time-consuming. [In my particular case, the attempted inversion of a 4x4 matrix runs out of memory (8 GB) after approximately 15 hours.]Richard_LMon, 05 Aug 2019 18:04:16 -0500http://ask.sagemath.org/question/47401/Formal determinant of symbolic matrixhttp://ask.sagemath.org/question/46624/formal-determinant-of-symbolic-matrix/ I have some sparse symbolic matrices, and want to compute their formal determinant (without cancellation of terms). In other words, if I have the matrix
x,y = var('x,y')
M = Matrix(SR, [[x,y],[x,y]])
I would like the result of
M.determinant()
to be x*y - x*y, rather than just 0. The variables in each monomial are allowed to commute with each other, but on the other hand I would like all monomials containing a 0 to vanish (i.e if in the example above M = Matrix(SR, [[x,0],[x,y]])), then the determinant should be just x*y, rather than x*y - 0*x).
Is there a way to achieve this (without using the expansion of the determinant as permutations, since the dimension of the matrices gets quite big!)? Thanks in advance!
danieleCWed, 22 May 2019 09:32:20 -0500http://ask.sagemath.org/question/46624/