How can I see GF(8,'x') x Z/3Z as an additive group ?

37 views
Skip to first unread message

Nathann Cohen

unread,
Apr 28, 2014, 4:49:58 AM4/28/14
to Sage Support
Hello everybody !

I need to use the elements of GF(8,'x') x Z/3Z as an additive group. Is there a way to do this with Sage ? I need that to add more combinatorial designs :-)

Thanks !

Nathann

Dima Pasechnik

unread,
Apr 28, 2014, 3:03:32 PM4/28/14
to sage-s...@googlegroups.com
Do you need multiplication in GF(8)? If not, you can just construct
the corresponding abelian group (Z/2Z)^3 x Z/3Z directly.

>
> Thanks !
>
> Nathann
>

Nathann Cohen

unread,
Apr 28, 2014, 3:32:59 PM4/28/14
to sage-s...@googlegroups.com
Yes I do need the multiplication too. I am implementing constructions of MOLS and for some of them I need to do some computations on a field, then give everything to a function that needs group elements as input... So I need it to be a group and also to see this as a field. Can we do that in Sage ? Nathann
--
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/DWfgVrFug38/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Dima Pasechnik

unread,
Apr 28, 2014, 4:06:50 PM4/28/14
to sage-s...@googlegroups.com
On 2014-04-28, Nathann Cohen <nathan...@gmail.com> wrote:
> Yes I do need the multiplication too. I am implementing constructions of
> MOLS and for some of them I need to do some computations on a field, then
> give everything to a function that needs group elements as input... So I
> need it to be a group and also to see this as a field. Can we do that in
> Sage ? Nathann

probably it's easiest to implement the multiplication action on tuples
directly, by contructing the corresponing matrices.
Here is how. (it's probably 15-20 lines of Sage code :/)
The multiplicative group is cyclic, and let's assume
that you have the primitive element, i.e. the generator of this cyclic
group. Usually it is the variable used in contruction.

sage: f.<a>=GF(8)
sage: a.multiplicative_order()
7

(or you can take f.primitive_element() for this)

You can assume that the basis elements e_0,...,e_{k-1} of your additive group,
(Z/pZ)^k, are a^0, a^1, ..., a^(k-1). (in our example p=2, k=3)
Now you know that mupltplication of e_j by a is just e_{j+1},
for j<k.
You need to know what happens with a*e_{k-1}=a^k.
This is what the f.polynomial() is for:

sage: f.polynomial()
a^3 + a + 1

(or take f.primitive_element().minimal_polynomial() if you generate
your multiplicative group with f.primitive_element())

So you know that a^3=-1-a (in general, of course, you need the coefs
of this polynomial), i.e. a^3=-e_0-e_1 and so you can write down the matrix of
mulpiplication by a:
So for our example it will be as follows:

a_mult=f.one()*matrix([[0,1,0],[0,0,1],[-1,-1,0]])

Now you can do multiplication by any element of the field:
say, a^2+1 will acts as a_mult^2+a_mult^0.

HTH,
Dima




>
> On Monday, 28 April 2014, Dima Pasechnik <dim...@gmail.com> wrote:
>
>> On 2014-04-28, Nathann Cohen <nathan...@gmail.com <javascript:;>>
>> wrote:
>> > Hello everybody !
>> >
>> > I need to use the elements of GF(8,'x') x Z/3Z as an additive group. Is
>> > there a way to do this with Sage ? I need that to add more combinatorial
>> > designs :-)
>> Do you need multiplication in GF(8)? If not, you can just construct
>> the corresponding abelian group (Z/2Z)^3 x Z/3Z directly.
>>
>> >
>> > Thanks !
>> >
>> > Nathann
>> >
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "sage-support" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/sage-support/DWfgVrFug38/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> sage-support...@googlegroups.com <javascript:;>.
>> To post to this group, send email to sage-s...@googlegroups.com<javascript:;>
>> .

Nathann Cohen

unread,
Apr 30, 2014, 5:48:46 AM4/30/14
to Sage Support
Hellooooooooo Dima !

Thank you for your help, but (as you know) I ended up fighting with
the category stuff to make this work. This is now in ticket #16269 for
whoever needs it:

http://trac.sagemath.org/ticket/16269

sage: F8xF3=GF(8,'x').cartesian_product(GF(3))
sage: x=GF(8,'x').primitive_element()
sage: e=F8xF3((x,2)); e
(x, 2)
sage: e+e
(0, 1)
sage: 3*e
(x, 0)
sage: 4*e
(0, 2)

Have fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnn !!!

Nathann

Dima Pasechnik

unread,
Apr 30, 2014, 9:57:35 AM4/30/14
to sage-s...@googlegroups.com
On 2014-04-30, Nathann Cohen <nathan...@gmail.com> wrote:
> Hellooooooooo Dima !
>
> Thank you for your help, but (as you know) I ended up fighting with
> the category stuff to make this work. This is now in ticket #16269 for

a good test for usability of the category stuff is whether this way
will make you write more code :-)



Reply all
Reply to author
Forward
0 new messages