Ask Your Question

Revision history [back]

The issue is the following:

sage: a = g(2+I) ; a
1.1503557032549026717428499347448667156 - 0.43753086591960788111752789859284305987*I
sage: type(a)
<class 'sage.interfaces.gp.GpElement'>
sage: real(a)
TypeError: Error executing code in GP

So, Sage is not able to take the real part of a GP complex number. Let me suggest to first transform the GP number into a Sage Complex Double Element, and then work with that:

sage: CDF(a)
1.1503557032549028 - 0.4375308659196079*I
sage: real(CDF(a))
1.1503557032549028

So that you can do:

sage: implicit_plot(lambda x,y:real_part(CDF(g(x+y*I))),(-3,3),(-3,3))