ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 10 Oct 2010 11:29:56 -0500Radical in the denominator?https://ask.sagemath.org/question/7494/radical-in-the-denominator/Is there any way I can get a general complex number to display with the radical in the denominator, rather than having it rationalized? For example (1+i)/sqrt(2).Sun, 10 Oct 2010 06:00:07 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/Answer by burcin for <p>Is there any way I can get a general complex number to display with the radical in the denominator, rather than having it rationalized? For example (1+i)/sqrt(2).</p>
https://ask.sagemath.org/question/7494/radical-in-the-denominator/?answer=11720#post-id-11720With the patches recently merged to Sage 4.6.alpha3, you can do this:
sage: sqrt(2).power(-1, hold=True)*(1+i)
(I + 1)/sqrt(2)
If you want to try it out before the release, you can find the new alpha here:
[http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar][1]
or you can upgrade with
./sage -upgrade http://sage.math.washington.edu/home/release/sage-4.6.alpha3/
[1]: http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tarSun, 10 Oct 2010 06:23:43 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/?answer=11720#post-id-11720Comment by Mike Witt for <p>With the patches recently merged to Sage 4.6.alpha3, you can do this:</p>
<pre><code>sage: sqrt(2).power(-1, hold=True)*(1+i)
(I + 1)/sqrt(2)
</code></pre>
<p>If you want to try it out before the release, you can find the new alpha here:</p>
<p><a href="http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar">http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar</a></p>
<p>or you can upgrade with</p>
<pre><code>./sage -upgrade http://sage.math.washington.edu/home/release/sage-4.6.alpha3/
</code></pre>
https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22587#post-id-22587OK, I understand. The technique above may still have some value for me. I didn't have any success getting the alpha version to build, but I'll check it out when 4.6 gets released.Sun, 10 Oct 2010 08:28:46 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22587#post-id-22587Comment by Mike Witt for <p>With the patches recently merged to Sage 4.6.alpha3, you can do this:</p>
<pre><code>sage: sqrt(2).power(-1, hold=True)*(1+i)
(I + 1)/sqrt(2)
</code></pre>
<p>If you want to try it out before the release, you can find the new alpha here:</p>
<p><a href="http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar">http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar</a></p>
<p>or you can upgrade with</p>
<pre><code>./sage -upgrade http://sage.math.washington.edu/home/release/sage-4.6.alpha3/
</code></pre>
https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22589#post-id-22589If I understand correctly what you're saying, that would allow me to specifically enter a number in that form, and keep that specific number from being changed before being displayed, right? But what I'm looking for is a more general "form" ... simplify_??? ... Does that make any sense?Sun, 10 Oct 2010 07:20:03 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22589#post-id-22589Comment by Mitesh Patel for <p>With the patches recently merged to Sage 4.6.alpha3, you can do this:</p>
<pre><code>sage: sqrt(2).power(-1, hold=True)*(1+i)
(I + 1)/sqrt(2)
</code></pre>
<p>If you want to try it out before the release, you can find the new alpha here:</p>
<p><a href="http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar">http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar</a></p>
<p>or you can upgrade with</p>
<pre><code>./sage -upgrade http://sage.math.washington.edu/home/release/sage-4.6.alpha3/
</code></pre>
https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22585#post-id-22585Mike, if you have the time, could you give us information about your build problem with 4.6.alpha3 on the sage-release mailing list ( http://groups.google.com/group/sage-release )?Sun, 10 Oct 2010 11:29:56 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22585#post-id-22585Comment by burcin for <p>With the patches recently merged to Sage 4.6.alpha3, you can do this:</p>
<pre><code>sage: sqrt(2).power(-1, hold=True)*(1+i)
(I + 1)/sqrt(2)
</code></pre>
<p>If you want to try it out before the release, you can find the new alpha here:</p>
<p><a href="http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar">http://sage.math.washington.edu/home/release/sage-4.6.alpha3/sage-4.6.alpha3.tar</a></p>
<p>or you can upgrade with</p>
<pre><code>./sage -upgrade http://sage.math.washington.edu/home/release/sage-4.6.alpha3/
</code></pre>
https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22588#post-id-22588One of the automatic evaluations pynac performs is to clear radicals from the denominator, as in 1/sqrt(2) -> 1/2*sqrt(2). I'm afraid it's not possible to disable this in general.Sun, 10 Oct 2010 08:16:56 -0500https://ask.sagemath.org/question/7494/radical-in-the-denominator/?comment=22588#post-id-22588