Ask Your Question

Revision history [back]

This is defined behaviour of the general inverse, as far as I understand from the code. For example,

 sage: parent(~1)
 Rational Field

The definition of Matrix_generic_dense.__invert__() explicitly states

Return this inverse of this matrix, as a matrix over the fraction field.

I'm not an algebraist so no comment on that but, with symbolics you would stay in the ring, so symbolics seems to be good for something, contrary to many a belief.

sage: mat = matrix([[x^2]])
sage: mati = mat.inverse(); mati
[x^(-2)]
sage: mati[0,0].parent()
Symbolic Ring

This is defined behaviour of the general inverse, as far as I understand from the code. For example,

 sage: parent(~1)
 Rational Field

The definition of Matrix_generic_dense.__invert__() explicitly states

Return this inverse of this matrix, as a matrix over the fraction field.

sage: R.fraction_field()
Fraction Field of Univariate Polynomial Ring in t over Integer Ring

I'm not an algebraist so no comment on that but, with symbolics you would stay in the ring, so symbolics seems to be good for something, contrary to many a belief.

sage: mat = matrix([[x^2]])
sage: mati = mat.inverse(); mati
[x^(-2)]
sage: mati[0,0].parent()
Symbolic Ring