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, 21 Aug 2023 22:26:38 +0200Reduction mod p of a polynomialhttps://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/ Hi everyone,
I have a question about the factorization of a polynomial modulo a prime ideal that I would like to help with.
Specifically, let $K$ be a number field (for my problem, we can assume that $K=\mathbb{Q}[i]$ or $K=\mathbb{Q}[\omega]$). I have a polynomial $f$ in $O_K[x]$ and a prime ideal $\mathfrak{p}$ in $O_K$ and I want to compute the factorization of $f$ over $O_K/\mathfrak{p}$.
When $K=\mathbb{Q}$, I use the following built-in function.
f=f.change_ring(GF(p))
f.factor()
I wonder whether we can do the same for a general number field.
Thank you for your help.
-Tung Fri, 18 Aug 2023 21:26:34 +0200https://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/Answer by tungnt for <p>Hi everyone, </p>
<p>I have a question about the factorization of a polynomial modulo a prime ideal that I would like to help with. </p>
<p>Specifically, let $K$ be a number field (for my problem, we can assume that $K=\mathbb{Q}[i]$ or $K=\mathbb{Q}[\omega]$). I have a polynomial $f$ in $O_K[x]$ and a prime ideal $\mathfrak{p}$ in $O_K$ and I want to compute the factorization of $f$ over $O_K/\mathfrak{p}$. </p>
<p>When $K=\mathbb{Q}$, I use the following built-in function. </p>
<pre><code>f=f.change_ring(GF(p))
f.factor()
</code></pre>
<p>I wonder whether we can do the same for a general number field. </p>
<p>Thank you for your help. </p>
<p>-Tung </p>
https://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/?answer=72811#post-id-72811My collaborator finally figured out how to do this. For your interest, here is how we do it. Let K be the number field, P the prime ideal, and f the polynomial that we want to factor modulo P.
G = K.factor(P)[0][0].residue_field()
f.change_ring(G).factor()
Hope this helps if someone arrives at the same problem in the future.
Mon, 21 Aug 2023 00:02:38 +0200https://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/?answer=72811#post-id-72811Comment by slelievre for <p>My collaborator finally figured out how to do this. For your interest, here is how we do it. Let K be the number field, P the prime ideal, and f the polynomial that we want to factor modulo P. </p>
<pre><code>G = K.factor(P)[0][0].residue_field()
f.change_ring(G).factor()
</code></pre>
<p>Hope this helps if someone arrives at the same problem in the future.</p>
https://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/?comment=72838#post-id-72838You can accept your own answer to mark the question as solved.Mon, 21 Aug 2023 22:26:38 +0200https://ask.sagemath.org/question/72719/reduction-mod-p-of-a-polynomial/?comment=72838#post-id-72838