# MethodError

using Nemo
function lift(x::FinFieldElem)
Fl = parent(x)
@Assert Nemo.isprime(order(Fl))
i = 0
while i != x
i += 1
end
return i
end

function order(x::FinFieldElem)
K = parent(x)
if x == Nemo.zero(K)
throw(ArgumentError(“Argument must be non-zero”))
else
k = 1
z = x
while z != Nemo.one(K)
z *= x
k += 1
end
return k
end
end
function roots(f::PolyElem{T}) where {T <: FinFieldElem}
fac = Nemo.factor(f)
res = Dict{T, Int}()
for index in fac
P, exp = index
if degree§ == 1
res[- coeff(P, 0)] = exp
end
end
res = collect(res)
return res
end
p = ZZ(2)^128 + 51
F, _ = FiniteField(p, 1, “u”)
FX, X = PolynomialRing(F, “X”)

E0 = EllipticCurve(F(1), F(9))
ZZY, Y = PolynomialRing(ZZ, “Y”)
frob_poly = Y^2 + ZZ(13815554068038022463)*Y + ZZ(340282366920938463463374607431768211507)
Card = ZZ(340282366920938463477190161499806233971)
primes_use_step = []
eigenvalues = Dict()
primes_use_step_torsion = []
orders = Dict()

for ell in primes(2, 100)
Fl, _ = FiniteField(ell, 1, “u”)
FlZ, Z = PolynomialRing(Fl, “Z”)
frob_poly_mod_ell = FlZ(frob_poly)
rts = roots(frob_poly_mod_ell)
if length(rts)==2
rts = (rts[1][1], rts[2][1])
order1 = order(rts[1])
order2 = order(rts[2])
if ((order1 != order2) & (min(order1, order2) < 10))
append!(primes_use_step_torsion, [ell])
orders[ell] = min(order1, order2)
else
append!(primes_use_step, ell)
eigenvalues[ell] = (lift(rts[1]), lift(rts[2]))
end
end
end

When I run this I get the error message as follows:

LoadError: MethodError: no method matching order(::FqNmodFiniteField)
Closest candidates are:
order(::FinFieldElem) at /home/cssc/exp.jl:13
Stacktrace:
[1] lift(::fq_nmod) at /home/cssc/exp.jl:4
[2] top-level scope at /home/cssc/exp.jl:65
[3] include at ./boot.jl:317 [inlined]
[5] include(::Module, ::String) at ./sysimg.jl:29
[6] include(::String) at ./client.jl:388
[7] top-level scope at none:0
in expression starting at /home/cssc/exp.jl:51

I don’t understand the problem. can any one help with this?

I can’t get your code to run but it looks like your problem is here:

``````order1 = order(rts[1])
order2 = order(rts[2])
``````

I’m not sure what `typeof(rts[1])` gives, but it seems that it is `FqNmodFiniteField`, while your order function is only defined for `FinFieldElem` inputs.

Your `roots` function seems to accept subtypes of `FinFieldElem`, you might want to define the `order` function in a saimilar way? (Note that I have no understanding of the type hierarchy here given that I can’t get Nemo to work on 0.7!)