On 2014-04-28, Nathann Cohen <[email protected]> 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 <[email protected]> wrote:
>
>> On 2014-04-28, Nathann Cohen <[email protected] <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
>> [email protected] <javascript:;>.
>> To post to this group, send email to
>> [email protected]<javascript:;>
>> .
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
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 http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.