ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 02 Mar 2017 15:38:33 -0600Check if element is irreducible in algebraic number fieldhttp://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/ If I have an algebraic number field
sage: S.<x> = NumberField(x^2+13)
is there a way to find out if an element is irreducible? There seems to be only a function to check if it is prime:
sage: (S(7)).is_prime()
False
But 7 is irreducible in $\mathbb{Q}(\sqrt{-13})$... how could I find that out?Thu, 30 Apr 2015 18:50:34 -0500http://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/Comment by B r u n o for <p>If I have an algebraic number field</p>
<pre><code>sage: S.<x> = NumberField(x^2+13)
</code></pre>
<p>is there a way to find out if an element is irreducible? There seems to be only a function to check if it is prime:</p>
<pre><code>sage: (S(7)).is_prime()
False
</code></pre>
<p>But 7 is irreducible in $\mathbb{Q}(\sqrt{-13})$... how could I find that out?</p>
http://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/?comment=26711#post-id-26711There does not seem to be such a functionality implemented yet. A side note is that what you want is probably to decide whether a given element is prime in the ring of integers of your number field. You can construct it using "sage: R = S.rings_of_integers()". Still there is no is_irreducible method for rings of integers of number fields.Mon, 04 May 2015 07:05:20 -0500http://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/?comment=26711#post-id-26711Answer by dan_fulea for <p>If I have an algebraic number field</p>
<pre><code>sage: S.<x> = NumberField(x^2+13)
</code></pre>
<p>is there a way to find out if an element is irreducible? There seems to be only a function to check if it is prime:</p>
<pre><code>sage: (S(7)).is_prime()
False
</code></pre>
<p>But 7 is irreducible in $\mathbb{Q}(\sqrt{-13})$... how could I find that out?</p>
http://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/?answer=36795#post-id-36795In this special situation one can ask for the following:
sage: K.<a> = QuadraticField( -13 )
sage: ideal = K.ideal( K(7) )
sage: ideal.factor()
(Fractional ideal (7, a + 1)) * (Fractional ideal (7, a + 6))
sage: for factor in ideal.factor():
print factor, "with norm", factor[0].norm()
....:
(Fractional ideal (7, a + 1), 1) with norm 7
(Fractional ideal (7, a + 6), 1) with norm 7
The ideal has the above decomposition, but the factors are not principal.
Strictly speaking, we are performing arithmetics not in the field, but in its ring of integers or in some subring / order.
Then a non-trivial representation $7 = st$ with $s, t$ non-units would lead to $7^2 = N(7)=N(st)=N(s)\, N(t)$, and the only way to arrange for two non-unit norms would be with $N(s) = N(t) = 7$. So one can equivalently search for such elements without asking sage to factor. The search is quickly done for small values to be factorized. And there is in general a quick theoretical answer if a prime $p$ is of the shape $a^2 +13 b^2$ (in a non-trivial way). We look at
$p=a^2 +13 b^2$ as an equality in integers and pass modulo $13$. So $p$ must be a quadratic residue modulo $13$ if there is such a representation. And the theory takes care of the other direction. For our situation we have the choice to alternatively ask for:
sage: legendre_symbol( 7, 13 )
-1
sage: jacobi_symbol( 7, 13 )
-1
sage: kronecker_symbol( 7, 13 )
-1
sage: GF(13)(7).is_square()
False
(For an order we have to continue investigations.)
Thu, 02 Mar 2017 15:38:33 -0600http://ask.sagemath.org/question/26695/check-if-element-is-irreducible-in-algebraic-number-field/?answer=36795#post-id-36795