coexistence of two real_part functions

asked 2019-10-10 23:11:56 +0100

Florentin Jaffredo gravatar image

updated 2019-10-10 23:12:44 +0100

In Sage 8.8, this code:

assume(x, 'complex')
print real_part(x)
print real_part(x).simplify()

prints:

real_part(x)
realpart(x)

This does not change any computation (Sage can prove both are equal), but is annoying, since the second one cannot be copy-pasted back into the code. The problem is even more visible when %display latex is enabled.

Is this a bug? Is there a workaround that makes it possible to display beautiful real parts after a simplification?

edit retag flag offensive close merge delete

Comments

It seems to me that this is bug. Indeed, if you call real_part??, you will see that this function is defined in <SAGE>/local/lib/python3.7/site-packages/sage/functions/other.py, where <Sage> is the directory of installation. By reading the code there, you will see a line defining real = real_part = Function_real_part(), which indicates these three functions are the same. There is no realpart there. Moreover, calling realpart?? produces Objectrealpartnot found., which indicates that function is not defined.

dsejas gravatar imagedsejas ( 2019-10-11 21:21:52 +0100 )edit