ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 22 Feb 2022 13:07:43 +0100Absolute number field extensionhttps://ask.sagemath.org/question/61243/absolute-number-field-extension/Hi there,
I am working with the following absolute field extension
of a quadratic field.
d = # some integer
K.(a) = NumberField(x^2-d)
R.<x> = PolynomialRing(K)
g = x^2 + x + 1
KL.(b) = K.extension(g)
f = KL.absolute_polynomial()
L.(c) = NumberField(f)
I need to keep track of the element `b` inside `L`
and I don't know how. Any help is much appreciated.Mon, 21 Feb 2022 00:26:17 +0100https://ask.sagemath.org/question/61243/absolute-number-field-extension/Answer by rburing for <p>Hi there,</p>
<p>I am working with the following absolute field extension
of a quadratic field.</p>
<pre><code>d = # some integer
K.(a) = NumberField(x^2-d)
R.<x> = PolynomialRing(K)
g = x^2 + x + 1
KL.(b) = K.extension(g)
f = KL.absolute_polynomial()
L.(c) = NumberField(f)
</code></pre>
<p>I need to keep track of the element <code>b</code> inside <code>L</code>
and I don't know how. Any help is much appreciated.</p>
https://ask.sagemath.org/question/61243/absolute-number-field-extension/?answer=61254#post-id-61254Use the [`absolute_field` method](https://doc.sagemath.org/html/en/reference/number_fields/sage/rings/number_field/number_field_rel.html#sage.rings.number_field.number_field_rel.NumberField_relative.absolute_field) instead:
sage: L.<c> = KL.absolute_field()
sage: f = L.defining_polynomial()
sage: from_L, to_L = L.structure()
sage: to_L(b)
2/11*c^3 + 3/11*c^2 + 2/11*c - 5/11
(The output is for the choice of `d = 2`.)
You also get the morphism in the other direction, which can be handy:
sage: from_L(c)
b - a
(Again, the output is for the choice of `d = 2`.)Tue, 22 Feb 2022 13:07:43 +0100https://ask.sagemath.org/question/61243/absolute-number-field-extension/?answer=61254#post-id-61254