On Wednesday, March 22, 2017 at 3:19:14 PM UTC-7, [email protected] wrote:
>
> Oh , didn't know this piece of info.
>>
> This thing took me time more than it would have if I implemented it 
> myself, and I was intending to xD 
> What I get from your answer is that if I put binary list inside k it 
> returns the field.
> sage: k([0,1,1])  # where most significant bit is on the right
> a^2 + a
>
> thank you very much, I most probably would have never known this by my 
> own, didn't see it any where in the docs.
> May be I just don't look good enough
>
It's a reasonable thing to try if you think of elements in k as represented 
by polynomials in a. A polynomial in sage can be constructed by calling the 
polynomial ring with the list of coefficients. It's sort-of documented in 
GF(2^8)._element_constructor:

   Free module elements over "prime_subfield()" are interpreted
   'little endian':

      sage: k = GF(2**8, 'a')
      sage: e = k.vector_space().gen(1); e
      (0, 1, 0, 0, 0, 0, 0, 0)
      sage: k(e)
      a

but as you can see the constructor is a bit more liberal than just that. 
It's "discoverable" in the sense that it's reasonable to hope that it works 
once you know how sage works, but it doesn't seem to be documented 
literally.

As to the fact that you need to look at the binary representation: Both 
integers and polynomials over GF(2) are naturally represented as 
bitstrings. The indentification of these is what underlies Givaro's 
"integer_representation".

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to