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.Tue, 15 Nov 2016 07:59:48 -0600Trying to find prime factorization of ideals in number fieldshttp://ask.sagemath.org/question/35586/trying-to-find-prime-factorization-of-ideals-in-number-fields/Let $L=\mathbb{Q}(\sqrt{-5}, i)$ and $K=\mathbb{Q}(\sqrt{-5})$. Let $O_K$ and $O_L$ be the rings of algebraic integers of $K$ and $L$. It can be checked that
$$2O_K=\langle 2, \sqrt{-5}+1\rangle^2 $$
I want to find the factorization of the ideal $\langle 2, \sqrt{-5}+1\rangle O_L$ in $O_L$ ?
The problem I am having is this. I don't know the syntax for the ideal generated by $\langle 2, \sqrt{-5}+1\rangle O_L$.
What to do ?Tue, 15 Nov 2016 02:41:15 -0600http://ask.sagemath.org/question/35586/trying-to-find-prime-factorization-of-ideals-in-number-fields/Answer by slelievre for <p>Let $L=\mathbb{Q}(\sqrt{-5}, i)$ and $K=\mathbb{Q}(\sqrt{-5})$. Let $O_K$ and $O_L$ be the rings of algebraic integers of $K$ and $L$. It can be checked that </p>
<p>$$2O_K=\langle 2, \sqrt{-5}+1\rangle^2 $$</p>
<p>I want to find the factorization of the ideal $\langle 2, \sqrt{-5}+1\rangle O_L$ in $O_L$ ?</p>
<p>The problem I am having is this. I don't know the syntax for the ideal generated by $\langle 2, \sqrt{-5}+1\rangle O_L$.</p>
<p>What to do ?</p>
http://ask.sagemath.org/question/35586/trying-to-find-prime-factorization-of-ideals-in-number-fields/?answer=35589#post-id-35589Is this what you are looking for?
Define the number fields and their rings of integers.
sage: K.<a> = NumberField(x^2+5)
sage: L.<i> = K.extension(x^2+1)
sage: OK = K.ring_of_integers()
sage: OL = L.ring_of_integers()
Define the ideals generated by `2` and by `a+1`.
sage: J = OL.principal_ideal(2)
sage: JJ = OL.principal_ideal(a + 1)
Take the sum.
sage: H = J + JJ; H
Fractional ideal (-i + 1)
Prime factors.
sage: H.prime_factors()
[Fractional ideal (-i + 1)]
sage: H.is_prime()
TrueTue, 15 Nov 2016 07:59:48 -0600http://ask.sagemath.org/question/35586/trying-to-find-prime-factorization-of-ideals-in-number-fields/?answer=35589#post-id-35589