ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 11 Oct 2019 14:21:52 -0500coexistence of two real_part functionshttp://ask.sagemath.org/question/48266/coexistence-of-two-real_part-functions/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?Thu, 10 Oct 2019 16:11:56 -0500http://ask.sagemath.org/question/48266/coexistence-of-two-real_part-functions/Comment by dsejas for <p>In Sage 8.8, this code:</p>
<pre><code>assume(x, 'complex')
print real_part(x)
print real_part(x).simplify()
</code></pre>
<p>prints:</p>
<pre><code>real_part(x)
realpart(x)
</code></pre>
<p>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 <code>%display latex</code> is enabled.</p>
<p>Is this a bug? Is there a workaround that makes it possible to display beautiful real parts after a simplification?</p>
http://ask.sagemath.org/question/48266/coexistence-of-two-real_part-functions/?comment=48292#post-id-48292It 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 `Object `realpart` not found.`, which indicates that function is not defined.Fri, 11 Oct 2019 14:21:52 -0500http://ask.sagemath.org/question/48266/coexistence-of-two-real_part-functions/?comment=48292#post-id-48292