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.Mon, 03 Oct 2016 23:54:34 +0200number fields and irreducible polynomialshttps://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/Hello gentle people. Let's see an example.
f=x^2+4
g=x^4+16
F=NumberField(f,'a')
The extension field of `F` by `g` cannot obtained by `F.extension(g(s),'s')` although we input `s=var('s')` before.
Because `g` is reducible in `F`. ( g=(x^2-4I)(x^2+4I) )
Can I check irreducibility of a polynomial in a number field?
Is there any method which makes a number field by given polynomial?
Thanks in advance.Sun, 02 Oct 2016 07:26:00 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/Answer by tmonteil for <p>Hello gentle people. Let's see an example.</p>
<pre><code> f=x^2+4
g=x^4+16
F=NumberField(f,'a')
</code></pre>
<p>The extension field of <code>F</code> by <code>g</code> cannot obtained by <code>F.extension(g(s),'s')</code> although we input <code>s=var('s')</code> before.
Because <code>g</code> is reducible in <code>F</code>. ( g=(x^2-4I)(x^2+4I) )</p>
<p>Can I check irreducibility of a polynomial in a number field?</p>
<p>Is there any method which makes a number field by given polynomial?</p>
<p>Thanks in advance.</p>
https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?answer=35034#post-id-35034You should define `g` as an element of the univariate polynomial ring with coefficients in `F`:
sage: R.<y> = F[]
sage: R
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g = y^4+16
sage: g.parent()
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g.is_irreducible()
False
sage: g.factor()
(y^2 - 2*a) * (y^2 + 2*a)
**EDIT** If you want the splitting field of `g`, together with a map to embed `F` into it, you can do:
sage: g.splitting_field('b')
Number Field in b with defining polynomial y^4 + 1
sage: g.splitting_field('b', map=True)
(Number Field in b with defining polynomial y^4 + 1, Ring morphism:
From: Number Field in a with defining polynomial x^2 + 4
To: Number Field in b with defining polynomial y^4 + 1
Defn: a |--> 2*b^2)Sun, 02 Oct 2016 21:47:36 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?answer=35034#post-id-35034Comment by Semin for <p>You should define <code>g</code> as an element of the univariate polynomial ring with coefficients in <code>F</code>:</p>
<pre><code>sage: R.<y> = F[]
sage: R
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g = y^4+16
sage: g.parent()
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g.is_irreducible()
False
sage: g.factor()
(y^2 - 2*a) * (y^2 + 2*a)
</code></pre>
<p><strong>EDIT</strong> If you want the splitting field of <code>g</code>, together with a map to embed <code>F</code> into it, you can do:</p>
<pre><code>sage: g.splitting_field('b')
Number Field in b with defining polynomial y^4 + 1
sage: g.splitting_field('b', map=True)
(Number Field in b with defining polynomial y^4 + 1, Ring morphism:
From: Number Field in a with defining polynomial x^2 + 4
To: Number Field in b with defining polynomial y^4 + 1
Defn: a |--> 2*b^2)
</code></pre>
https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35042#post-id-35042Hmm.. That's good information but when I have some more polynomials, it looks hard to control variables. When I want to get the splitting field of `f1`,`f2`,...,`fn` which are irreducible in the field of rationals, then I have to make `R1.<y1>`, `R2.<y2>`,...,`Rn.<yn>`, right?Mon, 03 Oct 2016 16:14:14 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35042#post-id-35042Comment by tmonteil for <p>You should define <code>g</code> as an element of the univariate polynomial ring with coefficients in <code>F</code>:</p>
<pre><code>sage: R.<y> = F[]
sage: R
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g = y^4+16
sage: g.parent()
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g.is_irreducible()
False
sage: g.factor()
(y^2 - 2*a) * (y^2 + 2*a)
</code></pre>
<p><strong>EDIT</strong> If you want the splitting field of <code>g</code>, together with a map to embed <code>F</code> into it, you can do:</p>
<pre><code>sage: g.splitting_field('b')
Number Field in b with defining polynomial y^4 + 1
sage: g.splitting_field('b', map=True)
(Number Field in b with defining polynomial y^4 + 1, Ring morphism:
From: Number Field in a with defining polynomial x^2 + 4
To: Number Field in b with defining polynomial y^4 + 1
Defn: a |--> 2*b^2)
</code></pre>
https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35047#post-id-35047Well, you can use the same `x` all the time, but then you should be careful that along your computation, it soed not belong to the same parent, i chosed another indeterminate to avoid confusions.Mon, 03 Oct 2016 20:23:36 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35047#post-id-35047Comment by Semin for <p>You should define <code>g</code> as an element of the univariate polynomial ring with coefficients in <code>F</code>:</p>
<pre><code>sage: R.<y> = F[]
sage: R
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g = y^4+16
sage: g.parent()
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g.is_irreducible()
False
sage: g.factor()
(y^2 - 2*a) * (y^2 + 2*a)
</code></pre>
<p><strong>EDIT</strong> If you want the splitting field of <code>g</code>, together with a map to embed <code>F</code> into it, you can do:</p>
<pre><code>sage: g.splitting_field('b')
Number Field in b with defining polynomial y^4 + 1
sage: g.splitting_field('b', map=True)
(Number Field in b with defining polynomial y^4 + 1, Ring morphism:
From: Number Field in a with defining polynomial x^2 + 4
To: Number Field in b with defining polynomial y^4 + 1
Defn: a |--> 2*b^2)
</code></pre>
https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35051#post-id-35051Okay, I see. Thank you very much. :-)Mon, 03 Oct 2016 23:01:20 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35051#post-id-35051Comment by tmonteil for <p>You should define <code>g</code> as an element of the univariate polynomial ring with coefficients in <code>F</code>:</p>
<pre><code>sage: R.<y> = F[]
sage: R
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g = y^4+16
sage: g.parent()
Univariate Polynomial Ring in y over Number Field in a with defining polynomial x^2 + 4
sage: g.is_irreducible()
False
sage: g.factor()
(y^2 - 2*a) * (y^2 + 2*a)
</code></pre>
<p><strong>EDIT</strong> If you want the splitting field of <code>g</code>, together with a map to embed <code>F</code> into it, you can do:</p>
<pre><code>sage: g.splitting_field('b')
Number Field in b with defining polynomial y^4 + 1
sage: g.splitting_field('b', map=True)
(Number Field in b with defining polynomial y^4 + 1, Ring morphism:
From: Number Field in a with defining polynomial x^2 + 4
To: Number Field in b with defining polynomial y^4 + 1
Defn: a |--> 2*b^2)
</code></pre>
https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35054#post-id-35054^_^ .Mon, 03 Oct 2016 23:54:34 +0200https://ask.sagemath.org/question/35028/number-fields-and-irreducible-polynomials/?comment=35054#post-id-35054