2009/9/3 John H Palmieri <jhpalmier...@gmail.com>:
>
> On Sep 3, 12:36 am, William Stein <wst...@gmail.com> wrote:
>>
>> Sage has the Gaussian integers, and I'm sure the basic arithmetic and
>> functionality is as good or better than Mathematica already.
>>
>> sage: R.<I> = ZZ[sqrt(-1)]; R
>> Order in Number Field in I with defining polynomial x^2 + 1
>
> Okay, this looks like a bug to me:
>
> ----------------------------------------------------------------------
> | Sage Version 4.1.1, Release Date: 2009-08-14                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> sage: I
> I
> sage: R.<I> = ZZ[sqrt(-1)]
> sage: I
> 1
> sage: I^2
> 1
>
> Why is I equal to 1 all of a sudden?  Same problem here:

Here is the reason, which caught me out also.   ZZ[sqrt(-1)] is an
order, and has two gens, namely its ZZ-module generators:

sage: R = ZZ[sqrt(-1)]
sage: R.gens()
[1, I]
sage: R.<one,I> = ZZ[sqrt(-1)]
sage: one
1
sage: I
I
sage: I^2
-1

So, R needs two names, you only gave it one.

I guess WAS is about to say the same thing but I'll post anyway...

John


>
> sage: reset()
> sage: R.<a> = ZZ[sqrt(-5)]
> sage: a
> 1
> sage: R.1
> a
> sage: R.1 == a
> False
> sage: (R.1)^2
> -5
> sage: R.inject_variables()
> Defining a
> sage: a
> 1
>
>
> Ouch.
> --
> John
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to