Ticket #6862 (new defect)
Mixing of different domains for symbolic variables
| Reported by: | gmhossain | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | |
| Component: | symbolics | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
From suge-support
On Sep 1, 11:35 pm, Mani chandra <mchan...@…> wrote:
Mani chandra wrote:
sage: x = a + I*b sage: real(x.conjugate().simplify()) real_part(a) + imag_part(b) sage: real(x.conjugate()) real_part(a) - imag_part(b)
This seems to be happening because maxima(via simplify) treats variables as real whereas pynac treats as complex.
sage: x.conjugate() conjugate(a) - I*conjugate(b) sage: x.conjugate().simplify() a - I*b
Change History
comment:2 Changed 4 months ago by kcrisman
- Report Upstream set to N/A
See also this closely related ask.sagemath.org question, where the following example occurs.
sage: var('a')
a
sage: b=a*a.conjugate()-a*a
sage: b
-a^2 + a*conjugate(a)
sage: simplify(b)
0
I think this is a little weird, though, since in Maxima
(%i1) domain:complex; (%o1) complex (%i2) -a^2+a*conjugate(a); (%o2) 0
and sadly, the Maxima manual says that all this is expected to do 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).
William says in the thread above that
What we need is to queue up (put in some list somewhere) all declaration that could ever be needed, then whenever we do a Sage --> calculus Maxima conversion, we would empty the queue if it is nonempty. Also, if Maxima were to crash/get restarted (does that ever happen anymore), we would need to make sure all var's get set again. This seems very do-able.
and perhaps that could be part of the initialization process of any variable - without actually calling Maxima at that time, of course!
Note: See
TracTickets for help on using
tickets.

See http://groups.google.com/group/sage-devel/browse_thread/thread/e25e03c9dba88a93
Also, based on the hint there from Robert Dodier, here is the eventual way a fix will have to occur, perhaps as outlined in the thread: