1 | initial version |
To complement @vdelecroix answer, the main issue is that, when you write:
from mpmath import *
you import hundreds of functions into the namespace, overwriting the ones that are imported by Sage, this includes sqrt
.
If you want to use both Sage's symbolics and mpmath
numerics, you have to be more parsimonious and only import what you need. For example, if the functions you want to import from mpmath
are acos
and atan
, you can write:
from mpmath import acos, atan
Also, perhaps a more long-term solution, if there is something that works better with mpmath
than with the Sage's default (or that seems absent from Sage), you should advertise it so that we use mpmath for such a feature in Sage.