# Revision history [back]

The problem can be seen as follows:

int(1)^GF125X(1)


Indeed it does not make sense to raise integers to polynomial powers in general.

Maybe the error message should be more descriptive, by including the types.

In your case, it seems you have confused f_i and i: note enumerate yields a list of pairs where the first element is the index.

The problem can be seen as follows:

int(1)^GF125X(1)


Indeed it does not make sense to raise integers to polynomial powers in general.

Maybe the error message should be more descriptive, by including the types.

In your case, it seems you have confused (in particular) f_i and i: note enumerate yields a list of pairs where the first element is the index.

The problem can be seen as follows:

int(1)^GF125X(1)


Indeed it does not make sense to raise integers to polynomial powers in general.

Maybe the error message should be more descriptive, by including the types.

In your case, it seems you have confused (in particular) f_i and i: note enumerate yields a list of pairs where the first element is the index.

Also you can omit the argument "GF" (which, confusingly, is a polynomial ring): it can be obtained from f by f.parent(). Furthermore you can probably avoid using my_mul by using prod and zip.

The problem can be seen as follows:

int(1)^GF125X(1)


Indeed it does not make sense to raise integers to polynomial powers in general.

Maybe the error message should be more descriptive, by including the types.

In your case, it seems you have confused f_i and i: note enumerate yields a list of pairs where the first element is the index.

Also you can omit the argument "GF" (which, confusingly, is a polynomial ring): it can be obtained from f by f.parent(). Furthermore you can probably avoid using my_mul by using prod and zip.

. Also, you will probably find it convenient to define

GF125X.<x> = GF(5^3)[]
f = (x^5 + x^2 + x^1 + 1)^2*x^5


so that x is really the generator of a polynomial ring, and you can define f without casting.

The problem can be seen as follows:

int(1)^GF125X(1)


Indeed it does not make sense to raise integers to polynomial powers in general.

Maybe the error message should be more descriptive, by including the types.

In your case, it seems you have confused f_i and i: note enumerate yields a list of pairs where the first element is the index.

Also you can omit the argument "GF" (which, confusingly, is a polynomial ring): it can be obtained from f by f.parent(). Furthermore you can probably avoid using my_mul by using prod and zip. Also, you will probably find it convenient to define

GF125X.<x> = GF(5^3)[]
f = (x^5 + x^2 + x^1 + 1)^2*x^5


so that x is really the generator of a polynomial ring, and you can define f without casting.

explicit conversion.