| 1 | initial version |
You can use the
sage: SR
Symbolic Ring
to convert the expression you get:
sage: m = random_matrix(ZZ, 3, 3)
sage: p = m.charpoly()
sage: type(p)
<type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
sage: SR(p)
x^3 + 2*x^2 - 8*x + 5
sage: type(_)
<type 'sage.symbolic.expression.Expression'>
Make sure you really need the symbolic ring. In many cases, you can get what you want more efficiently without converting to symbolic ring.
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.