sage: K.is_isomorphic(K1)
True
The equality test == also checks that the name of the generator is the
same. In your case, they differ: "a" versus "sqrt2".
Sage picks "a" as generator name which just happens to be the same
letter you used.
looks weird to me.
I cc this to sage-nt, just in case.
Dima
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?