Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is really a long comment to calc314's answer.

simplify just sends things to Maxima and back. Apparently we don't send the information about the domain to Maxima (nor is it immediately obvious to me if that would be easy).

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) -a^2+a*conjugate(a);
(%o1)                                  0
(%i2) declare(a,complex);
(%o2)                                done
(%i3) -a^2+a*conjugate(a);
                                                2
(%o3)                         a conjugate(a) - a

Now this is a little odd, because we explicitly initialize Maxima with 'domain : complex'. But apparently that only fixes some of these type of things.

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain:complex;
(%o1)                               complex
(%i2) -a^2+a*conjugate(a);
(%o2)                                  0

Anyway, Trac 6862 is essentially this issue, I think.

This is really a long comment to calc314's answer.

This has nothing to do with asking for complex domain specially, because we automatically do that.

sage: var('a')
a
sage: b=a*a.conjugate()-a*a
sage: b
-a^2 + a*conjugate(a)
sage: simplify(b)
0

simplify just sends things to Maxima and back. Apparently we don't send the information about the domain to Maxima (nor is it immediately obvious to me if that would be easy).

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) -a^2+a*conjugate(a);
(%o1)                                  0
(%i2) declare(a,complex);
(%o2)                                done
(%i3) -a^2+a*conjugate(a);
                                                2
(%o3)                         a conjugate(a) - a

Now this is a little odd, because we explicitly initialize Maxima with 'domain : complex'. But apparently that only fixes some of these type of things.

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain:complex;
(%o1)                               complex
(%i2) -a^2+a*conjugate(a);
(%o2)                                  0

Anyway, Trac 6862 is essentially this issue, I think.

This is really a long comment to calc314's answer.

This has nothing to do with asking for complex domain specially, because we automatically do that.

sage: var('a')
a
sage: b=a*a.conjugate()-a*a
sage: b
-a^2 + a*conjugate(a)
sage: simplify(b)
0

simplify just sends things to Maxima and back. Apparently we don't send the information about the domain to Maxima (nor is it immediately obvious to me if that would be easy).

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) -a^2+a*conjugate(a);
(%o1)                                  0
(%i2) declare(a,complex);
(%o2)                                done
(%i3) -a^2+a*conjugate(a);
                                                2
(%o3)                         a conjugate(a) - a

Now this is a little odd, because we explicitly initialize Maxima with 'domain : complex'. But apparently that only fixes some of these type of things.

Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain:complex;
(%o1)                               complex
(%i2) -a^2+a*conjugate(a);
(%o2)                                  0

Edit: according to the Maxima manual, the only thing this does is

Option variable: domain
Default value: real

When domain is set to complex, sqrt (x^2) will remain sqrt (x^2) instead of returning abs(x).

Sigh.

Anyway, Trac 6862 is essentially this issue, I think.

issue.