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.Sun, 21 Aug 2016 20:11:59 +0200how to find minimal polynomialhttps://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/How to find the minimal polynomial of an element ? Let $\zeta_n$ be a primitive $n$-th root of unity. I want to find the minimal polynomial of $\zeta_n$ over $\mathbb{Q}(\zeta_n+\zeta_{n}^{-1})$. How do I do that ?Wed, 10 Aug 2016 19:45:47 +0200https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/Comment by slelievre for <p>How to find the minimal polynomial of an element ? Let $\zeta_n$ be a primitive $n$-th root of unity. I want to find the minimal polynomial of $\zeta_n$ over $\mathbb{Q}(\zeta_n+\zeta_{n}^{-1})$. How do I do that ?</p>
https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?comment=34495#post-id-34495@nebuckandazzer what have you tried?Wed, 17 Aug 2016 00:59:47 +0200https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?comment=34495#post-id-34495Comment by nebuckandazzer for <p>How to find the minimal polynomial of an element ? Let $\zeta_n$ be a primitive $n$-th root of unity. I want to find the minimal polynomial of $\zeta_n$ over $\mathbb{Q}(\zeta_n+\zeta_{n}^{-1})$. How do I do that ?</p>
https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?comment=34545#post-id-34545I have not tried anything. I don't even know how to find the minimal polynomial of any algebraic number over $\mathbb{Q}$.Sat, 20 Aug 2016 19:04:28 +0200https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?comment=34545#post-id-34545Answer by slelievre for <p>How to find the minimal polynomial of an element ? Let $\zeta_n$ be a primitive $n$-th root of unity. I want to find the minimal polynomial of $\zeta_n$ over $\mathbb{Q}(\zeta_n+\zeta_{n}^{-1})$. How do I do that ?</p>
https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?answer=34551#post-id-34551There may be a better answer to your question, but here is a first attempt.
$ sage -v
SageMath version 7.3, Release Date: 2016-08-04
$ sage -q
sage: zeta7 = QQbar(exp(2*pi*i/7))
sage: zeta7
0.6234898018587335? + 0.7818314824680299?*I
sage: zeta7.parent()
Algebraic Field
sage: a = zeta7 + zeta7.conjugate()
sage: a
1.246979603717467? + 0.?e-18*I
sage: p = a.minpoly()
sage: p
x^3 + x^2 - 2*x - 1
sage: q = zeta7.minpoly()
sage: q
x^6 + x^5 + x^4 + x^3 + x^2 + x + 1
sage: k.<a> = NumberField(p, name='a', embedding=a)
sage: k
Number Field in a with defining polynomial x^3 + x^2 - 2*x - 1
sage: k.gen()
a
sage: q.factor()
x^6 + x^5 + x^4 + x^3 + x^2 + x + 1
sage: kx.<x> = k[]
sage: qq = kx(q)
sage: qq
x^6 + x^5 + x^4 + x^3 + x^2 + x + 1
sage: qq.factor()
(x^2 - a*x + 1) * (x^2 + (-a^2 + 2)*x + 1) * (x^2 + (a^2 + a - 1)*x + 1)
sage: for f, m in qq.factor(): print f(a)
1
2*a^2
a^2 + a + 2
sage: for f, m in qq.factor(): print f(zeta7)
0
1.054958132087372? + 1.322875655532296?*I
1.900968867902420? + 2.383739563481206?*I
sage:
Sun, 21 Aug 2016 20:11:59 +0200https://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/?answer=34551#post-id-34551