First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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
click to hide/show revision 2
No.2 Revision

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