ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 23 Oct 2020 21:51:59 +0200Problem with factor and imag.https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/I'm new to SageMath, and I'm not sure what's going wrong.
Here are the commands I enter and results I get:
sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
Why is `Q` factoring to `0`?Sat, 17 Oct 2020 20:56:49 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/Comment by Emmanuel Charpentier for <p>I'm new to SageMath, and I'm not sure what's going wrong.</p>
<p>Here are the commands I enter and results I get:</p>
<pre><code>sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
</code></pre>
<p>Why is <code>Q</code> factoring to <code>0</code>?</p>
https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53964#post-id-53964Possible serious bug. Advice requested on `sage-devel`.Sun, 18 Oct 2020 14:54:13 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53964#post-id-53964Comment by FrédéricC for <p>I'm new to SageMath, and I'm not sure what's going wrong.</p>
<p>Here are the commands I enter and results I get:</p>
<pre><code>sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
</code></pre>
<p>Why is <code>Q</code> factoring to <code>0</code>?</p>
https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53960#post-id-53960Also
sage: Q.simplify_full()
0Sun, 18 Oct 2020 09:33:42 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53960#post-id-53960Comment by rburing for <p>I'm new to SageMath, and I'm not sure what's going wrong.</p>
<p>Here are the commands I enter and results I get:</p>
<pre><code>sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
</code></pre>
<p>Why is <code>Q</code> factoring to <code>0</code>?</p>
https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53953#post-id-53953Weird. `assume(z, 'complex')` seems to help.Sun, 18 Oct 2020 02:16:40 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=53953#post-id-53953Answer by Emmanuel Charpentier for <p>I'm new to SageMath, and I'm not sure what's going wrong.</p>
<p>Here are the commands I enter and results I get:</p>
<pre><code>sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
</code></pre>
<p>Why is <code>Q</code> factoring to <code>0</code>?</p>
https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?answer=53973#post-id-53973This is now [Trac#30793](https://trac.sagemath.org/ticket/30793#ticket), discussed in [sage-devel](https://groups.google.com/forum/#!topic/sage-devel/WSZ55IRWeiI).
Mon, 19 Oct 2020 08:47:34 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?answer=53973#post-id-53973Comment by lfc for <p>This is now <a href="https://trac.sagemath.org/ticket/30793#ticket">Trac#30793</a>, discussed in <a href="https://groups.google.com/forum/#!topic/sage-devel/WSZ55IRWeiI">sage-devel</a>.</p>
https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=54011#post-id-54011Great news!Fri, 23 Oct 2020 21:51:59 +0200https://ask.sagemath.org/question/53947/problem-with-factor-and-imag/?comment=54011#post-id-54011