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.Wed, 17 Aug 2016 20:47:18 +0200Defining a number field in sagehttps://ask.sagemath.org/question/34501/defining-a-number-field-in-sage/I know how to define a number field in sage by an irreducible polynomial over $\mathbb{Q}$, for example
sage: K.<a> = NumberField(x^3 - 2)
sage: a.minploy()
But how do I define any number field like $\mathbb{Q}(\sqrt{d_1},\sqrt{d_2})$ in sage, where $d_1$ and $d_2$ are two distinct squarefree integers? So how do I find the defining minimal polynomial of the field extension $\mathbb{Q}(\sqrt{d_1},\sqrt{d_2})$ over $\mathbb{Q}$?Wed, 17 Aug 2016 18:52:09 +0200https://ask.sagemath.org/question/34501/defining-a-number-field-in-sage/Answer by nbruin for <p>I know how to define a number field in sage by an irreducible polynomial over $\mathbb{Q}$, for example </p>
<pre><code>sage: K.<a> = NumberField(x^3 - 2)
sage: a.minploy()
</code></pre>
<p>But how do I define any number field like $\mathbb{Q}(\sqrt{d_1},\sqrt{d_2})$ in sage, where $d_1$ and $d_2$ are two distinct squarefree integers? So how do I find the defining minimal polynomial of the field extension $\mathbb{Q}(\sqrt{d_1},\sqrt{d_2})$ over $\mathbb{Q}$?</p>
https://ask.sagemath.org/question/34501/defining-a-number-field-in-sage/?answer=34502#post-id-34502 sage: K.<a,b>=NumberField([x^2-3,x^2-5])
sage: K.absolute_field('c')
Number Field in c with defining polynomial x^4 - 16*x^2 + 4
This gets you *a* representation of K as a simple extension of Q. There are many choices possible.Wed, 17 Aug 2016 20:47:18 +0200https://ask.sagemath.org/question/34501/defining-a-number-field-in-sage/?answer=34502#post-id-34502