Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why this algorithm does not work?

Hello I'm trying to write this algorithm in sage:

def roots(f, q):

return list of roots of f in finite field of q elements

K.<t> = GF(q)

r = [ ]

g = qq2zz(f).change_ring(K)

for a in K:

if g(a) == 0:

r.append(a)

return r

but i get error, it says that:

Traceback (click to the left of this block for traceback ) ....

how should I correct it?

why this algorithm does not work?

Hello I'm trying to write this algorithm in sage:

def roots(f, q):

q): # return list of roots of f in finite field of q elements

K.<t> elements K.<T> = GF(q)

GF(q) r = [ ]

] g = qq2zz(f).change_ring(K)

qq2zz(f).change_ring(K) for a in K:

K: if g(a) == 0:

r.append(a)

0: r.append(a) return r

r

but i get error, it says that:

Traceback (click to the left of this block for traceback ) ....

....

how should I correct it?

why this algorithm does not work?

Hello I'm trying to write this algorithm in sage:

def roots(f, q):
    # return list of roots of f in finite field of q elements
    K.<T> = GF(q)
    r = [ ]
    g = qq2zz(f).change_ring(K)
    for a in K:
        if g(a) == 0:
         r.append(a)
    return r

but i get error, it says that:

Traceback (click to the left of this block for traceback ) ....

how should I correct it?