Updates:
Summary: conjugate doesn't work for complicated expressions
Status: Accepted
Comment #1 on issue 1724 by asmeurer: conjugate doesn't work for
complicated expressions
http://code.google.com/p/sympy/issues/detail?id=1724
Well, the root actually is complex (you can verify with WolphramAlpha).
For example:
In [39]: S("(-29/54 + 93**(1/2)/18)**(1/3)").evalf()
Out[39]: 0.0542694215230746 + 0.0939973953753372⋅ⅈ
Cubics and higher order polynomials have a strange property that sometimes
real roots will contain a nested I (and
in fact cannot be rewritten without it). That is why it may seem at first
glance that the other two roots should have
been complex, but in fact one of them is real, and the other is the
conjugate of the first.
As for the second part, that is also clear:
In [43]: r[1]
Out[43]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
╱ ⎽⎽⎽⎽
1 ╱ 29 ╲╱ 93
-2/3 - ────────────────────── - 3 ╱ - ── + ──────
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽ ╲╱ 54 18
╱ ⎽⎽⎽⎽
╱ 29 ╲╱ 93
9⋅3 ╱ - ── + ──────
╲╱ 54 18
In [44]: r[1].conjugate()
Out[44]:
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
╱ ⎽⎽⎽⎽
1 ╱ 29 ╲╱ 93
-2/3 - ────────────────────── - 3 ╱ - ── + ──────
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽ ╲╱ 54 18
╱ ⎽⎽⎽⎽
╱ 29 ╲╱ 93
9⋅3 ╱ - ── + ──────
╲╱ 54 18
So it remains unchanged. I do not know if there is a general algorithm for
finding the conjugate of an expression
like that. If there is, we should implement it. At any rate, I think it
should at least raise or something in a case like
that where it has a non-zero imaginary part but it cannot do it. I will
change the issue summary to be about that.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.