What do you think of this:
sage: var('x, i')
sage: solve(x^2 + i == 0, x)
[x == -sqrt(-I), x == sqrt(-I)]
Basically, I make a purely symbolic variable which I happen to call
"i", and it gets treated somewhere (presumably in Maxima) as if it
were sqrt(-1).
Here is another instance of this:
sage: var('i')
i
sage: a = i^2
sage: a
i^2
sage: a.simplify_full()
-1
So Ginac treats things fine, but our use of Maxima messes it up.
This came up for me just now when doing some symbolic calculation with
a quaternion algebra where the generators are called "i,j,k", and this
i has nothing to do with sqrt(-1).
Thoughts?
William
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
I think you are right that this is a huge bug in our interface to maxima.
Jason
--
Jason Grout
On Thu, Sep 3, 2009 at 5:00 PM, William A. Stein<wst...@gmail.com> wrote:
>>> sage: var('i')
>>> i
>>> sage: a = i^2
>>> sage: a.simplify_full()
>>> -1
> I think my email must have not been clear. I think it's an instance
> of a *HUGE BUG* in Sage. No more, no less. It's a bug, because
> irregardless of anything being predefined, it makes no sense that
> simplifying via *maxima* would just happen to decide that the formal
> variable "i" is sqrt(-1), even though it isn't with Ginac.
This seems to be a problem with the way Sage convert back
maxima-returned string intro SR. So Maxima is NOT doing anything
wrong.
-----------
sage: from sage.calculus.calculus import symbolic_expression_from_maxima_string
sage: symbolic_expression_from_maxima_string('%i')
I
sage: symbolic_expression_from_maxima_string('i')
I
-----------
So as you see, we are converting both '%i' and 'i' to imaginary 'I' !!!!
Cheers,
Golam
Yes, that completely nails down the bug. Thanks. This is now 6882:
http://trac.sagemath.org/sage_trac/ticket/6882
William