On 13/02/2012 14:22, Dima Pasechnik wrote:
In gmane.comp.mathematics.sage.support, you wrote:
On Feb 12, 2:40 am, Keshav Kini<keshav.k...@gmail.com> wrote:
I guess his question is why Sage picks "a" (generic) as a generator name
for QQ[2^(1/3)] but "sqrt2" (hard-coded) for QQ[2^(1/2)].
-Keshav
Thanks for the comments, but let me explain the question a bit more
carefully.
As the code below shows, it doesnt seem to matter what I name the
generator.
In the case of 2^(1/3) the two fields, constructed differently and of
course isomorphic,
are actually equal.
In the case of 2^(1/2) they are not equal.
sage: F.<a> = NumberField(x^3-2)
sage: K.<b> = QQ[2^(1/3)]
sage: F == K
True
This is because "b" in K.<b> = ... is not really used in the
construction of QQ[2^(1/3)]:
sage: QQ[2^(1/3)]
Number Field in a with defining polynomial x^3 - 2
So QQ[2^(1/3)] constructs a number field with generator name "a" and
defining polynomial x^3-2. As you already have a field with generator
name "a" and polynomial x^3-2, they are identified. The fact that you
supplied the letter "b" is not used (which I think is a bug):
sage: K.<b> = QQ[2^(1/3)]
sage: K
Number Field in a with defining polynomial x^3 - 2
sage: b
a
sage: F.<a> = NumberField(x^2-2)
sage: K.<b> = QQ[2^(1/2)]
sage: F == K
False
Here it is slightly different. The number 2^(1/2) is sqrt(2), and Sage
then does not use the generic name "a", but the more useful name "sqrt2":
sage: QQ[2^(1/2)]
Number Field in sqrt2 with defining polynomial x^2 - 2
This time, F and K do not have the same generator name ("a" versus
"sqrt2").
If you now type
sage: L.<sqrt2> = NumberField(x^2-2)
sage: L == K
True
So it does matter what you name the variable. Testing equality of number
fields in Sage here just means: are variable names, defining polynomials
equal?
looks weird to me.
I cc this to sage-nt, just in case.
This is reversed from how I might imagine it should work.
I expect that QQ[x]/m(x) is abstractly defined, not necessarily
embedded into CC.
On the other hand QQ[ a ] for some algebraic number a is a specific
embedding.
In the case of deg m(x) = 2 there is only one embedding into CC, so I
can see
that sage might consider QQ[2^(1/2)] and NumberField(x^2-2) to be
equal.
(although there are two embeddings!)
For x^3-2 there is more than one embedding into CC, so I would not
expect
sage to consider the two constructions equal.
My main motivation is that I want to illustrate the theory of number
fields with
my students, including subtleties like the difference between a field,
defined
as the quotient of a polynomial ring, and a particular embedding.
In sage there are often many ways to construct the same object.
In some cases they are pseudonyms, in others there are fine
distinctions,
which can lead to confusion. I want to make this as smooth as
possible
for my students.
Thanks in advance for any insight offered.
Mike
Dima
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org