Ask Your Question

Revision history [back]

z=var('z') K.

i=var('i')
K.<a> = GF(32, 'a',repr='int')
GF(8, 'a')
for k in K:
    print k^z

sum(k^i,i,0,3) Traceback (click to the left of this block for traceback) ... TypeError: unable to convert x (=i) to an integer

I met a similar problem. Take the following example.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    print sum(k^i,i,0,3)
sum(k^(2^i),i,0,3)

which prints:

Traceback (click to the left of this block for traceback)
...
TypeError: unable to convert x (=i) to an integer

Let us try another syntax.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    sum([x^(2^i) for i in [0..3]])

Now it is okay thanks to the previous answer. Is it possible to make it work with the first syntax?

I met a similar problem. Take the following example.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    print sum(k^(2^i),i,0,3)

which prints:

Traceback (click to the left of this block for traceback)
...
TypeError: unable to convert x (=i) to an integer

Let us try another syntax.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    sum([x^(2^i) for i in [0..3]])

Now it is okay thanks to the previous answer. Is it I wonder if it's possible to make it work with the first syntax?syntax.

I met a similar problem. Take the following example.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    print sum(k^(2^i),i,0,3)

which prints:

Traceback (click to the left of this block for traceback)
...
TypeError: unable to convert x (=i) to an integer

Let us try another syntax.

i=var('i')
K.<a> = GF(8, 'a')
for k in K:
    sum([x^(2^i) sum([k^(2^i) for i in [0..3]])

Now it is okay thanks to the previous answer. I wonder if it's possible to make it work with the first syntax.