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, 18 Oct 2017 22:30:48 +0200Segmentation fault when multiplying by variablehttps://ask.sagemath.org/question/39204/segmentation-fault-when-multiplying-by-variable/In Sage 7.5.1 I'm trying to work with unknown values in GF(3) and polynomials.
The following code gives me a *segmentation fault*:
P.<x> = GF(3)['x']
var('a')
sigma = 2*x+ 1
print(a*(sigma))
What is the proper way to handle unknown GF(3) values like "a" in Sage?PsiWed, 18 Oct 2017 22:30:48 +0200https://ask.sagemath.org/question/39204/Equivalent of Polynomial.list() for expression involving generator of GaloisFieldhttps://ask.sagemath.org/question/38458/equivalent-of-polynomiallist-for-expression-involving-generator-of-galoisfield/I know that it is possible to use the method list() to get a list with the coefficients of a polynomial. For instance:
sage: S.<x> = PolynomialRing(ZZ, 'x')
sage: (1 - 5*x + 3*x**2 + 2*x**3).list()
[1, -5, 3, 2]
I would like to do something like that with an expression involving a generator of a Galois Field.
For example:
sage: q = 5
sage: m = 2
sage: F.<a> = GF(q**m)
sage: a**9
3*a + 1
So, ideally, I would like to do the following
(a**9).list()
and get
[1, 3]
Is there any simple way to that?Hilder Vitor Lima PereiraWed, 02 Aug 2017 00:43:08 +0200https://ask.sagemath.org/question/38458/polynomials in finite field: extracting coefficientshttps://ask.sagemath.org/question/33908/polynomials-in-finite-field-extracting-coefficients/ Hi i would like to go a bit deeper than this question
http://stackoverflow.com/questions/21876014/sage-coefficients-of-polynomial-over-finite-fields
F.<e> = GF(16)
p = e.minpoly()
p
**x^4 + x + 1**
R.<x> = PolynomialRing(F)
g=(x+e)*(x+e^14)
g in R
f=-((g(x)-g(e^2))/(x-e^2))*(1/g(e^2))
f in R
f
**(e^3 + e^2 + e + 1)*x + e^3 + e**
(1) it looks like f is not recognized as a polynomial as it was defined as a rational function which happened to simplify into a polynomial. As such, trying to use a method like f.list() or f.coeff() would cause an error
> AttributeError: 'FractionFieldElement_1poly_field' object has no
> attribute 'degree'
(2) it happens that the coefficient for x is actually equal to e^12, and the constant coefficient is e^9
is there an option when working in GF(16) to display every element as a power of e instead of a linear combination of 1,e,e^2,e^3 ?
thanksfaguiFri, 24 Jun 2016 17:35:16 +0200https://ask.sagemath.org/question/33908/given a list of coefficients how can I get a polynomialhttps://ask.sagemath.org/question/24252/given-a-list-of-coefficients-how-can-i-get-a-polynomial/ In sage,
given a list/vector v of coefficients, how can I get the polynomial v[i]*x^i ?
Here is my environment;
n = 11
K = GF(4,'a')
R = PolynomialRing(GF(4,'a'),"x")
x = R.gen()
a = K.gen()
v = vector([1,a,0,0,1,1,1,a,a,0,1])
I want to get the polynomial v(x) in x, having v as the list of coefficients.
This seems simple but I couldn't write it...
Can anyone help?
algebraicallyclosedTue, 23 Sep 2014 11:26:39 +0200https://ask.sagemath.org/question/24252/How does one find solutions to a polynomial over a finite field?https://ask.sagemath.org/question/9810/how-does-one-find-solutions-to-a-polynomial-over-a-finite-field/I'm trying to find the solutions to the polynomial $y^2=x^3+1$ over $\mathbb{F}_5$. I have constructed the correct polynomial ring, but I don't know what the analogous function to .roots() is for the two variable case. ThanksZaubertrankFri, 15 Feb 2013 20:05:04 +0100https://ask.sagemath.org/question/9810/