ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 29 May 2020 09:04:39 -0500binary value of an irreducible polynomialhttps://ask.sagemath.org/question/51629/binary-value-of-an-irreducible-polynomial/ if i defined the following finite field
F=GF(2^15,'x')
then i've generated it's irreducible polynomial
sage: IP=F.polynomial()
sage: IP
x^15 + x^5 + x^4 + x^2 + 1
how can i get the binary representation of this polynomial ?Fri, 29 May 2020 08:58:38 -0500https://ask.sagemath.org/question/51629/binary-value-of-an-irreducible-polynomial/Answer by tmonteil for <p>if i defined the following finite field </p>
<pre><code>F=GF(2^15,'x')
</code></pre>
<p>then i've generated it's irreducible polynomial</p>
<pre><code>sage: IP=F.polynomial()
sage: IP
x^15 + x^5 + x^4 + x^2 + 1
</code></pre>
<p>how can i get the binary representation of this polynomial ?</p>
https://ask.sagemath.org/question/51629/binary-value-of-an-irreducible-polynomial/?answer=51630#post-id-51630I am not completely sure about what you call binary representation of the polynomial, but i could suggest:
sage: IP.coefficients(sparse=False)
[1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
If you want the bit of low weight to be on the right, you can do:
sage: L = IP.coefficients(sparse=False)
sage: L.reverse()
sage: L
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1]Fri, 29 May 2020 09:04:39 -0500https://ask.sagemath.org/question/51629/binary-value-of-an-irreducible-polynomial/?answer=51630#post-id-51630