| 1 | initial version |
Use M.change_ring(SR) to change the entries of M to lie in the symbolic ring. Note that M.change_ring(SR) will still be a matrix. On the other hand, SR(M) is not a matrix. For most uses, I think that M.change_ring(SR) is the right choice.
sage: M = matrix([[0, -1], [1, 0]])
sage: type(SR(M))
<class 'sage.symbolic.expression.Expression'>
sage: type(M.change_ring(SR))
<class 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense'>
sage: M.change_ring(SR) == M
True
sage: M.change_ring(SR) + M
[ 0 -2]
[ 2 0]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.