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.Wed, 05 Apr 2023 18:21:11 +0200Minimal Polynomial over specified fieldhttps://ask.sagemath.org/question/67346/minimal-polynomial-over-specified-field/ Is it possible to get a minimal polynomial over a custom field?
For example, say I define the below:
F.<a,b> = QQ[sqrt(2), sqrt(7)]
p = sqrt(6)
p.minpoly()
This gives me the minimal polynomial of sqrt(6) in QQ,
Is there a way to ask sage for the minimal polynomial of p in F?roeyroeyWed, 05 Apr 2023 18:21:11 +0200https://ask.sagemath.org/question/67346/Find the minimal polynomial of an element over a finite fieldhttps://ask.sagemath.org/question/65278/find-the-minimal-polynomial-of-an-element-over-a-finite-field/Let GF(q) be a finite field over GF(p), p prime. I want to find a primitive element gamma of G(q) and then find the minimal polynomial of gamma^j over GF(p), j an integer.
Is there a default way to do this?JGCThu, 08 Dec 2022 20:02:38 +0100https://ask.sagemath.org/question/65278/Algebraic to symbolic expressionhttps://ask.sagemath.org/question/52951/algebraic-to-symbolic-expression/ Hello! When I write AA(sqrt(3)+sqrt(2)) i get 3.146264369941973?, and I use to recover the original symbolic expression sqrt(2)+sqrt(3) simply by asking the minimal polynomial of 3.146264369941973?, which is of degree 4, and looking for the appropiate root. But I want to know if there is a reasonable way to get the symbolic expression from an algebraic expression which I know it comes from a lot of operations, knowing that the function "minpoly()" in that case does not give an answer for hours. I hope you can help me!!!creyesm1992Tue, 11 Aug 2020 23:17:24 +0200https://ask.sagemath.org/question/52951/Minimal polynomial in tower of finite fields?https://ask.sagemath.org/question/43349/minimal-polynomial-in-tower-of-finite-fields/ I have two extension field $E=K(d)$ and $K=F(a)$ where $F=GF(p)$ for a prime $p$. How can I compute the minimal polynomial of $d$ over $F$.
There is a command "absolute_minpoly" that works for number fields and not extension fields of finite fields. I want a command like that. RuhollaSun, 12 Aug 2018 02:18:49 +0200https://ask.sagemath.org/question/43349/how 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 ?nebuckandazzerWed, 10 Aug 2016 19:45:47 +0200https://ask.sagemath.org/question/34412/Collect irreducible polynomialshttps://ask.sagemath.org/question/32726/collect-irreducible-polynomials/ I am trying to collect irreducible polynomials from a monic polynomial like x^n-1 in a field.
For example, n = 13 and the field is F_{3}, the monic polynomial is x^13-1. So far, I found I can use _factor()_
to get
FF.<a>=GF(3)
x = PolynomialRing(FF,"x").gen()
factor(x^13-1)
(x + 2) * (x^3 + 2*x + 2) * (x^3 + x^2 + 2) * (x^3 + x^2 + x + 2) * (x^3 + 2*x^2 + 2*x + 2)
But I want to make each of them into a list, then from that list to get higher degree irreducible polynomials, such as
`(x+2)(x^3+2*x+2),(x+2)(x^3+2*x+2)(x^3+2*x^2+2*x+2)` and so forth.
can someone give me a hint or suggestion to do that? Thanks.
I am not an English speaker, hope people can understand what I say.
SimpleSun, 06 Mar 2016 23:42:43 +0100https://ask.sagemath.org/question/32726/Minimal polynomial isn't minimal?https://ask.sagemath.org/question/23915/minimal-polynomial-isnt-minimal/Quoting [MathWorld](http://mathworld.wolfram.com/MatrixMinimalPolynomial.html),
> The minimal polynomial of a matrix $A$ is the monic polynomial in $A$ of smallest degree $n$ such that
>
> $$p(A) = \sum_{i=0}^n c_i A^i = 0$$.
I'd like to find the minimal polynomial of a matrix $A$ over the reals. My attempt:
sage: A = matrix(RR, [
....: [0,-9, 0, 0, 0, 0],
....: [1, 6, 0, 0, 0, 0],
....: [0, 0, 0,-9, 0, 0],
....: [0, 0, 1, 6, 0, 0],
....: [0, 0, 0, 0, 0,-5],
....: [0, 0, 0, 0, 1, 0]
....: ])
sage: f = A.minpoly()
sage: f.is_monic()
True
sage: f(A).is_zero()
True
However, $f$ doesn't appear to actually be the minimal polynomial:
sage: R.<x> = RR['x']
sage: g = x^4 - 6*x^3 + 14*x^2 - 30*x + 45
sage: g(x).is_monic()
True
sage: g(A).is_zero()
True
sage: g.degree() < f.degree()
True
Did I make a mistake or is this a bug?
I noticed that `A.minpoly()` gives $g$ if I do the computation over $\mathbb{Q}$ instead of $\mathbb{R}$. Perhaps the `minpoly` function just needs to be restricted to exact rings?WilsonSun, 24 Aug 2014 20:13:39 +0200https://ask.sagemath.org/question/23915/berlekamp masseyhttps://ask.sagemath.org/question/9792/berlekamp-massey/Hello,
I am trying to use B/M algo included in Sage. Now,
berlekamp_massey([GF(2)(0),0,1,0,1,0,0,1,0,1,1,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,0])
evals to f(x)=x^5 + x^3 + x^2 + x + 1 which is the minimal poly.
Also, I know that when I take the reciprocal (x^5*f(1/x)), I find
g(x)=x^5+x^4+x^3+x^2+1 which is the connection poly. of this LFSR.
My question is how can I regenerate this sequence using this connection poly.?
Providing initial states 0,0,1,0,1 yields to another sequence:
(0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 0)
I think, there might be a bug in B/M implementation because other implementations give
x^19 + x^18 + x^17 + x^14 + x^13 + x^10 + x^9 + x^8 + x^6 + x^3 + x^2 + 1
when fed with the same sequence.
Thanks,
evrim.evrimSat, 09 Feb 2013 21:00:43 +0100https://ask.sagemath.org/question/9792/bug in minimal polynomials of finite fieldshttps://ask.sagemath.org/question/8275/bug-in-minimal-polynomials-of-finite-fields/In a compiled version of 4.7 (64 bit, Debian Sid), I get:
----------------------------------------------------------------------
| Sage Version 4.7, Release Date: 2011-05-23 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: F.<a>=GF(2^64)
sage: a.minpoly()
_3 = x^64 + x^33 + x^30 + x^26 + x^25 + x^24 + x^23 + x^22 + x^21 + x^20 + x^18 + x^13 + x^12 + x^11 + x^10 + x^7 + x^5 + x^4 + x^2 + x + 1
sage: K.<b>=GF(2^128)
sage: b.minpoly()
_5 = x^128 + x^7 + x^2 + x + 1
sage: a.minpoly()
_6 = x^128 + x^7 + x^2 + x + 1
Is this a bug or am I doing something stupid?
Thanks,
LuisfinottiMon, 15 Aug 2011 15:30:28 +0200https://ask.sagemath.org/question/8275/