nffactor(k, f);
#=
-from
+from
https://www.math.u-bordeaux.fr/~kbelabas/research/vanhoeij.pdf
p 26, polys h_1, ..., h_10 (so far)
diff --git a/src/ModAlgAss/MeatAxe.jl b/src/ModAlgAss/MeatAxe.jl
index e4988d3443..90b8d3521f 100644
--- a/src/ModAlgAss/MeatAxe.jl
+++ b/src/ModAlgAss/MeatAxe.jl
@@ -57,7 +57,7 @@ function cleanvect!(M::T, v::T) where T
if !iszero(c)
w[1,k] -= mult * c
end
- end
+ end
end
return v
end
@@ -130,13 +130,13 @@ function closure(C::T, G::Vector{T}) where {T}
res = cleanvect!(C, w*G[j]) # cleanvect(C, w*G[j]) but we
# can do it inplace since w*G[j] is fresh
if !iszero(res)
- C = vcat(C, res)
+ C = vcat(C, res)
if nrows(C) == nc
i = ncols(C)+1
break
end
- end
- end
+ end
+ end
i+=1
end
@@ -160,7 +160,7 @@ function closure(C::T, G::Vector{T}) where {T}
else
r = rref!(C)
end
-
+
if r != nrows(C)
C = sub(C, 1:r, 1:ncols(C))
end
@@ -187,15 +187,15 @@ function clean_and_quotient(M::T, N::T, pivotindex::Set{Int}) where {T}
N[i,s]-=coeff[i,j]*M[j,s]
end
end
- end
+ end
vec= zero_matrix(base_ring(M), nrows(N), ncols(M)-length(pivotindex))
- for i=1:nrows(N)
+ for i=1:nrows(N)
pos=0
for s=1:ncols(M)
if !(s in pivotindex)
pos+=1
vec[i,pos]=N[i,s]
- end
+ end
end
end
return coeff, vec
@@ -217,9 +217,9 @@ function clean_and_quotient_quo(M::T, N::T, pivotindex::Set{Int}) where {T}
N[i,s] -= r*M[j,s]
end
end
- end
+ end
vec = zero_matrix(base_ring(M), nrows(N), ncols(M)-length(pivotindex))
- for i=1:nrows(N)
+ for i=1:nrows(N)
pos=0
for s=1:ncols(M)
if !(s in pivotindex)
@@ -678,7 +678,7 @@ function eigenspace_as_matrix(M::MatElem{T}, lambda::T) where T <: FieldElem
return view(res, 1:d, 1:ncols(res))
end
-
+
function _relations_dim_1(M::ModAlgAss{S, T, V}, N::ModAlgAss{S, T, V}) where {S, T, V}
@assert M.isirreducible == 1
@assert dimension(M) == 1
@@ -780,7 +780,7 @@ function irreducible_submodules(N::ModAlgAss{S, T, V}, M::ModAlgAss{S, T, V}) wh
if a == 1
return T[closure(kern, N.action)]
end
- end
+ end
vects = T[sub(kern, i:i, 1:N.dimension) for i=1:a]
if dimension(M) == 1
return _submodules_direct_sum_dim_1(vects, N)
@@ -821,7 +821,7 @@ function _all_combinations(M::MatElem{T}) where T
end
res[ind] = m * M
ind += 1
- end
+ end
return res
end
@@ -961,13 +961,13 @@ end
@doc Markdown.doc"""
minimal_submodules(M::ModAlgAss)
-
+
Given a Fq[G]-module $M$, it returns all the minimal submodules of $M$.
"""
function minimal_submodules(M::ModAlgAss{S, T, V}, dim::Int=M.dimension+1, lf = Tuple{ModAlgAss{S, T, V}, Int}[]) where {S, T, V}
return T[x[1] for x in _minimal_submodules(M, dim, lf)]
end
-
+
@doc Markdown.doc"""
maximal_submodules(M::ModAlgAss)
diff --git a/src/ModAlgAss/ModAlgAss.jl b/src/ModAlgAss/ModAlgAss.jl
index ea694a4ea4..cb3d7bfe9e 100644
--- a/src/ModAlgAss/ModAlgAss.jl
+++ b/src/ModAlgAss/ModAlgAss.jl
@@ -10,7 +10,7 @@ mutable struct ModAlgAss{S, T, V}
algebra::AlgAss{V}
action_of_gens::Vector{T}
action_of_basis::Vector{T}
-
+
function ModAlgAss{S, T}(action::Vector{T}) where {S, T}
z = new{S, T, elem_type(S)}()
z.action = action
@@ -19,7 +19,7 @@ mutable struct ModAlgAss{S, T, V}
if z.dimension == 1
z.isirreducible = 1
z.dimension_splitting_field = 1
- else
+ else
z.isirreducible = 0
z.dimension_splitting_field = 0
end
diff --git a/src/NumField/Field.jl b/src/NumField/Field.jl
index facb171b07..f40e147408 100644
--- a/src/NumField/Field.jl
+++ b/src/NumField/Field.jl
@@ -330,8 +330,8 @@ end
@doc doc"""
absolute_basis(K::NumField) -> Vector{NumFieldElem}
-Returns an array of elements that form a basis of $K$ (as a vector space)
-over the rationals.
+Returns an array of elements that form a basis of $K$ (as a vector space)
+over the rationals.
"""
absolute_basis(::NumField)
diff --git a/src/NumField/NfAbs.jl b/src/NumField/NfAbs.jl
index c1981a7a18..f335c89b86 100644
--- a/src/NumField/NfAbs.jl
+++ b/src/NumField/NfAbs.jl
@@ -1,13 +1,13 @@
-import Nemo.sub!, Base.gcd
+import Nemo.sub!, Base.gcd
export induce_rational_reconstruction, induce_crt, root, roots,
ismonic, radical_extension, isradical_extension,
- iskummer_extension, cyclotomic_field, wildanger_field,
+ iskummer_extension, cyclotomic_field, wildanger_field,
compositum
-add_verbose_scope(:PolyFactor)
-add_assert_scope(:PolyFactor)
-add_verbose_scope(:CompactPresentation)
-add_assert_scope(:CompactPresentation)
+add_verbose_scope(:PolyFactor)
+add_assert_scope(:PolyFactor)
+add_verbose_scope(:CompactPresentation)
+add_assert_scope(:CompactPresentation)
if Int==Int32
global const p_start = next_prime(2^30)
diff --git a/src/NumField/NfAbs/CompactRepresentation.jl b/src/NumField/NfAbs/CompactRepresentation.jl
index 9092f21691..a1f79d7c9c 100644
--- a/src/NumField/NfAbs/CompactRepresentation.jl
+++ b/src/NumField/NfAbs/CompactRepresentation.jl
@@ -14,7 +14,7 @@ function compact_presentation(a::FacElem{nf_elem, AnticNumberField}, nn::Int = 2
if isempty(a.fac)
return a
end
-
+
if typeof(decom) == Bool
ZK = lll(maximal_order(K))
de::Dict{NfOrdIdl, fmpz} = factor_coprime(a, IdealSet(ZK), refine = true)
@@ -60,7 +60,7 @@ function compact_presentation(a::FacElem{nf_elem, AnticNumberField}, nn::Int = 2
if haskey(cached_red, p)
Dp = cached_red[p]
if haskey(Dp, e_p)
- Ap, ap = Dp[e_p]
+ Ap, ap = Dp[e_p]
else
Ap, ap = power_reduce(p, fmpz(e_p))
Dp[e_p] = (Ap, ap)
@@ -292,7 +292,7 @@ function evaluate_mod(a::FacElem{nf_elem, AnticNumberField}, B::NfOrdFracIdl)
ZK = order(B)
dB = denominator(B)#*denominator(basis_matrix(ZK, copy = false))
-
+
@hassert :CompactPresentation 1 factored_norm(B) == abs(factored_norm(a))
@hassert :CompactPresentation 2 B == ideal(order(B), a)
@@ -438,7 +438,7 @@ function _ispower(a::FacElem{nf_elem, AnticNumberField}, n::Int; with_roots_unit
end
df = FacElem(d)
@hassert :CompactPresentation 2 evaluate(df^n*b *inv(a))== 1
-
+
den = denominator(b, ZK)
fl, den1 = ispower(den, n)
if fl
diff --git a/src/NumField/NfAbs/ConjugatesNS.jl b/src/NumField/NfAbs/ConjugatesNS.jl
index cfb679ccfe..2617e6ecbd 100644
--- a/src/NumField/NfAbs/ConjugatesNS.jl
+++ b/src/NumField/NfAbs/ConjugatesNS.jl
@@ -165,7 +165,7 @@ function _is_complex_conj(v::Vector, w::Vector, pos::Vector, roots::Vector)
elseif v[i] != w[i]
return false
end
- i += 1
+ i += 1
end
return true
end
@@ -215,7 +215,7 @@ function _evaluate(f::fmpq_mpoly, vals::Vector{acb})
end
mul!(t, t, powers[j][exp])
#t = t*powers[j][exp]
- end
+ end
push!(r, c*t)
j = i = i + 1
while iseven(j) && length(r) > 1
diff --git a/src/NumField/NfAbs/Elem.jl b/src/NumField/NfAbs/Elem.jl
index a7d8020287..4a5f5b37e4 100644
--- a/src/NumField/NfAbs/Elem.jl
+++ b/src/NumField/NfAbs/Elem.jl
@@ -501,14 +501,14 @@ function factor_trager(f::PolyElem{nf_elem})
end
@vprint :PolyFactor 2 "need to shift by $k, now the norm\n"
- if any(x -> denominator(x) > 1, coefficients(g)) ||
+ if any(x -> denominator(x) > 1, coefficients(g)) ||
!isdefining_polynomial_nice(K)
@vtime :PolyFactor 2 N = Hecke.Globals.Qx(norm(g))
else
@vtime :PolyFactor 2 N = norm_mod(g, Zx)
@hassert :PolyFactor 1 N == Zx(norm(g))
end
-
+
while isconstant(N) || !issquarefree(N)
error("should not happen")
k = k + 1
diff --git a/src/NumField/NfAbs/MPolyAbsFact.jl b/src/NumField/NfAbs/MPolyAbsFact.jl
index ff937fe199..f94b497afc 100644
--- a/src/NumField/NfAbs/MPolyAbsFact.jl
+++ b/src/NumField/NfAbs/MPolyAbsFact.jl
@@ -51,7 +51,7 @@ end
in F_p[[t]][x]
a RootCtx for poly in F_p[[t]][x] to find roots in F_q[[t]]
Done.
-
+
See what Dan did in this case.
=#
@@ -183,11 +183,11 @@ end
function lift(C::HenselCtxFqRelSeries{<:SeriesElem})
St = parent(C.lf[1])
S = base_ring(C.lf[1])
-
+
C.lf[1]
pr = precision(coeff(C.lf[1], 0))
N2 = 2*pr
-
+
S.prec_max = N2+1
i = length(C.lf)
@@ -207,7 +207,7 @@ function lift(C::HenselCtxFqRelSeries{<:SeriesElem})
@assert ismonic(C.lf[i])
end
@assert ismonic(f)
-
+
#formulae and names from the Flint doc
h = C.lf[j]
g = C.lf[j-1]
@@ -219,12 +219,12 @@ function lift(C::HenselCtxFqRelSeries{<:SeriesElem})
set_precision!(b, N2)
fgh = shift_coeff_right(f-g*h, pr)
-
+
G = shift_coeff_left(rem(fgh*b, g), pr)+g
H = shift_coeff_left(rem(fgh*a, h), pr)+h
-
+
t = shift_coeff_right(1-a*G-b*H, pr)
-
+
B = shift_coeff_left(rem(t*b, g), pr)+b
A = shift_coeff_left(rem(t*a, h), pr)+a
if i < length(C.lf)
@@ -258,7 +258,7 @@ function _set_precision!(f::PolyElem{<:SeriesElem{qadic}}, n::Int)
end
return f
end
-# TODO: bad names...
+# TODO: bad names...
function _shift_coeff_left(f::PolyElem{<:SeriesElem{qadic}}, n::Int)
g = parent(f)()
for i = 0:length(f)
@@ -282,7 +282,7 @@ end
function _shift_coeff_right(f::PolyElem{<:SeriesElem{qadic}}, n::Int)
g = parent(f)()
for i = 0:length(f)
- @assert all(y -> valuation(polcoeff(coeff(f, i), y)) >= n, 0:pol_length(coeff(f, i)))
+ @assert all(y -> valuation(polcoeff(coeff(f, i), y)) >= n, 0:pol_length(coeff(f, i)))
setcoeff!(g, i, map_coefficients(x -> shift_right(x, n), coeff(f, i), parent = base_ring(f)))
end
return g
@@ -309,7 +309,7 @@ function lift(P::Preinv)
P.fi = truncate(P.fi*truncate((parent(f)(2)-f*P.fi), 2*P.n), 2*P.n)
P.n *= 2
end
-# von zur Gathen: Modern Computer Algebra, p 243:
+# von zur Gathen: Modern Computer Algebra, p 243:
# 9.1. Division with remainder using Newton iteration
function Base.rem(g::PolyElem, P::Preinv)
if degree(g) < degree(P.f)
@@ -341,10 +341,10 @@ function lift_q(C::HenselCtxFqRelSeries{<:SeriesElem{qadic}})
St = parent(C.lf[1])
S = base_ring(C.lf[1])
Q = base_ring(S)
-
+
pr = precision(coeff(coeff(C.lf[1], 0), 0))
N2 = 2*pr
-
+
setprecision!(Q, N2)
i = length(C.lf)
@@ -373,7 +373,7 @@ function lift_q(C::HenselCtxFqRelSeries{<:SeriesElem{qadic}})
b = _set_precision(b, N2)
fgh = _shift_coeff_right(f-g*h, pr)
-
+
@assert ismonic(g)
@assert !iszero(constant_coefficient(g))
@assert ismonic(h)
@@ -387,7 +387,7 @@ function lift_q(C::HenselCtxFqRelSeries{<:SeriesElem{qadic}})
@assert ismonic(H)
t = _shift_coeff_right(1-a*G-b*H, pr)
-
+
B = _shift_coeff_left(rem(t*b, gi), pr)+b
A = _shift_coeff_left(rem(t*a, hi), pr)+a
@@ -566,7 +566,7 @@ function root(R::RootCtx, i::Int, j::Int)
o = one(parent(R.all_R[1]))
R.RP = [[set_precision(o, precision(R.all_R[1])) for x = R.all_R], copy(R.all_R)]
end
- if length(R.RP) > j
+ if length(R.RP) > j
return (R.RP[j+1][i])
end
while length(R.RP) <= j+1
@@ -598,7 +598,7 @@ function roots(f::fmpq_mpoly, p_max::Int=2^15; pr::Int = 2)
#f needs to be irreducible over Q and g square-free
g = evaluate(ff, [gen(Zx), Zx(0)])
@assert degree(g) == degree(f, 1)
-
+
d = typemax(Int)
best_p = p_max
pc = 0
@@ -618,7 +618,7 @@ function roots(f::fmpq_mpoly, p_max::Int=2^15; pr::Int = 2)
else
pc += 1
end
-
+
if e == 1 || pc > 1.5 * degree(g)
p = best_p
@vprint :AbsFact 1 "using $best_p of degree $d\n"
@@ -665,8 +665,8 @@ function combination(RC::RootCtx)
n = precision(R[1])
@assert all(x->precision(x) == n, R)
- #ps = [[div(x^i % tn, td^i) for i = 1:n] for x = R]
-
+ #ps = [[div(x^i % tn, td^i) for i = 1:n] for x = R]
+
F = base_ring(Ft)
k = degree(F)
@@ -681,7 +681,7 @@ function combination(RC::RootCtx)
#also: it would make the lifting above trivial (precision 2)
#deal: if monic in x of degree n and deg_y(coeff of x^(n-1)) = r,
# then for the 1st power sum we get r as a degree bound. In the paper
- # r == 1...
+ # r == 1...
# reasoning: sum of second highest terms of factor == second highest
# of poly => bound
# similar would be for other power sums - if I'd compute them.
@@ -730,9 +730,9 @@ function combination(RC::RootCtx)
ld = evaluate(map_coefficients(x->F(ZZ(x)), lc), [set_precision(Ft(0), n), set_precision(gen(Ft), n)])
R = R .* ld
@assert precision(R[1]) >= n
-
+
mn = matrix([[Fp(coeff(coeff(x^pow, pow*d+j), lk)) for lk = 0:k-1] for x = R])
-
+
if false && iszero(mn)
@vprint :AbsFact 2 "found zero column, disgarding\n"
bad += 1
@@ -752,7 +752,7 @@ function combination(RC::RootCtx)
ke = kernel(nn)
@vprint :AbsFact 2 "current kernel dimension: $(ke[1])\n"
- if last_rank == ke[1]
+ if last_rank == ke[1]
bad += 1
if bad > max(2, div(length(R), 2))
pow += 1
@@ -807,14 +807,14 @@ function block_system(a::Vector{T}) where {T}
d[a[i]] = [i]
end
end
- return sort(collect(values(d)), lt = (a,b) -> isless(a[1], b[1]))
+ return sort(collect(values(d)), lt = (a,b) -> isless(a[1], b[1]))
end
#= bounds:
f in Z[x,y], g, h in C[x,y]
H(f) = max abs value coeff of f
gh = f
- then
+ then
H(g) H(h) <= 2^(deg_x(f) + deg_y(g) - 2) ((deg_x(f)+1)(deg_y(f)+1))^(1/2) H(f)
=#
"""
@@ -826,7 +826,7 @@ function field(RC::RootCtx, m::MatElem)
bnd = numerator(maximum(abs(x) for x = coefficients(RC.f))) * fmpz(2)^(degree(RC.f, 1) + degree(RC.f, 2)-2) * Hecke.root(fmpz((degree(RC.f, 1)+1)*(degree(RC.f, 2)+1)), 2)
- #all coeffs should be bounded by bnd...
+ #all coeffs should be bounded by bnd...
#we have roots, we need to combine roots for each row in m where the entry is pm 1
#the coeffs then live is a number field, meaning that the elem sym functions or
@@ -879,7 +879,7 @@ function field(RC::RootCtx, m::MatElem)
Qq = QadicField(characteristic(F), k, 1, cached = false)[1]
Qqt = PolynomialRing(Qq, cached = false)[1]
k, mk = ResidueField(Qq)
-
+
phi = find_morphism(k, F) #avoids embed - which stores the info
kt, t = PolynomialRing(k, cached = false)
@@ -933,7 +933,7 @@ function field(RC::RootCtx, m::MatElem)
llc = coeff(P, 1)
P *= inv(llc)
-
+
_lc = evaluate(leading_coefficient(P, 1), [zero(Hecke.Globals.Qx), gen(Hecke.Globals.Qx)])
_lc = Hecke.squarefree_part(_lc)
local H, fa
@@ -1022,16 +1022,16 @@ function field(RC::RootCtx, m::MatElem)
mc(f) = # PolyElem{SeriesElem{Fq}} -> PolyElem{SeriesElem{Qq}}
map_coefficients(x->map_coefficients(y->setprecision(preimage(mk, y), 1), x, parent = SQq), f, parent = SQqt)
-
+
HQ = HenselCtxFqRelSeries(HH.f, map(mc, HH.lf), map(mc, HH.cf), HH.n)
QqXY, (X, Y) = PolynomialRing(Qq, 2, cached = false)
- pr = 1
+ pr = 1
while true
pr *= 2
- if pr > 800
+ if pr > 800
error("too bas")
end
@vprint :AbsFact 1 "using p-adic precision of $pr\n"
@@ -1125,7 +1125,7 @@ end
Given an irreducible bivariate polynomial over `Q` compute the
absolute factorisation.
-Returns two polynomials:
+Returns two polynomials:
- the (absolutely) irreducible factor over the smallest number field
- the co-factor
@@ -1138,7 +1138,7 @@ function absolute_bivariate_factorisation(f::fmpq_mpoly)
x, y = gens(R)
lf = factor(f)
- if length(lf.fac) > 1 || any(x->x>1, values(lf.fac))
+ if length(lf.fac) > 1 || any(x->x>1, values(lf.fac))
error("poly must be irreducible over Q")
end
@@ -1169,7 +1169,7 @@ function absolute_bivariate_factorisation(f::fmpq_mpoly)
return b, divexact(map_coefficients(k, f, parent = kXY), b)
end
- s =-1
+ s =-1
while true
s += 1
@vprint :AbsFact 1 "substitution to $s\n"
@@ -1195,7 +1195,7 @@ function absolute_bivariate_factorisation(f::fmpq_mpoly)
if nrows(z) == 1
return f, one(parent(f))
end
-
+
@vtime :AbsFact 1 aa = field(r, z)
aa !== nothing && break
end
@@ -1526,7 +1526,7 @@ export factor_absolute
#application (for free)
-function factor(f::Union{fmpq_mpoly, fmpz_mpoly}, C::AcbField)
+function factor(f::Union{fmpq_mpoly, fmpz_mpoly}, C::AcbField)
fa = factor_absolute(f)
D = Dict{Generic.MPoly{acb}, Int}()
Cx, x = PolynomialRing(C, map(String, symbols(parent(f))), cached = false)
@@ -1550,7 +1550,7 @@ function factor(f::Union{fmpq_mpoly, fmpz_mpoly}, C::AcbField)
return Fac(map_coefficients(C, fa[1], parent = Cx), D)
end
-function factor(f::Union{fmpq_mpoly, fmpz_mpoly}, R::ArbField)
+function factor(f::Union{fmpq_mpoly, fmpz_mpoly}, R::ArbField)
fa = factor_absolute(f)
D = Dict{Generic.MPoly{arb}, Int}()
Rx, x = PolynomialRing(R, map(String, symbols(parent(f))), cached = false)
@@ -1600,7 +1600,7 @@ end
example:
Qxy, (y, x) = PolynomialRing(QQ, ["y", "x"])
-include("/home/fieker/Downloads/n60s3.m");
+include("/home/fieker/Downloads/n60s3.m");
#from https://www.math.univ-toulouse.fr/~cheze/n60s3.m
r = absolute_bivariate_factorisation(P)
diff --git a/src/NumField/NfAbs/MPolyGcd.jl b/src/NumField/NfAbs/MPolyGcd.jl
index b06eea7fa3..2c4afebeb0 100644
--- a/src/NumField/NfAbs/MPolyGcd.jl
+++ b/src/NumField/NfAbs/MPolyGcd.jl
@@ -116,7 +116,7 @@ end
function data_assure(R::RecoCtx)
R.new_data || return
-
+
R.L = lll(basis_matrix(R.p1, R.f, R.k))
if isdefined(R, :LI) #to keep stucture consistent
R.LI, R.d = pseudo_inv(R.L)
@@ -201,7 +201,7 @@ function Hecke.rational_reconstruction(a::nf_elem, R::RecoCtx; integral::Bool =
K = parent(a)
d = Nemo.elem_from_mat_row(K, sub(L, 1:1, 1:n), 1, fmpz(1))
n = Nemo.elem_from_mat_row(K, sub(L, 1:1, n+1:2*n), 1, fmpz(1))
- if split
+ if split
return true, n, d
else
return true, n//d
@@ -282,7 +282,7 @@ function _gcd(f::Hecke.Generic.MPoly{nf_elem}, g::Hecke.Generic.MPoly{nf_elem},
if isempty(me)
continue
end
-
+
@vtime :MPolyGcd 3 fp = Hecke.modular_proj(f, me)
@vtime :MPolyGcd 3 gp = Hecke.modular_proj(g, me)
glp = Hecke.modular_proj(gl, me)
@@ -328,7 +328,7 @@ function _gcd(f::Hecke.Generic.MPoly{nf_elem}, g::Hecke.Generic.MPoly{nf_elem},
d *= p
stable -= 1
end
- if fl && stable <= 0
+ if fl && stable <= 0
if divides(f, gd)[1] && divides(g, gd)[1]
# @show "gcd stop", nbits(d), length(gd), gd
gd*=inv(gl)
@@ -411,7 +411,7 @@ function Hecke.induce_crt(a::Hecke.Generic.MPoly{nf_elem}, p::fmpz, b::Hecke.Gen
end
end
return finish(c), pq
-end
+end
function Hecke.induce_crt(a::fmpz_mat, p::fmpz, b::fmpz_mat, q::fmpz, signed::Bool = false)
pi = invmod(p, q)
@@ -431,7 +431,7 @@ function Hecke.induce_crt(a::fmpz_mat, p::fmpz, b::fmpz_mat, q::fmpz, signed::Bo
end
end
return c, pq
-end
+end
function Hecke.modular_proj(f::Generic.MPoly{nf_elem}, me::Hecke.modular_env)
if !isdefined(me, :Kxy)
diff --git a/src/NumField/NfAbs/NfAbs.jl b/src/NumField/NfAbs/NfAbs.jl
index 116a759b79..d7afabbfc6 100644
--- a/src/NumField/NfAbs/NfAbs.jl
+++ b/src/NumField/NfAbs/NfAbs.jl
@@ -416,7 +416,7 @@ function normal_basis(K::AnticNumberField)
break
end
end
-
+
return _normal_basis_generator(K, p)
end
@@ -975,7 +975,7 @@ function islinearly_disjoint(K1::AnticNumberField, K2::AnticNumberField)
f = change_base_ring(K2, K1.pol)
return isirreducible(f)
end
-
+
################################################################################
#
# more general coercion, field lattice
@@ -1116,7 +1116,7 @@ end
@doc Markdown.doc"""
embed(f::Map{<:NumField, <:NumField})
-
+
Registers `f` as a canonical embedding from the domain into the co-domain.
Once this embedding is registered, it cannot be changed.
"""
@@ -1161,7 +1161,7 @@ end
@doc Markdown.doc"""
hasembedding(F::NumField, G::NumField) -> Bool
-
+
Checks if an embedding from $F$ into $G$ is already known.
"""
function hasembedding(F::NumField, G::NumField)
@@ -1213,7 +1213,7 @@ function find_all_super(A::NumField, filter::Function = x->true)
return all_s
end
-#finds a common super field for A and B, using the weak-refs
+#finds a common super field for A and B, using the weak-refs
# in special -> :sub_of
function common_super(A::NumField, B::NumField)
A === B && return A
@@ -1263,8 +1263,8 @@ end
@doc Markdown.doc"""
embedding(k::NumField, K::NumField) -> Map
-
-Assuming $k$ is known to be a subfield of $K$, return the embedding map.
+
+Assuming $k$ is known to be a subfield of $K$, return the embedding map.
"""
function embedding(k::NumField, K::NumField)
if issimple(k)
@@ -1278,7 +1278,7 @@ function force_coerce_cyclo(a::AnticNumberField, b::nf_elem, throw_error::Type{V
# Base.show_backtrace(stdout, backtrace())
fa = get_special(a, :cyclo)
fb = get_special(parent(b), :cyclo)
-
+
if fa % fb == 0 #coerce up, includes fa == fb
#so a = p(z) for p in Q(x) and z = gen(parent(b))
q = divexact(fa, fb)
@@ -1323,7 +1323,7 @@ function force_coerce_cyclo(a::AnticNumberField, b::nf_elem, throw_error::Type{V
q = divexact(fb, fa)
cb = [i for i=1:fb if gcd(i, fb) == 1] # the "conjugates" in the large field
- ca = [[i for i = cb if i % fa == j] for j=1:fa if gcd(j, fa) == 1] #broken into blocks
+ ca = [[i for i = cb if i % fa == j] for j=1:fa if gcd(j, fa) == 1] #broken into blocks
#in general one could test first if the evaluation is constant on a block
#equivalently, if the element is Galois invariant under the fix group of a.
diff --git a/src/NumField/NfAbs/NonSimple.jl b/src/NumField/NfAbs/NonSimple.jl
index db062e318a..9a81b81070 100644
--- a/src/NumField/NfAbs/NonSimple.jl
+++ b/src/NumField/NfAbs/NonSimple.jl
@@ -761,7 +761,7 @@ end
#end
# TODO: - Preallocate the exps array
-# - Do we still need this?
+# - Do we still need this?
function msubst(f::fmpq_mpoly, v::Vector{T}) where {T}
n = length(v)
@assert n == nvars(parent(f))
diff --git a/src/NumField/NfAbs/NormRelation/Clgp.jl b/src/NumField/NfAbs/NormRelation/Clgp.jl
index 35e2d6659b..c87e034898 100644
--- a/src/NumField/NfAbs/NormRelation/Clgp.jl
+++ b/src/NumField/NfAbs/NormRelation/Clgp.jl
@@ -15,7 +15,7 @@ function get_sunits_from_subfield_data!(c::Hecke.ClassGrpCtx, UZK::Hecke.UnitGrp
@vprint :NormRelation 1 "Using the compact presentation\n"
_add_sunits_from_brauer_relation!(c, UZK, N, compact = onlyp)
end
-end
+end
function class_group_via_brauer(O::NfOrd, N::NormRelation; compact::Bool = true)
K = N.K
diff --git a/src/NumField/NfAbs/NormRelation/SUnits.jl b/src/NumField/NfAbs/NormRelation/SUnits.jl
index 19ebc7e462..800f16636c 100644
--- a/src/NumField/NfAbs/NormRelation/SUnits.jl
+++ b/src/NumField/NfAbs/NormRelation/SUnits.jl
@@ -222,7 +222,7 @@ function _add_sunits_from_brauer_relation!(c, UZK, N; invariant::Bool = false, c
end
end
=#
- has_full_rk = Hecke.has_full_rank(UZK)
+ has_full_rk = Hecke.has_full_rank(UZK)
@vtime :NormRelation 4 ff = Hecke.add_unit!(UZK, img_u)
if !has_full_rk && !ff
push!(add_unit_later, img_u)
@@ -463,7 +463,7 @@ function __sunit_group_fac_elem_quo_via_brauer(N::NormRelation, S::Vector{NfOrdI
UZK.finished = true
end
- if saturate_units && !UZK.finished
+ if saturate_units && !UZK.finished
for (p, e) in factor(index(N))
@vprint :NormRelation 1 "Saturating at $p \n"
b = Hecke.saturate!(UZK, Int(p), 3.5, easy_root = true, use_LLL = true)
@@ -551,11 +551,11 @@ function __sunit_group_fac_elem_quo_via_brauer(N::NormRelation, S::Vector{NfOrdI
function exp(a::GrpAbFinGenElem)
@assert parent(a) == res_group
z = prod(units[i]^a[i] for i = 1:length(units))
- if !isempty(sunitsmodunits)
+ if !isempty(sunitsmodunits)
zz = prod(sunitsmodunits[i]^a[length(units) + i] for i in 1:length(sunitsmodunits))
mul!(z, z, zz)
end
-
+
for (k, v) in z.fac
if iszero(v)
delete!(z.fac, k)
@@ -569,7 +569,7 @@ function __sunit_group_fac_elem_quo_via_brauer(N::NormRelation, S::Vector{NfOrdI
disclog = function(a)
throw(NotImplemented())
end
-
+
r = Hecke.MapSUnitGrpFacElem()
r.valuations = Vector{SRow{fmpz}}(undef, ngens(res_group))
for i = 1:length(units)
diff --git a/src/NumField/NfAbs/NormRelation/Setup.jl b/src/NumField/NfAbs/NormRelation/Setup.jl
index 9fd3f30ab9..14fe3db548 100644
--- a/src/NumField/NfAbs/NormRelation/Setup.jl
+++ b/src/NumField/NfAbs/NormRelation/Setup.jl
@@ -5,12 +5,12 @@
################################################################################
# Example
-#
+#
# julia> f = x^8+8*x^6+64*x^4-192*x^2+576
# x^8+8*x^6+64*x^4-192*x^2+576
-#
+#
# julia> K, a = number_field(f);
-#
+#
# julia> N = Hecke._norm_relation_setup(K)
# Norm relation of
# Number field over Rational Field with defining polynomial x^8+8*x^6+64*x^4-192*x^2+576
@@ -22,7 +22,7 @@
# Number field over Rational Field with defining polynomial x^2+6
# Number field over Rational Field with defining polynomial x^2-3
# Number field over Rational Field with defining polynomial x^2-x+1
-
+
mutable struct NormRelation{T}
K::AnticNumberField
subfields::Vector{Tuple{AnticNumberField, NfToNfMor}}
@@ -136,7 +136,7 @@ function _norm_relation_for_sunits(K::AnticNumberField; small_degree::Bool = tru
nonredundant = trues(length(ls))
for i in 1:length(ls)
- if !nonredundant[i]
+ if !nonredundant[i]
continue
end
for j = i+1:length(ls)
@@ -215,7 +215,7 @@ function _norm_relation_setup_generic(K::AnticNumberField; small_degree::Bool =
nonredundant[i] = true
end
end
-
+
z = NormRelation{Int}()
z.K = K
z.isnormal = falses(n)
@@ -348,7 +348,7 @@ function induce_action_from_subfield(N::NormRelation, i, s, FB, cache)
mk = embedding(N, i)
zk = order(s[1])
-
+
if length(cache) == 0
cache = resize!(cache, length(s))
cached = false
@@ -362,7 +362,7 @@ function induce_action_from_subfield(N::NormRelation, i, s, FB, cache)
if haskey(N.induced, auto)
p = N.induced[auto]
else
- p = induce(FB, auto)
+ p = induce(FB, auto)
N.induced[auto] = p
end
end
@@ -560,7 +560,7 @@ function Hecke.simplify(c::Hecke.ClassGrpCtx)
Hecke._add_unit(U, c.R_rel[i])
end
end
- for i=1:length(U.units)
+ for i=1:length(U.units)
Hecke.class_group_add_relation(d, U.units[i], SRow(FlintZZ))
end
return d, U
@@ -655,7 +655,7 @@ function _has_norm_relation_abstract(G::GrpGen, H::Vector{Tuple{GrpGen, GrpGenTo
if large_index
reverse!(H)
end
-
+
QG = AlgGrp(FlintQQ, G)
norms_rev = Dict{elem_type(QG), Int}()
norms = Vector{elem_type(QG)}(undef, length(H))
@@ -1111,7 +1111,7 @@ function has_coprime_norm_relation(K::AnticNumberField, m::fmpz)
for i in 1:n
z.embed_cache_triv[i] = Dict{nf_elem, nf_elem}()
end
-
+
for i in 1:n
F, mF = Hecke.fixed_field1(K, NfToNfMor[mG(f) for f in ls[i][1]])
S, mS = simplify(F, cached = false)
diff --git a/src/NumField/NfAbs/PolyFact.jl b/src/NumField/NfAbs/PolyFact.jl
index f4528eeee9..f558f565e0 100644
--- a/src/NumField/NfAbs/PolyFact.jl
+++ b/src/NumField/NfAbs/PolyFact.jl
@@ -173,7 +173,7 @@ end
@doc Markdown.doc"""
round(::fmpz, a::fmpz, b::fmpz, bi::fmpz) -> fmpz
-Computes `round(a//b)` using the pre-inverse of `2b`.
+Computes `round(a//b)` using the pre-inverse of `2b`.
"""
function Base.round(::Type{fmpz}, a::fmpz, b::fmpz, bi::fmpz_preinvn_struct)
s = sign(a)
@@ -232,7 +232,7 @@ function isprime_nice(K::AnticNumberField, p::Int)
end
F = GF(p)
f = map_coefficients(F, d*K.pol)
- if degree(f) < degree(K)
+ if degree(f) < degree(K)
return false
end
if iszero(discriminant(f))
@@ -646,9 +646,9 @@ function van_hoeij(f::PolyElem{nf_elem}, P::NfOrdIdl; prec_scale = 1)
if degree(P) == 1
mD = MapFromFunc(x->coeff(mC(x),0), y->K(lift(y)), K, base_ring(vH.H.f))
- @vtime :PolyFactor 1 C = cld_data(vH.H, up_to, from, mD, vH.pM[1], den*leading_coefficient(f))
+ @vtime :PolyFactor 1 C = cld_data(vH.H, up_to, from, mD, vH.pM[1], den*leading_coefficient(f))
else
- @vtime :PolyFactor 1 C = cld_data(vH.H, up_to, from, mC, vH.pM[1], den*leading_coefficient(f))
+ @vtime :PolyFactor 1 C = cld_data(vH.H, up_to, from, mC, vH.pM[1], den*leading_coefficient(f))
end
# In the end, p-adic precision needs to be large enough to
@@ -782,7 +782,7 @@ function van_hoeij(f::PolyElem{nf_elem}, P::NfOrdIdl; prec_scale = 1)
for v = values(d)
#trivial test:
if isone(den) && ismonic(f) #don't know what to do for non-monics
- a = prod(map(constant_coefficient, factor(vH.H)[v]))
+ a = prod(map(constant_coefficient, factor(vH.H)[v]))
if degree(P) == 1
A = K(reco(order(P)(lift(a)), vH.Ml, vH.pMr))
else
diff --git a/src/NumField/NfAbs/Simplify.jl b/src/NumField/NfAbs/Simplify.jl
index a1b0f15b2b..17572260f7 100644
--- a/src/NumField/NfAbs/Simplify.jl
+++ b/src/NumField/NfAbs/Simplify.jl
@@ -99,7 +99,7 @@ end
function _simplify(O::NfAbsOrd)
K = nf(O)
-
+
B = basis(O, K, copy = false)
nrep = min(3, degree(K))
Bnew = elem_type(K)[]
@@ -112,7 +112,7 @@ function _simplify(O::NfAbsOrd)
end
#First, we search for elements that are primitive using block systems in the simple case.
B1 = _sieve_primitive_elements(Bnew)
-
+
#Now, we select the one of smallest T2 norm
a = primitive_element(K)
d = denominator(a, O)
@@ -164,7 +164,7 @@ function _sieve_primitive_elements(B::Vector{NfAbsNSElem})
end
if _is_primitive_via_block(B[i], rt_all, Fpt)
push!(indices, i)
- end
+ end
end
return B[indices]
end
diff --git a/src/NumField/NfRel/Conjugates.jl b/src/NumField/NfRel/Conjugates.jl
index 0c310af631..ddd89d0776 100644
--- a/src/NumField/NfRel/Conjugates.jl
+++ b/src/NumField/NfRel/Conjugates.jl
@@ -112,7 +112,7 @@ function infinite_places(L::NfRel{T}) where {T}
r_cnt = 1
c_cnt = 1
for (P, rts, r_rts, c_rts) in data
- if isreal(P)
+ if isreal(P)
for i in 1:length(r_rts)
plcs[r_cnt] = InfPlcNfRel{S, typeof(L)}(L, P, true, i, rts[i], r_cnt)
r_cnt += 1
@@ -120,7 +120,7 @@ function infinite_places(L::NfRel{T}) where {T}
rr = length(r_rts)
for i in 1:length(c_rts)
plcs[r + c_cnt] = InfPlcNfRel{S, typeof(L)}(L, P, false, rr + i, rts[rr + i], r + c_cnt)
- c_cnt +=1
+ c_cnt +=1
end
else
for i in 1:length(rts)
@@ -257,7 +257,7 @@ function conjugates_arb(a::NfRelElem, prec::Int = 64)
CC = AcbField(wprec, cached = false)
CCy, y = PolynomialRing(CC, cached = false)
-
+
r, s = signature(parent(a))
_r, _s = signature(K)
real_cnt = 1
diff --git a/src/NumField/NfRel/NEQ.jl b/src/NumField/NfRel/NEQ.jl
index 336fd81464..fba24f7fc4 100644
--- a/src/NumField/NfRel/NEQ.jl
+++ b/src/NumField/NfRel/NEQ.jl
@@ -23,7 +23,7 @@ function isnorm_fac_elem(K::NfRel{nf_elem}, a::nf_elem)
q, mmq = quo(q, [mq(preimage(mC, FB[i]))], false)
mq = mq*mmq
end
-
+
s = Set(ideal_type(order_type(AnticNumberField))[minimum(mkK, I) for I = S])
#make S relative Galois closed:
PS = IdealSet(ZKa)
diff --git a/src/NumField/NfRel/NfRel.jl b/src/NumField/NfRel/NfRel.jl
index 59ba60d072..f9e3421d71 100644
--- a/src/NumField/NfRel/NfRel.jl
+++ b/src/NumField/NfRel/NfRel.jl
@@ -754,7 +754,7 @@ rand(rng::AbstractRNG, L::NfRel, B::UnitRange{Int}) = rand(rng, make(L, B))
@doc Markdown.doc"""
kummer_generator(K::NfRel{nf_elem}) -> nf_elem
-Given an extension $K/k$ which is a cyclic Kummer extension of degree $n$, returns an element $a\in k$
+Given an extension $K/k$ which is a cyclic Kummer extension of degree $n$, returns an element $a\in k$
such that $K = k(\sqrt[n]{a})$. Throws an error if the extension is not a cyclic Kummer extension.
"""
function kummer_generator(K::NfRel{nf_elem})
diff --git a/src/NumField/NfRel/NfRelNS.jl b/src/NumField/NfRel/NfRelNS.jl
index 6b45fe9c65..155387855b 100644
--- a/src/NumField/NfRel/NfRelNS.jl
+++ b/src/NumField/NfRel/NfRelNS.jl
@@ -130,7 +130,7 @@ function reduce!(a::NfRelNSElem)
q, a.data = divrem(a.data, parent(a).pol)
return a
end
-
+
################################################################################
#
# String I/O
@@ -260,7 +260,7 @@ Nemo.divexact(a::NfRelNSElem, b::NfRelNSElem; check::Bool = true) = div(a, b)
################################################################################
#via julia
-function Base.:(^)(a::NfRelNSElem{T}, b::Integer) where T
+function Base.:(^)(a::NfRelNSElem{T}, b::Integer) where T
if b < 0
return inv(a)^(-b)
elseif b == 0
@@ -271,7 +271,7 @@ function Base.:(^)(a::NfRelNSElem{T}, b::Integer) where T
c = a^(div(b, 2))
mul!(c, c, c)
return c
- else
+ else
c = a^(b - 1)
mul!(c, c, a)
return c
@@ -289,7 +289,7 @@ function Base.:(^)(a::NfRelNSElem{T}, b::fmpz) where T
c = a^(div(b, 2))
mul!(c, c, c)
return c
- else
+ else
c = a^(b - 1)
mul!(c, c, a)
return c
@@ -366,7 +366,7 @@ function (R::Generic.PolyRing{nf_elem})(f::Generic.MPoly)
if f.exps[j, 1] != 0
if c==0
c = j
- else
+ else
error("poly is not univariate")
end
end
@@ -467,11 +467,11 @@ function SRow(a::NfRelElem)
if !iszero(c)
push!(sr.pos, i+1)
push!(sr.values, c)
- end
+ end
end
return sr
end
-
+
function minpoly_dense(a::NfRelNSElem)
K = parent(a)
n = degree(K)
@@ -503,7 +503,7 @@ function Base.Matrix(a::SMat)
end
end
return A
-end
+end
function minpoly_sparse(a::NfRelNSElem)
K = parent(a)
@@ -536,7 +536,7 @@ function minpoly_sparse(a::NfRelNSElem)
end
return f
end
- end
+ end
push!(sz.values, k(1))
push!(sz.pos, n+i+1)
push!(M, sz)
@@ -779,7 +779,7 @@ function basis(K::NfRel)
push!(b, b[end]*a)
end
return b
-end
+end
function (K::NfRelNS)(a::Vector)
return dot(a, basis(K))
diff --git a/src/NumField/NfRel/NfRelNSMor.jl b/src/NumField/NfRel/NfRelNSMor.jl
index bf8be2d471..69948a444d 100644
--- a/src/NumField/NfRel/NfRelNSMor.jl
+++ b/src/NumField/NfRel/NfRelNSMor.jl
@@ -189,8 +189,8 @@ end
Evaluate the polynomial by substituting in the supplied values in the array `vals` for
the corresponding variables with indices given by the array `vars`. The evaluation will
succeed if multiplication is defined between elements of the coefficient ring of $a$ and
-elements of `vals`. The result will be reduced modulo "mod". If "mod" is a Groebner basis for the ideal
-the elements generate.
+elements of `vals`. The result will be reduced modulo "mod". If "mod" is a Groebner basis for the ideal
+the elements generate.
"""
function compose_mod(a::S, vars::Vector{Int}, vals::Vector{S}, mod::Vector{S}) where S <:MPolyElem{T} where T <: RingElem
unique(vars) != vars && error("Variables not unique")
diff --git a/src/NumField/NfRel/Simplify.jl b/src/NumField/NfRel/Simplify.jl
index 4231081354..2f22d134dc 100644
--- a/src/NumField/NfRel/Simplify.jl
+++ b/src/NumField/NfRel/Simplify.jl
@@ -127,7 +127,7 @@ function _find_prime(L::NfRel{nf_elem})
i += 1
end
end
-
+
res = candidates[1]
for j = 2:n_attempts
if candidates[j][2] < res[2]
diff --git a/src/NumField/NfRel/absolute_field.jl b/src/NumField/NfRel/absolute_field.jl
index 2eb5d71380..2831b3d37e 100644
--- a/src/NumField/NfRel/absolute_field.jl
+++ b/src/NumField/NfRel/absolute_field.jl
@@ -26,7 +26,7 @@ function absolute_primitive_element(K::NfRelNS)
end
return a
end
-
+
function absolute_primitive_element(K::NfRel)
k = base_field(K)
gk = absolute_primitive_element(k)
@@ -99,11 +99,11 @@ absolute_simple_field(::NumField)
function absolute_simple_field(K::AnticNumberField)
return K, id_hom(K)
end
-
+
function absolute_simple_field(K::NfAbsNS; cached::Bool = true, simplify::Bool = false)
return simple_extension(K, cached = cached, simplified = simplify)
end
-
+
function absolute_simple_field(K::NumField; cached::Bool = false, simplify::Bool = false)
if simplify
return simplified_absolute_field(K, cached = cached)
@@ -128,8 +128,8 @@ function absolute_simple_field(K::NfRel{nf_elem}; cached::Bool = false, simplify
embed(MapFromFunc(x->preimage(h1, x), K, Ka))
return Ka, h1
end
-
-
+
+
#Trager: p4, Algebraic Factoring and Rational Function Integration
function _absolute_field(K::NfRel; cached::Bool = false)
f = K.pol
@@ -152,15 +152,15 @@ function _absolute_field(K::NfRel; cached::Bool = false)
g = compose(f, gen(kx) - l*gen(k))
N = norm(g)
end
-
+
Ka, gKa = NumberField(N, "x", cached = cached, check = false)
KaT, T = PolynomialRing(Ka, "T", cached = false)
-
+
# map Ka -> K: gen(Ka) -> gen(K)+ k gen(k)
-
+
# gen(k) -> Root(gcd(g, poly(k))) #gcd should be linear:
# g in kx = (Q[a])[x]. Want to map x -> gen(Ka), a -> T
-
+
gg = zero(KaT)
for i=degree(g):-1:0
auxp = change_base_ring(Ka, Qx(coeff(g, i)), parent = KaT)
@@ -168,7 +168,7 @@ function _absolute_field(K::NfRel; cached::Bool = false)
add!(gg, gg, auxp)
#gg = gg*gKa + auxp
end
-
+
q = gcd(gg, change_base_ring(Ka, k.pol, parent = KaT))
@assert degree(q) == 1
al = -constant_coefficient(q)//leading_coefficient(q)
diff --git a/src/NumField/NfRel/relative_extension.jl b/src/NumField/NfRel/relative_extension.jl
index 59d679712e..1fdf201b13 100644
--- a/src/NumField/NfRel/relative_extension.jl
+++ b/src/NumField/NfRel/relative_extension.jl
@@ -9,7 +9,7 @@ export relative_simple_extension, isprimitive, isprimitive_over
@doc Markdown.doc"""
relative_simple_extension(K::NumField, k::NumField) -> NfRel
-Given two fields $K\supset k$, it returns $K$ as a simple relative
+Given two fields $K\supset k$, it returns $K$ as a simple relative
extension $L$ of $k$ and an isomorphism $L \to K$.
"""
function relative_simple_extension(K::NumField, k::NumField)
@@ -102,7 +102,7 @@ end
################################################################################
#
-# Relative primitive element
+# Relative primitive element
#
################################################################################
diff --git a/src/NumField/NonSimpleNumField/Conjugates.jl b/src/NumField/NonSimpleNumField/Conjugates.jl
index 74d7379699..1623d067ff 100644
--- a/src/NumField/NonSimpleNumField/Conjugates.jl
+++ b/src/NumField/NonSimpleNumField/Conjugates.jl
@@ -4,7 +4,7 @@ mutable struct InfPlcNonSimple{S, U}
data::Vector{acb}
absolute_index::Int
isreal::Bool
-
+
function InfPlcNonSimple{S, U}(field::S, base_field_place::U, data::Vector{acb}, absolute_index::Int, isreal::Bool) where {S, U}
z = new{S, U}(field, base_field_place, data, absolute_index, isreal)
@@ -58,7 +58,7 @@ function infinite_places(L::NfRelNS{T}) where {T}
data = _conjugates_data(L, 32)
ind = 1
res = Vector{place_type(L)}(undef, r + s)
- for (p, rts) in data
+ for (p, rts) in data
res[ind] = S(L, p, rts, ind, ind <= r)
ind += 1
end
@@ -161,17 +161,17 @@ function __conjugates_data(L::NfRelNS{T}, p::Int) where T
ind_real, ind_complex = enumerate_conj_prim_rel(datas)
for y in ind_real
r_cnt += 1
- res[r_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
+ res[r_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
end
for y in ind_complex
c_cnt += 1
- res[r + c_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
+ res[r + c_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
end
else
it = cartesian_product_iterator([1:length(x[2]) for x in datas], inplace = true)
for y in it
c_cnt += 1
- res[r + c_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
+ res[r + c_cnt] = (P, acb[datas[j][2][y[j]] for j = 1:length(y)])
end
end
end
@@ -246,7 +246,7 @@ function _is_complex_conj_rel(v::Vector{Int}, w::Vector{Int}, pos::Vector, roots
elseif v[i] != w[i]
return false
end
- i += 1
+ i += 1
end
return true
end
diff --git a/src/NumField/NonSimpleNumField/Field.jl b/src/NumField/NonSimpleNumField/Field.jl
index 6d5f30662c..9bbad9dab3 100644
--- a/src/NumField/NonSimpleNumField/Field.jl
+++ b/src/NumField/NonSimpleNumField/Field.jl
@@ -122,7 +122,7 @@ function _check_consistency(K::NonSimpleNumField)
end
if !isirreducible(f)
return false
- end
+ end
end
return true
end
@@ -136,7 +136,7 @@ end
@doc Markdown.doc"""
component(L::NonSimpleNumField, i::Int) -> SimpleNumField, Map
-Given a non-simple extension $L/K$, this function returns the simple number field
+Given a non-simple extension $L/K$, this function returns the simple number field
corresponding to the $i$-th component of $L$ together with its embedding.
"""
function component(K::NonSimpleNumField, i::Int)
@@ -266,7 +266,7 @@ end
@doc Markdown.doc"""
simplified_simple_extension(L::NonSimpleNumField) -> SimpleNumField, Map
-Given a non-simple extension $L/K$, this function returns an isomorphic simple number field
+Given a non-simple extension $L/K$, this function returns an isomorphic simple number field
with a "small" defining equation together with the isomorphism.
"""
function simplified_simple_extension(L::NonSimpleNumField; cached::Bool = true, isabelian::Bool = false)
diff --git a/src/NumField/QQ.jl b/src/NumField/QQ.jl
index 699c02e001..d47ec44b6a 100644
--- a/src/NumField/QQ.jl
+++ b/src/NumField/QQ.jl
@@ -103,7 +103,7 @@ gcd(I::ZZIdl, J::ZZIdl) = ZZIdl(gcd(I.gen, J.gen))
gcd(I::ZZIdl, n::T) where T <: Union{fmpz, Int} = ZZIdl(gcd(I.gen, n))
gcd(n::T, I::ZZIdl) where T <: Union{fmpz, Int} = ZZIdl(gcd(I.gen, n))
-isone(I::ZZIdl) = isone(I.gen)
+isone(I::ZZIdl) = isone(I.gen)
maximal_order(::FlintRationalField) = ZZ
diff --git a/src/NumField/SimpleNumField/Subfields.jl b/src/NumField/SimpleNumField/Subfields.jl
index ce44dd81b1..c309cfa66a 100644
--- a/src/NumField/SimpleNumField/Subfields.jl
+++ b/src/NumField/SimpleNumField/Subfields.jl
@@ -313,7 +313,7 @@ function subfields(K::SimpleNumField; degree::Int = -1)
if isprime(n)
res = Tuple{T, morphism_type(T)}[]
- if degree == n
+ if degree == n
push!(res, (K, id_hom(K)))
elseif degree == 1
kt, t = PolynomialRing(k, "t", cached = false)
diff --git a/src/NumField/Subfields.jl b/src/NumField/Subfields.jl
index 96bceb5fae..d7ddbb8d93 100644
--- a/src/NumField/Subfields.jl
+++ b/src/NumField/Subfields.jl
@@ -295,7 +295,7 @@ function fixed_field(K::AnticNumberField, A::Vector{NfToNfMor}; simplify::Bool =
return K, id_hom(K)
end
- if ismaximal_order_known(K)
+ if ismaximal_order_known(K)
OK = maximal_order(K)
if isdefined(OK, :lllO)
k, mk = fixed_field1(K, A)
@@ -332,7 +332,7 @@ function fixed_field(K::AnticNumberField, A::Vector{NfToNfMor}; simplify::Bool =
m[j, j] = m[j, j] - bm.den # This is autos[i] - identity
end
-
+
push!(ar_mat, m)
end
@@ -370,7 +370,7 @@ function fixed_field(K::NfRel, A::Vector{T}; simplify::Bool = true) where {T <:
if length(autos) == 0
return K, id_hom(K)
end
-
+
F = base_field(K)
a = gen(K)
n = degree(K)
diff --git a/src/NumFieldOrd/NfOrd/Clgp.jl b/src/NumFieldOrd/NfOrd/Clgp.jl
index 9890fc411c..874fcfd7d4 100644
--- a/src/NumFieldOrd/NfOrd/Clgp.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp.jl
@@ -271,7 +271,7 @@ function _class_unit_group(O::NfOrd; saturate_at_2::Bool = true, bound::Int = -1
@v_do :UnitGroup 1 popindent()
# r == 1 means full rank
if isone(r) # use saturation!!!!
- idx, reg_expected = _validate_class_unit_group(c, U)
+ idx, reg_expected = _validate_class_unit_group(c, U)
if isone(idx)
break
end
@@ -310,7 +310,7 @@ function _class_unit_group(O::NfOrd; saturate_at_2::Bool = true, bound::Int = -1
end
@assert fl # so I can switch assertions off...
c.sat_done = 2*Int(idx)
- n_idx, reg_expected = _validate_class_unit_group(c, U)
+ n_idx, reg_expected = _validate_class_unit_group(c, U)
@vprint :ClassGroup 1 "index estimate down to $n_idx from $idx\n"
@assert idx != n_idx
idx = n_idx
@@ -331,7 +331,7 @@ function _class_unit_group(O::NfOrd; saturate_at_2::Bool = true, bound::Int = -1
do_units = true
if length(c.M.rel_gens) < unit_group_rank(O)
do_units = false
- end
+ end
else
add += 2
do_units = false
@@ -419,8 +419,8 @@ function class_group(O::NfOrd; bound::Int = -1, method::Int = 3,
if do_lll
OK = maximal_order(nf(O))
@assert OK.ismaximal == 1
- L = lll(OK)
- @assert L.ismaximal == 1
+ L = lll(OK)
+ @assert L.ismaximal == 1
else
L = O
end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Ctx.jl b/src/NumFieldOrd/NfOrd/Clgp/Ctx.jl
index 191837bec4..4869b4279b 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Ctx.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Ctx.jl
@@ -43,7 +43,7 @@ function class_group_init(FB::NfFactorBase, T::DataType = SMat{fmpz}; add_rels::
class_group_add_relation(clg, b, abs(bn), fmpz(1), orbit = false)
end
end
-
+
l = zero_matrix(FlintZZ, n, 1+clg.c.r2)
for i = 1:n
l[i,1] = 1
@@ -67,7 +67,7 @@ function class_group_init(FB::NfFactorBase, T::DataType = SMat{fmpz}; add_rels::
if use_aut
au = automorphisms(nf(O), copy = false)
clg.aut_grp = class_group_add_auto(clg, au)
- clg.normCtx = NormCtx(O, div(nbits(discriminant(O)), 2) + 20,
+ clg.normCtx = NormCtx(O, div(nbits(discriminant(O)), 2) + 20,
length(au) == degree(O))
else
clg.normCtx = NormCtx(O, div(nbits(discriminant(O)), 2) + 20, false)
@@ -76,7 +76,7 @@ function class_group_init(FB::NfFactorBase, T::DataType = SMat{fmpz}; add_rels::
return clg
end
-function class_group_init(O::NfOrd, B::Int; min_size::Int = 20, add_rels::Bool = true,
+function class_group_init(O::NfOrd, B::Int; min_size::Int = 20, add_rels::Bool = true,
use_aut::Bool = false,
complete::Bool = true, degree_limit::Int = 0, T::DataType = SMat{fmpz})
@vprint :ClassGroup 2 "Computing factor base ...\n"
diff --git a/src/NumFieldOrd/NfOrd/Clgp/FacBase_Euc.jl b/src/NumFieldOrd/NfOrd/Clgp/FacBase_Euc.jl
index 6429c93bce..406d73b114 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/FacBase_Euc.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/FacBase_Euc.jl
@@ -46,7 +46,7 @@ end
function issmooth(c::FactorBase{T}, a::T) where T
@assert a != 0
g = gcd(c.prod, a)
- while g != 1
+ while g != 1
a = div(a, g)
g = gcd(g, a)
end
@@ -60,7 +60,7 @@ function issmooth!(c::FactorBase{fmpz}, a::fmpz)
return a==1 || a==-1, a
end
b = copy(a)
- while g != 1
+ while g != 1
divexact!(b, b, g)
gcd!(g, g, b)
end
@@ -88,7 +88,7 @@ function _split(c::node{T}, a::T) where T
end
if isdefined(c, :right)
r = gcd(a, c.right.content)
- if r != 1
+ if r != 1
rs = _split(c.right, r)
else
rs = Vector{T}()
@@ -118,7 +118,7 @@ function factor(c::FactorBase{T}, a::T, do_error::Bool = true) where T
return f
end
-function factor(c::FactorBase{fmpz}, a::fmpq)
+function factor(c::FactorBase{fmpz}, a::fmpq)
@assert a != 0
a = deepcopy(a)
f = Dict{fmpz, Int}()
diff --git a/src/NumFieldOrd/NfOrd/Clgp/FacBase_Idl.jl b/src/NumFieldOrd/NfOrd/Clgp/FacBase_Idl.jl
index 6c7023b87d..bcb3d1f2dc 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/FacBase_Idl.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/FacBase_Idl.jl
@@ -1,6 +1,6 @@
################################################################################
#
-# NfFactorBase : Factor bases for number fields
+# NfFactorBase : Factor bases for number fields
# A factor basis is mostly a collection of prime ideals, designed,
# if possible, to allow for rapid testing if elements are smooth.
#
@@ -26,7 +26,7 @@ function NfFactorBase(O::NfOrd, B::Int;
lp = prime_ideals_up_to(O, B, complete = complete, degree_limit = degree_limit)
@vprint :ClassGroup 2 " done \n"
return NfFactorBase(O, lp)
-end
+end
function NfFactorBase(O::NfOrd, lp::Vector{NfOrdIdl})
lp = sort(lp, lt = function(a,b) return norm(a) > norm(b); end)
@@ -88,7 +88,7 @@ end
function _factor!(FB::NfFactorBase, a::nf_elem,
error::Bool = true, n::fmpq = abs(norm(a)), integral::Bool = true)
T = fmpz
- O = order(FB.ideals[1])
+ O = order(FB.ideals[1])
n = deepcopy(n)
if integral
@@ -128,7 +128,7 @@ function _factor!(FB::NfFactorBase, a::nf_elem,
end
@hassert :ClassGroup 1 length(r) > 0
return ret, SRow{T}(r)
- else
+ else
# factor failed or I have a unit.
# sparse rel mat must not have zero-rows.
return false, SRow{T}()
@@ -141,7 +141,7 @@ end
function _factor!(FB::Hecke.NfFactorBase, A::Hecke.NfOrdIdl,
error::Bool = true)
- T = fmpz
+ T = fmpz
O = order(A)
n = norm(A)
@@ -152,9 +152,9 @@ function _factor!(FB::Hecke.NfFactorBase, A::Hecke.NfOrdIdl,
return true, SRow{T}()
end
- d = factor(FB.fb_int, n) # as above: fails - even if error is false -
+ d = factor(FB.fb_int, n) # as above: fails - even if error is false -
# if the norm is not smooth
-
+
rw = FB.rw
r = Vector{Tuple{Int, Int}}()
for p in keys(d)
@@ -188,7 +188,7 @@ function _factor!(FB::Hecke.NfFactorBase, A::Hecke.NfOrdIdl,
@hassert :ClassGroup 9000 A == prod([FB.ideals[i]^j for (i, j) in r])
@hassert :ClassGroup 1 length(r) > 0
return true, res
- else
+ else
# factor failed or I have a unit.
# sparse rel mat must not have zero-rows.
return false, SRow{T}()
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl b/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl
index fc4b5dbfe0..5327eeb418 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Main_LLL.jl
@@ -36,7 +36,7 @@ function single_env(c::ClassGrpCtx{T}, I::Hecke.SmallLLLRelationsCtx, rat::Float
@vprint :ClassGroup 2 "not enough progress $(I.cnt) $(c.expect) $good\n"
break
end
- if fl
+ if fl
good += length(c.M.bas_gens) #= + length(c.M.rel_gens) =# - bef
end
if fl && max_good > -1
@@ -105,7 +105,7 @@ function class_group_new_relations_via_lll(c::ClassGrpCtx{T}, rat::Float64 = 0.2
end
@vprint :ClassGroup 1 "piv was empty, supplemented it to\n"
@vprint :ClassGroup 1 "$(piv)\n"
- end
+ end
start = max(1, max(div(length(c.FB.ideals), 2)+1, length(c.FB.ideals)-10*(1+div(rand_exp, 3))))
@@ -177,13 +177,13 @@ function class_group_new_relations_via_lll(c::ClassGrpCtx{T}, rat::Float64 = 0.2
end
end
end
- end
+ end
@vprint :ClassGroup 1 "eval info\n"
@vtime :ClassGroup 1 h, piv_new = class_group_get_pivot_info(c)
@vprint :ClassGroup 1 "length(piv) = $(length(piv_new)) and h = $h\n"
@vprint :ClassGroup 1 "$(piv_new)\n"
-
+
if piv_new == piv
if h > 0
extra = 2
@@ -198,14 +198,14 @@ function class_group_new_relations_via_lll(c::ClassGrpCtx{T}, rat::Float64 = 0.2
while gcd(rand_exp, h) > 1
rand_exp += 1
end
- end
+ end
if rand_exp % 3 == 0
start = max(start -10, 1)
end
end
piv = piv_new
- if h == 1
+ if h == 1
return nothing
end
end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Main_enum.jl b/src/NumFieldOrd/NfOrd/Clgp/Main_enum.jl
index a9aad0a9d2..7da983a21c 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Main_enum.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Main_enum.jl
@@ -10,13 +10,13 @@ function class_group_random_ideal_relation(clg::ClassGrpCtx, r::Int,
if r < 2
r = 2
end
- for i = 1:r
+ for i = 1:r
I = I*rand(clg.FB.ideals)
I, g = reduce_ideal_class(I)
s *= g
end
return s;
-end
+end
# Do better: re-use partial hnf, check rank mod p, ...
@@ -157,7 +157,7 @@ function class_group_find_relations(clg::ClassGrpCtx; val = 0, prec::Int = 100,
end
e = class_group_small_real_elements_relation_next(E)
n = abs(norm_div(e, norm(E.A), np))
-
+
if nbits(numerator(n)) > np-10
bad_norm += 1
if bad_norm /(E.cnt + E.bad + 1) > 0.1
@@ -204,12 +204,12 @@ function class_group_find_relations(clg::ClassGrpCtx; val = 0, prec::Int = 100,
println("current h=$h from $(clg.M)")
if h != 0
- if h==1
+ if h==1
return h, piv
end
@v_do :ClassGroup 1 println("full rank: current h = ", h,
" want ", want_extra, " more")
- if h == last_h
+ if h == last_h
want_extra -= 1
else
want_extra = 15
@@ -227,7 +227,7 @@ function class_group_find_relations(clg::ClassGrpCtx; val = 0, prec::Int = 100,
clg.time[:hnf_time]/1e9, " sec for hnf in ", clg.hnf_call, " calls");
@v_do :ClassGroup 1 println("added ", clg.rel_cnt, " good relations and ",
clg.bad_rel, " bad ones, ratio ", clg.bad_rel/clg.rel_cnt)
-
+
class_group_process_relmatrix(clg)
h, piv = class_group_get_pivot_info(clg)
@@ -258,7 +258,7 @@ function class_group_find_relations2(clg::ClassGrpCtx; val = 0, prec = 100,
for i in nI:-1:1
I = Idl[i]
too_slow = false
- f = class_group_small_real_elements_relation_start(clg, I,
+ f = class_group_small_real_elements_relation_start(clg, I,
limit = limit, prec = prec, val = val)
f.vl = val
@@ -279,7 +279,7 @@ function class_group_find_relations2(clg::ClassGrpCtx; val = 0, prec = 100,
a = rank(clg.M)
if (a-old_r) < 0.5
@v_do :ClassGroup 2 println("rank too slow $a ($old_r) and $(clg.rel_mat_full_rank)")
- too_slow = true
+ too_slow = true
break
end
old_r = a
@@ -292,7 +292,7 @@ function class_group_find_relations2(clg::ClassGrpCtx; val = 0, prec = 100,
@v_do :ClassGroup 2 println("too slow in getting s.th. for ", i,
"\ngood: ", f.cnt, " bad: ", f.bad,
" ratio: ", (clg.bad_rel/clg.rel_cnt))
- too_slow = true
+ too_slow = true
break
end
end
@@ -347,7 +347,7 @@ function class_group_find_relations2(clg::ClassGrpCtx; val = 0, prec = 100,
# println(n, " should be ", sqrt_disc)
# println("offending element is ", e)
# println("prec now ", prec)
-# end
+# end
A = Idl[i]
j = 0
# TH: without added no_rand_local < nI it crashes sometimes
@@ -403,13 +403,13 @@ function class_group_find_relations2(clg::ClassGrpCtx; val = 0, prec = 100,
end
a_old = a
if h != 0
- if h==1
+ if h==1
return h, piv
end
@vprint :ClassGroup 1 "Now have $(clg.M)"
@v_do :ClassGroup 1 println("full rank: current h = ", h,
" want ", want_extra, " more")
- if h == last_h
+ if h == last_h
want_extra -= 1
else
want_extra = 15
@@ -437,7 +437,7 @@ function class_group_find_new_relation(clg::ClassGrpCtx; val = 0, prec = 100,
limit = 10, extra = 1)
if !isdefined(clg, :randomClsEnv)
clg.randomClsEnv = random_init(clg.FB.ideals)
- end
+ end
O = parent(clg.FB.ideals[1]).order
sqrt_disc = isqrt(abs(discriminant(O)))
@@ -461,7 +461,7 @@ function class_group_find_new_relation(clg::ClassGrpCtx; val = 0, prec = 100,
if class_group_add_relation(clg, e, n, norm(E.A))
E.cnt += 1
extra -= 1
- if extra <= 0
+ if extra <= 0
return
end
else
@@ -471,8 +471,8 @@ function class_group_find_new_relation(clg::ClassGrpCtx; val = 0, prec = 100,
end
end
end
- end
+ end
class_group_process_relmatrix(clg)
-end
+end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Map.jl b/src/NumFieldOrd/NfOrd/Clgp/Map.jl
index deab8498ee..9938a47166 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Map.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Map.jl
@@ -142,7 +142,7 @@ function class_group_ideal_relation(I::NfOrdIdl, c::ClassGrpCtx)
end
#really annoying, but at least we have a small(ish) ideal now
#println("have to work")
-
+
E = class_group_small_lll_elements_relation_start(c, I)
iI = inv(I)
if isdefined(c, :randomClsEnv)
@@ -162,7 +162,7 @@ function class_group_ideal_relation(I::NfOrdIdl, c::ClassGrpCtx)
@vprint :ClassGroup 1 "New random \n"
last_j = random_get(J, reduce = false)
@vprint :ClassGroup 1 "Using $last_j \n"
- E = class_group_small_lll_elements_relation_start(c, I*last_j)
+ E = class_group_small_lll_elements_relation_start(c, I*last_j)
iI = inv(E.A)
end
@@ -176,7 +176,7 @@ function class_group_ideal_relation(I::NfOrdIdl, c::ClassGrpCtx)
@vprint :ClassGroup 1 "New random \n"
last_j = random_get(J, reduce = false)
@vprint :ClassGroup 1 "Using $last_j \n"
- E = class_group_small_lll_elements_relation_start(c, I*last_j)
+ E = class_group_small_lll_elements_relation_start(c, I*last_j)
iI = inv(E.A)
continue
end
@@ -204,7 +204,7 @@ function class_group_ideal_relation(I::NfOrdIdl, c::ClassGrpCtx)
fl, s = _factor!(c.FB, last_j)
@assert fl
res2 = r-s
-
+
else
res2 = r
end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Proof.jl b/src/NumFieldOrd/NfOrd/Clgp/Proof.jl
index 98a2b10156..4929129cd2 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Proof.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Proof.jl
@@ -47,7 +47,7 @@ function showprogress(io::IO, p::MiniProgressBar, info)
print(io, info)
print(io, "\r")
end
-
+
function class_group_proof(clg::ClassGrpCtx, lb::fmpz, ub::fmpz; extra :: fmpz=fmpz(0), prec::Int = 100, do_it=1:ub)
PB = MiniProgressBar(header = "Class group proof")
@@ -84,7 +84,7 @@ function class_group_proof(clg::ClassGrpCtx, lb::fmpz, ub::fmpz; extra :: fmpz=f
while p < do_it.stop
no_primes += 1
-
+
@v_do :ClassGroupProof if no_primes % interval == 0
#println("did $no_primes prime numbers so far, now $p, need to reach $ub (~$(no_primes/_no_of_primes))")
last_time = PB.time_shown
@@ -92,7 +92,7 @@ function class_group_proof(clg::ClassGrpCtx, lb::fmpz, ub::fmpz; extra :: fmpz=f
prev = PB.prev
PB.current = no_primes/_no_of_primes
# from PB.current to prev it took cur_time - last_time seconds
-
+
if rate == 0.0
rate = ((PB.current - PB.prev)/(cur_time - last_time))
else
@@ -121,7 +121,7 @@ function class_group_proof(clg::ClassGrpCtx, lb::fmpz, ub::fmpz; extra :: fmpz=f
fac = prime_decomposition(O, Int(p), deg_lim, low_lim)
for _k in fac
k = _k[1]
- if norm(k) <= lb
+ if norm(k) <= lb
continue
end
no_ideals += 1
@@ -141,13 +141,13 @@ function class_group_proof(clg::ClassGrpCtx, lb::fmpz, ub::fmpz; extra :: fmpz=f
sucess = false
a = class_group_small_real_elements_relation_next(E)
n = norm_div(a, norm(k), np)
- if gcd(numerator(n), p) > extra
+ if gcd(numerator(n), p) > extra
# println("a: $a, $(norm(a)), $(norm(k)), $n")
# println("contains too many conjugates, bad")
continue
end
f, r = issmooth!(clg.FB.fb_int, numerator(n))
- if f
+ if f
M = SMat{Int}()
fl = _factor!(clg.FB, a, false, n)[1]
if fl
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Rel_LLL.jl b/src/NumFieldOrd/NfOrd/Clgp/Rel_LLL.jl
index 8d45acaee0..283e330e79 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Rel_LLL.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Rel_LLL.jl
@@ -78,7 +78,7 @@ function class_group_small_lll_elements_relation_start(clg::ClassGrpCtx{T},
if m < 2
m = n
end
- while length(f) < m
+ while length(f) < m
f = Int[i for i = 1:n if compare_index(L.num, i, i, bd) < 0]
bd *= 2
end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Rel_Schmettow.jl b/src/NumFieldOrd/NfOrd/Clgp/Rel_Schmettow.jl
index 2cab2c7348..715eb02477 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Rel_Schmettow.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Rel_Schmettow.jl
@@ -8,9 +8,9 @@ function one_step(b::NfOrdFracIdl, p::NfOrdIdl; prec::Int = 100)
b = p*b
simplify(b)
g1 = short_elem(b, prec = prec)
- b = g1*inv(b)
+ b = g1*inv(b)
simplify(b)
- g2 = short_elem(b, prec = prec)
+ g2 = short_elem(b, prec = prec)
return simplify(g2*inv(b)), g1, g2
end
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Rel_add.jl b/src/NumFieldOrd/NfOrd/Clgp/Rel_add.jl
index a64b8c929d..552eb9eb16 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Rel_add.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Rel_add.jl
@@ -16,7 +16,7 @@ function special_prime_ideal(p::fmpz, a::nf_elem)
R = parent(f)
Zx = PolynomialRing(FlintZZ)[1]
Zpx = PolynomialRing(GF(UInt(p), cached=false), "\$x_p", cached=false)[1]
- g = Zpx(a)
+ g = Zpx(a)
ff = Zpx(f)
gcd!(g, g, ff)
return lift(Zx, g)
@@ -28,7 +28,7 @@ function push_normStat!(clg::ClassGrpCtx, n::fmpz, b::Bool)
clg.normStat[nb] = (0,0)
end
t = clg.normStat[nb]
- if b
+ if b
clg.normStat[nb] = (t[1], t[2] + 1)
else
clg.normStat[nb] = (t[1] + 1, t[2])
@@ -45,20 +45,20 @@ function class_group_add_relation(clg::ClassGrpCtx{T}, a::nf_elem, n::fmpq, nI::
if iszero(a) || isone(a)
return false
end
- if hash(a) in clg.RS
+ if hash(a) in clg.RS
return false
end
- O = order(clg.FB.ideals[1])
+ O = order(clg.FB.ideals[1])
easy = isdefining_polynomial_nice(parent(a))
@vprint :ClassGroup 3 "trying relation of length $(Float64(length(a))) and norm $(Float64(n*nI)), effective $(Float64(n))\n"
if integral #element is known to be integral
fl, r = issmooth!(clg.FB.fb_int, numerator(n*nI))
push_normStat!(clg, numerator(n), fl)
- else
+ else
fl, r = issmooth!(clg.FB.fb_int, numerator(n*nI)*denominator(a, O))
push_normStat!(clg, numerator(n)*denominator(a), fl)
- end
+ end
@assert issmooth!(clg.FB.fb_int, nI)[1]
@@ -66,7 +66,7 @@ function class_group_add_relation(clg::ClassGrpCtx{T}, a::nf_elem, n::fmpq, nI::
@vprint :ClassGroup 3 "not int-smooth\n"
# println("not int-smooth");
# try for large prime?
- if easy && abs(r) < clg.B2 && isprime(r) && !isindex_divisor(O, r)
+ if easy && abs(r) < clg.B2 && isprime(r) && !isindex_divisor(O, r)
@vprint :ClassGroup 3 "gives potential large prime\n"
i = special_prime_ideal(r, a)
#TODO: check Galois orbit of special ideal
@@ -76,7 +76,7 @@ function class_group_add_relation(clg::ClassGrpCtx{T}, a::nf_elem, n::fmpq, nI::
fl, r2 = _factor!(clg.FB, lp[1], false, norm(lp[1]))
b = FacElem(Dict([(a,1), (lp[1],-1)]))
fl = class_group_add_relation(clg, b, r1 - r2)
- if fl
+ if fl
clg.largePrime_success += 1
else
clg.largePrime_no_success += 1
@@ -113,11 +113,11 @@ function class_group_add_relation(clg::ClassGrpCtx{T}, a::nf_elem, n::fmpq, nI::
clg.rel_cnt += 1
end
end
-
+
if new_gen && orbit && isdefined(clg, :aut_grp)
n = res
o = _get_autos_from_ctx(clg)
-
+
@v_do :ClassGroup 1 println(" adding orbit with $(length(o)) elements")
for (b, m) in o
nn = Hecke.permute_row(n, m)
@@ -133,9 +133,9 @@ function class_group_add_relation(clg::ClassGrpCtx{T}, a::nf_elem, n::fmpq, nI::
end
end
end
- end
+ end
+
-
# @assert clg.rel_cnt < 2*ncols(clg.M)
@v_do :ClassGroup 1 println(" -> OK, rate currently ",
clg.bad_rel/clg.rel_cnt, " this ", clg.bad_rel - clg.last,
@@ -164,13 +164,13 @@ function class_group_add_relation(clg::ClassGrpCtx{SMat{fmpz}}, a::FacElem{nf_el
return class_group_add_relation(clg, a, R)
end
-function class_group_add_relation(clg::ClassGrpCtx{SMat{fmpz}}, a::FacElem{nf_elem, AnticNumberField}, R::SRow{fmpz}; always::Bool = true, add_orbit = true)
-
- if hash(a) in clg.RS
+function class_group_add_relation(clg::ClassGrpCtx{SMat{fmpz}}, a::FacElem{nf_elem, AnticNumberField}, R::SRow{fmpz}; always::Bool = true, add_orbit = true)
+
+ if hash(a) in clg.RS
return false
end
- O = order(clg.FB.ideals[1])
+ O = order(clg.FB.ideals[1])
@vprint :ClassGroup 3 "adding $R\n"
@@ -208,7 +208,7 @@ function class_group_add_relation(clg::ClassGrpCtx{SMat{fmpz}}, a::FacElem{nf_el
end
end
end
- end
+ end
clg.last = clg.bad_rel
return true
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Rel_enum.jl b/src/NumFieldOrd/NfOrd/Clgp/Rel_enum.jl
index b8c2eceb88..44d3aa0e12 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Rel_enum.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Rel_enum.jl
@@ -27,7 +27,7 @@ function enum_ctx_from_ideal(A::NfOrdIdl,
E.t = t*b
E.t_den = b_den
## we want to find x sth. norm(x) <= sqrt(|disc|)*norm(A)
- ## |N(x)^2|^(1/n) <= T_2(x)/n
+ ## |N(x)^2|^(1/n) <= T_2(x)/n
## so if T_2(x) <= n * D^(1/n)
## then |N(x)| <= D^(1/2)
#d = abs(discriminant(order(A))) * norm(A)^2
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Saturate.jl b/src/NumFieldOrd/NfOrd/Clgp/Saturate.jl
index f67585ed8b..034620e44d 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Saturate.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Saturate.jl
@@ -34,7 +34,7 @@ function mod_p(R::Vector{FacElem{nf_elem, AnticNumberField}}, Q::NfOrdIdl, p::In
for i = 1:pp-1
dl[y] = i
y *= x
- end
+ end
return matrix(T, 1, length(R), Int[dl[image(mF1, R[i], D[i], cached, pp)^e] % p for i in 1:length(R)])
end
@@ -131,14 +131,14 @@ function compute_candidates_for_saturate(v::Vector{FacElem{nf_elem, AnticNumberF
T = GF(p, cached = false)
cA = length(v1)
A = identity_matrix(T, cA)
-
+
S = Hecke.PrimesSet(Hecke.p_start, -1, p, 1)
D = Vector{Vector{gfp_poly}}(undef, length(v1))
for i in 1:length(v1)
D[i] = Vector{gfp_poly}(undef, length(v1[i].fac))
end
- dK = discriminant(OK)
+ dK = discriminant(OK)
threshold = stable*ncols(A)
i = 1
@@ -170,7 +170,7 @@ function compute_candidates_for_saturate(v::Vector{FacElem{nf_elem, AnticNumberF
return zero_matrix(FlintZZ, 0, length(v1))
end
A = A*sub(z, 1:nrows(z), 1:rrz)
- if cA == ncols(A)
+ if cA == ncols(A)
i += 1
else
i = 0
@@ -209,10 +209,10 @@ function compute_candidates_for_saturate1(c::Hecke.ClassGrpCtx, p::Int, stable::
T = GF(p, cached = false)
cA = length(R)
A = identity_matrix(T, cA)
-
+
S = Hecke.PrimesSet(Hecke.p_start, -1, p, 1)
- dK = discriminant(ZK)
+ dK = discriminant(ZK)
threshold = stable*ncols(A)
f = K.pol
@@ -309,7 +309,7 @@ function compute_candidates_for_saturate1(c::Hecke.ClassGrpCtx, p::Int, stable::
for i = 1:pp-1
disc_log[y] = T(i)
y *= elF
- end
+ end
#The disc log dictionary is ready. Now we need the subspace.
for i = 1:lfacts
z = matrix(T, 1, length(R), Hecke.gfp_elem[disc_log[evals[j][i]^e] for j = 1:length(R)])
@@ -319,7 +319,7 @@ function compute_candidates_for_saturate1(c::Hecke.ClassGrpCtx, p::Int, stable::
return zero_matrix(FlintZZ, 0, length(R))
end
A = A*sub(z, 1:nrows(z), 1:rrz)
- if cA == ncols(A)
+ if cA == ncols(A)
att += 1
else
att = 0
@@ -399,7 +399,7 @@ function saturate!(U::Hecke.UnitGrpCtx, n::Int, stable::Float64 = 3.5; use_orbit
if restart
restart = false
continue
- elseif wasted
+ elseif wasted
stable *= 2
else
@vprint :Saturate 1 "sat success at $(stable)\n"
@@ -443,7 +443,7 @@ function saturate!(d::Hecke.ClassGrpCtx, U::Hecke.UnitGrpCtx, n::Int, stable::Fl
continue
end
end
-
+
decom = Dict{NfOrdIdl, fmpz}((c.FB.ideals[k], v) for (k, v) = fac_a)
@vprint :Saturate 1 "Testing if element is an n-th power\n"
@vtime :Saturate 1 fl, x = ispower(a, n, decom = decom, easy = easy_root)
@@ -451,13 +451,13 @@ function saturate!(d::Hecke.ClassGrpCtx, U::Hecke.UnitGrpCtx, n::Int, stable::Fl
@vprint :Saturate 1 "The element is an n-th power\n"
success = true
fac_a = divexact(fac_a, n)
- if iszero(fac_a)
+ if iszero(fac_a)
#In this case, the element we have found is a unit and
#we want to make sure it is used
#find units can be randomised...
#maybe that should also be addressed elsewhere
@vprint :Saturate 1 "The new element is a unit\n"
-
+
if use_orbit
auts_action = Hecke._get_autos_from_ctx(d)
for s = 1:length(auts_action)
@@ -491,7 +491,7 @@ function saturate!(d::Hecke.ClassGrpCtx, U::Hecke.UnitGrpCtx, n::Int, stable::Fl
if restart
restart = false
continue
- elseif wasted
+ elseif wasted
stable *= 2
else
@vprint :Saturate 1 "sat success at $(stable)\n"
@@ -512,7 +512,7 @@ function simplify(c::Hecke.ClassGrpCtx, U::Hecke.UnitGrpCtx, cp::Int = 0; use_LL
vals_new_rels = Vector{SRow{fmpz}}()
@vprint :Saturate 1 "Computing rels...\n"
for i=1:length(c.FB.ideals)
- if cp != 0 && isone(c.M.basis.rows[i].values[1])
+ if cp != 0 && isone(c.M.basis.rows[i].values[1])
continue
end
@assert all(x -> x > 0, c.M.basis.rows[i].values)
@@ -551,7 +551,7 @@ function simplify(c::Hecke.ClassGrpCtx, U::Hecke.UnitGrpCtx, cp::Int = 0; use_LL
@assert fl
end
end
- for i=1:length(U.units)
+ for i=1:length(U.units)
Hecke.class_group_add_relation(d, U.units[i], SRow(FlintZZ))
end
return d
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl b/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl
index bd6341ec39..811970e109 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Sunits.jl
@@ -4,7 +4,7 @@ function show(io::IO, mC::MapSUnitModUnitGrpFacElem)
@show_name(io, mC)
io = IOContext(io, :compact => true)
println(io, "SUnits (in factored form) mod Units map of ")
- show(io, codomain(mC))
+ show(io, codomain(mC))
println(io, "for $(mC.idl)")
end
@@ -52,7 +52,7 @@ function sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl})
@vtime :ClassGroup 1 for (i, A) = enumerate(I)
@vprint :ClassGroup 2 "doin' $(i)/$(length(I)):\n$A\n"
@vtime :ClassGroup 2 x, r = class_group_ideal_relation(A, c)
-# TODO: write == for Idl and FracIdl
+# TODO: write == for Idl and FracIdl
# @assert prod([c.FB.ideals[p]^Int(v) for (p,v) = r]) == x*A
push!(X, x)
push!(rr, r)
@@ -64,7 +64,7 @@ function sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl})
end
@vprint :ClassGroup 1 "... done\n"
-
+
@vprint :ClassGroup 1 "solving...\n"
@vtime :ClassGroup 1 R, d = solve_ut(H, rr)
Rd = hcat(d*identity_matrix(SMat, FlintZZ, nrows(R)), fmpz(-1)*R)
@@ -74,7 +74,7 @@ function sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl})
S1 = sub(S, 1:nrows(S), 1:nrows(S))
S2 = sub(S, 1:nrows(S), (nrows(S) + 1):ncols(S))
@assert nrows(S1) == nrows(S2) && nrows(S1) == nrows(S)
-
+
g = vcat(c.R_gen, c.R_rel)
valuations = SRow{fmpz}[]
@@ -118,8 +118,8 @@ function sunit_mod_units_group_fac_elem(I::Vector{NfOrdIdl})
C = abelian_group(fmpz[0 for i=U])
r = MapSUnitModUnitGrpFacElem()
r.idl = I_in
-
- local exp
+
+ local exp
let U = U
function exp(a::GrpAbFinGenElem)
b = U[1]^a.coeff[1, 1]
@@ -208,7 +208,7 @@ function sunit_group_fac_elem(I::Vector{NfOrdIdl})
end
local log
- let mS = mS, mU = mU, G = G
+ let mS = mS, mU = mU, G = G
function log(a::FacElem{nf_elem, AnticNumberField})
a1 = preimage(mS, a)
a2 = a*inv(image(mS, a1))
diff --git a/src/NumFieldOrd/NfOrd/Clgp/Types.jl b/src/NumFieldOrd/NfOrd/Clgp/Types.jl
index d3cb159b65..717b795aa2 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/Types.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/Types.jl
@@ -1,6 +1,6 @@
mutable struct MapClassGrp <: Map{GrpAbFinGen, NfOrdIdlSet, HeckeMap, MapClassGrp}
header::MapHeader{GrpAbFinGen, NfOrdIdlSet}
-
+
quo::Int
princ_gens::Vector{Tuple{FacElem{NfOrdIdl,NfOrdIdlSet}, FacElem{nf_elem, AnticNumberField}}}
small_gens::Vector{NfOrdIdl}
diff --git a/src/NumFieldOrd/NfOrd/Clgp/cm_field.jl b/src/NumFieldOrd/NfOrd/Clgp/cm_field.jl
index 4ebdcd0c8c..ed30f32db4 100644
--- a/src/NumFieldOrd/NfOrd/Clgp/cm_field.jl
+++ b/src/NumFieldOrd/NfOrd/Clgp/cm_field.jl
@@ -107,13 +107,13 @@ function create_ctx(OK::NfOrd; bound::Int = -1, method::Int = 3, large::Int = 10
return c::ClassGrpCtx{SMat{fmpz}}
end
end
-
+
if bound == -1
bound = Int(ceil(log(abs(discriminant(OK)))^2*0.3))
(bound == 0) && (bound = 1)
end
-
+
c = class_group_init(OK, bound, complete = false, use_aut = use_aut)::ClassGrpCtx{SMat{fmpz}}
@assert order(c) === OK
- return c
+ return c
end
\ No newline at end of file
diff --git a/src/NumFieldOrd/NfOrd/FacElem.jl b/src/NumFieldOrd/NfOrd/FacElem.jl
index 6033175fe8..bd852cae7c 100644
--- a/src/NumFieldOrd/NfOrd/FacElem.jl
+++ b/src/NumFieldOrd/NfOrd/FacElem.jl
@@ -420,7 +420,7 @@ function factor_coprime(a::FacElem{nf_elem, AnticNumberField}, I::NfOrdIdlSet; r
if iszero(e)
continue
end
- if divisible(norm(b, copy = false), P)
+ if divisible(norm(b, copy = false), P)
v += valuation(b, p)*e
end
end
diff --git a/src/NumFieldOrd/NfOrd/FactorBaseBound.jl b/src/NumFieldOrd/NfOrd/FactorBaseBound.jl
index 5156d8ba75..86a943f8b8 100644
--- a/src/NumFieldOrd/NfOrd/FactorBaseBound.jl
+++ b/src/NumFieldOrd/NfOrd/FactorBaseBound.jl
@@ -52,9 +52,9 @@ ideals of norm bounded by $B$.
function factor_base_bound_bdf(O::NfOrd)
return _factor_base_bound_bdf(O, 100.0, 100.0)
end
-
+
function _factorbase_bound_bdf_right_side(O::NfOrd, x0::Float64, D::Dict{Int, Vector{Tuple{Int, Int}}})
- K = nf(O)
+ K = nf(O)
d = degree(K)
r, s = signature(O)
@@ -74,14 +74,14 @@ function _factorbase_bound_bdf_right_side(O::NfOrd, x0::Float64, D::Dict{Int, Ve
pm2 = R(p)^(R(FlintZZ(m)//FlintZZ(2)))
secondterm = R(1) - m*logp//logcurval
-
+
return logp//pm2 * secondterm
end
function comp_summand(p::Int, m::Int)
return comp_summand(fmpz(p), m)
end
-
+
p = 2
while p < curval
@@ -96,7 +96,7 @@ function _factorbase_bound_bdf_right_side(O::NfOrd, x0::Float64, D::Dict{Int, Ve
Pnorm = fmpz(p)^P[1]
if Pnorm < curval
max_exp = _max_power_in(Pnorm, curval)
-
+
for m in 1:max_exp
summand = comp_summand(Pnorm, m)
summ = summ + summand
@@ -105,13 +105,13 @@ function _factorbase_bound_bdf_right_side(O::NfOrd, x0::Float64, D::Dict{Int, Ve
end
p = next_prime(p)
end
-
+
y = 2*summ - (R(d)*(const_pi(R)^2//R(2)) + r*4*const_catalan(R))//logcurval
return y::arb
end
function _factor_base_bound_bdf(O::NfOrd, x0::Float64 = 50.0, ste::Float64 = 20.0)
- K = nf(O)
+ K = nf(O)
d = degree(K)
r, s = signature(O)
@@ -135,18 +135,18 @@ function _factor_base_bound_bdf(O::NfOrd, x0::Float64 = 50.0, ste::Float64 = 20.
x1 = 2*x0
y = _factorbase_bound_bdf_right_side(O, x1, dec_cache)
end
-
+
dista = abs(x0-x1)
while !( y > D && dista < ste)
- if y < D
+ if y < D
x1 = x0 + 3*dista/2
else
x1 = x0 - dista/2
end
dista = abs(x1-x0)
-
+
x0 = x1
y = _factorbase_bound_bdf_right_side(O, x0, dec_cache)
end
diff --git a/src/NumFieldOrd/NfOrd/Hensel.jl b/src/NumFieldOrd/NfOrd/Hensel.jl
index 46e734fd35..ead99ab146 100644
--- a/src/NumFieldOrd/NfOrd/Hensel.jl
+++ b/src/NumFieldOrd/NfOrd/Hensel.jl
@@ -72,7 +72,7 @@ function lift(R::NmodPolyRing, a::fq_nmod)
return f
end
-function (Zx::FmpzPolyRing)(a::nf_elem)
+function (Zx::FmpzPolyRing)(a::nf_elem)
b = Zx()
@assert denominator(a) == 1
if degree(parent(a)) == 1
@@ -120,7 +120,7 @@ function _roots_hensel(f::Generic.Poly{nf_elem};
n = degree(K)
deg = degree(f)
- # First we find a prime ideal such that f is squarefree modulo P
+ # First we find a prime ideal such that f is squarefree modulo P
# (The discriminant of f has only finitely many divisors).
p = degree(f)+1
@@ -160,7 +160,7 @@ function _roots_hensel(f::Generic.Poly{nf_elem};
if any(x->iszero(denominator(x) % p), coefficients(K.pol))
continue
end
-
+
Rp = Nemo.GF(p, cached=false)
Rpt, t = PolynomialRing(Rp, "t", cached=false)
gp = Rpt(K.pol)
@@ -184,7 +184,7 @@ function _roots_hensel(f::Generic.Poly{nf_elem};
red_coeff1 = Vector{fq_nmod}(undef, length(f))
red_coeff1[length(f)] = S(1)
for i = 2:length(f)-1
- red_coeff1[i] = zero(S)
+ red_coeff1[i] = zero(S)
end
red_coeff1[1] = S(Rpt(coeff(f, 0)))
fp = ST(red_coeff1)
@@ -233,7 +233,7 @@ function _roots_hensel(f::Generic.Poly{nf_elem};
#TODO: we need norm_change_const wrt. any basis to apply it to an
# equation order even if it is no order.
# probably needs an entire trail of other stuff
- r1, r2 = signature(K)
+ r1, r2 = signature(K)
gsa = derivative(K.pol)(gen(K))
if !isdefining_polynomial_nice(K)
@@ -414,12 +414,12 @@ function _hensel(f::Generic.Poly{nf_elem},
#assumes f squarefree
#assumes constant_coefficient(f) != 0
-
+
ZX, X = PolynomialRing(FlintZZ, "X", cached = false)
#to avoid embarrasment...
- #find the prime ideal - as I don't want to use orders, this is
+ #find the prime ideal - as I don't want to use orders, this is
#fun (computing a max order just for this is wasteful)
#fun fact: if g = prod g_i mod p^k, then P_i^k =
#so instead of powering, and simplify and such, lets write it down
@@ -430,7 +430,7 @@ function _hensel(f::Generic.Poly{nf_elem},
ff = ZX(d_pol*K.pol)
gg = hensel_lift(ff, g1, fmpz(p), k)
else
- gg = ZX(d_pol * K.pol)
+ gg = ZX(d_pol * K.pol)
pk = fmpz(p)^k
gg *= invmod(leading_coefficient(gg), pk)
mod_sym!(gg, pk)
@@ -450,8 +450,8 @@ function _hensel(f::Generic.Poly{nf_elem},
end
# Now if we are in the normal case and want max_roots, we only have
- # to lift max_roots
-
+ # to lift max_roots
+
if isnormal
rt = eltype(rt)[1:max(max_roots, degree(f))]
end
@@ -510,7 +510,7 @@ function _hensel(f::Generic.Poly{nf_elem},
M = zero_matrix(FlintZZ, n, n)
local Mi::fmpz_mat
local d::fmpz
-
+
@vprint :Saturate 1 "Maximum number of steps: $(length(pr))\n"
for i=2:length(pr)
@vprint :Saturate 1 "Step number $i\n"
@@ -597,7 +597,7 @@ function _hensel(f::Generic.Poly{nf_elem},
_cache_lll[pr[i]] = (M, Mi, d)
end
end
-
+
if ispure
ap = Qt((-coeff(f, 0)))
@@ -702,7 +702,7 @@ function _hensel(f::Generic.Poly{nf_elem}, p::Int, k::Int; max_roots::Int = degr
break
end
end
-
+
S = FqNmodFiniteField(lpfac, :z, false)
ST, T = PolynomialRing(S,"T", cached=false)
fp = ST([S(Rpt(coeff(f, i))) for i=0:degree(f)])
@@ -745,7 +745,7 @@ function _lifting_expo(p::Int, deg_p::Int, K::AnticNumberField, bnd::Vector{arb}
@assert denominator(t) == 1
tt = numerator(t)
tt *= tt'
- if degree(K) == 1
+ if degree(K) == 1
c3 = BigFloat(tt[1,1])
else
#see norm_change_const for an explanation
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Arithmetic.jl b/src/NumFieldOrd/NfOrd/Ideal/Arithmetic.jl
index 18354b1f59..b1205ba711 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Arithmetic.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Arithmetic.jl
@@ -79,7 +79,7 @@ function sum_princ_gen_special(x::NfAbsOrdIdl, y::NfAbsOrdIdl)
else
M1 = _hnf_modular_eldiv(basis_matrix(y, copy = false), genx, :lowerleft)
res = ideal(OK, M1, false, true)
- end
+ end
@hassert :NfOrd 1 res == sum_via_basis_matrix(x, y)
return res
end
@@ -135,10 +135,10 @@ function +(x::NfAbsOrdIdl, y::NfAbsOrdIdl)
if isdefined(x, :norm) && isdefined(y, :norm) && isone(gcd(x.norm, y.norm))
return ideal(OK, 1)
end
- if has_princ_gen_special(x)
+ if has_princ_gen_special(x)
return sum_princ_gen_special(x, y)
end
- if has_princ_gen_special(y)
+ if has_princ_gen_special(y)
return sum_princ_gen_special(y, x)
end
g = gcd(minimum(x, copy = false), minimum(y, copy = false))
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Enum.jl b/src/NumFieldOrd/NfOrd/Ideal/Enum.jl
index 3c7e66dc89..deef4915d6 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Enum.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Enum.jl
@@ -17,7 +17,7 @@ mutable struct FactoredIdeal
end
end
-function ==(a::FactoredIdeal, b::FactoredIdeal)
+function ==(a::FactoredIdeal, b::FactoredIdeal)
return a.exp == b.exp
end
diff --git a/src/NumFieldOrd/NfOrd/Ideal/FacElem.jl b/src/NumFieldOrd/NfOrd/Ideal/FacElem.jl
index fb417e4be9..3ad77e9eeb 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/FacElem.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/FacElem.jl
@@ -239,7 +239,7 @@ function factor_over_coprime_base(x::FacElem{NfOrdIdl, NfOrdIdlSet}, coprime_bas
if iszero(e)
continue
end
- if divisible(norm(b, copy = false), P)
+ if divisible(norm(b, copy = false), P)
v += valuation(b, p)*e
end
end
@@ -252,9 +252,9 @@ function factor_over_coprime_base(x::FacElem{NfOrdIdl, NfOrdIdlSet}, coprime_bas
end
function simplify!(x::FacElem{NfOrdIdl, NfOrdIdlSet}; refine::Bool = false)
- if length(x.fac) <= 1
+ if length(x.fac) <= 1
return nothing
- elseif all(x -> iszero(x), values(x.fac))
+ elseif all(x -> iszero(x), values(x.fac))
x.fac = Dict{NfOrdIdl, fmpz}()
return nothing
end
@@ -263,7 +263,7 @@ function simplify!(x::FacElem{NfOrdIdl, NfOrdIdlSet}; refine::Bool = false)
ev = factor_over_coprime_base(x, cp)
x.fac = ev
return nothing
-end
+end
function simplify(x::FacElem{NfOrdFracIdl, NfOrdFracIdlSet})
z = deepcopy(x)
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Ideal.jl b/src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
index e3f781da15..0415bd7aea 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Ideal.jl
@@ -616,7 +616,7 @@ function assure_has_minimum(A::NfAbsOrdIdl)
if has_minimum(A)
return nothing
end
-
+
if degree(order(A)) == 1
if has_2_elem(A)
A.minimum = gcd(A.gen_one, numerator(coeff(A.gen_two.elem_in_nf, 0)))
@@ -1187,7 +1187,7 @@ function _minmod_comp(a::fmpz, b::NfOrdElem)
# ub + vf = r
# so u/r is the inverse and r is the den in the field
# we want gcd(r, a). so we use rres
- #at this point, min() SHOULD be
+ #at this point, min() SHOULD be
end
function _invmod(a::fmpz, b::NfAbsOrdElem)
@@ -1213,7 +1213,7 @@ function __invmod(a::fmpz, b::NfOrdElem)
k = nf(Zk)
d = denominator(b.elem_in_nf)
d, _ = ppio(d, a)
- e, _ = ppio(basis_matrix(Zk, copy = false).den, a)
+ e, _ = ppio(basis_matrix(Zk, copy = false).den, a)
mod_r = a^2*d*e
if fits(Int, mod_r)
S1 = ResidueRing(FlintZZ, Int(mod_r), cached=false)
@@ -1236,7 +1236,7 @@ function __invmod(a::fmpz, b::NfOrdElem)
St = PolynomialRing(S, cached=false)[1]
B = St(d*b.elem_in_nf)
F = St(k.pol)
-
+
m, u, v = rresx(B, F) # u*B + v*F = m mod modulus(S)
if iszero(m)
m = mod_r
@@ -2243,8 +2243,8 @@ function iscoprime(I::NfAbsOrdIdl, J::NfAbsOrdIdl)
if isprime_known(J) && isprime(J)
return iszero(valuation(I, J))
end
- #Lemma: Let R be a (commutative) artinian ring, let I be an ideal of R and
- #let x be a nilpotent element. Then I = 1 if and only if I + x = 1
+ #Lemma: Let R be a (commutative) artinian ring, let I be an ideal of R and
+ #let x be a nilpotent element. Then I = 1 if and only if I + x = 1
m = gcd(minimum(I, copy = false), minimum(J, copy = false))
m = ispower(m)[2]
if has_2_elem(I) && has_2_elem(J)
@@ -2270,7 +2270,7 @@ function iscoprime(I::NfAbsOrdIdl, J::NfAbsOrdIdl)
end
end
return isone(gcd(I, m)+J)
-end
+end
function iscoprime(I::NfAbsOrdIdl, a::fmpz)
return iscoprime(minimum(I, copy = false), a)
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Prime.jl b/src/NumFieldOrd/NfOrd/Ideal/Prime.jl
index 6d3bd4000a..62d3ac6e5a 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Prime.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Prime.jl
@@ -717,7 +717,7 @@ function coprime_base(A::Vector{NfOrdIdl}, p::fmpz)
return coprime_base_steel(Ap)
end
-
+
function _get_integer_in_ideal(I::NfOrdIdl)
if has_minimum(I)
return minimum(I)
@@ -730,7 +730,7 @@ function _get_integer_in_ideal(I::NfOrdIdl)
end
return minimum(I)
end
-
+
@doc Markdown.doc"""
coprime_base(A::Vector{NfOrdIdl}) -> Vector{NfOrdIdl}
coprime_base(A::Vector{NfOrdElem}) -> Vector{NfOrdIdl}
@@ -1608,7 +1608,7 @@ end
# Decomposition Group of a prime ideal
#
################################################################################
-
+
@doc Markdown.doc"""
decomposition_group(P::NfOrdIdl; G::Vector{NfToNfMor}) -> Vector{NfToNfMor}
@@ -1616,7 +1616,7 @@ Given a prime ideal $P$ in a normal number field $G$, it returns a vector of the
such that $\sigma_i(P) = P$ for all $i = 1,\dots, s$.
If a subgroup $G$ of automorphisms is given, the output is the intersection of the decomposition group with that subgroup.
"""
-
+
function decomposition_group(P::NfOrdIdl; G::Vector{NfToNfMor} = NfToNfMor[],
orderG::Int = degree(P)*ramification_index(P))
@assert isprime(P)
@@ -1697,9 +1697,9 @@ end
@doc Markdown.doc"""
decomposition_group(K::AnticNumberField, P::NfOrdIdl, m::Map)
-> Grp, GrpToGrp
-
+
Given a prime ideal $P$ of a number field $K$ and a map `m` return from
-`automorphism_group(K)`, return the decompositon group of $P$ as a subgroup of
+`automorphism_group(K)`, return the decompositon group of $P$ as a subgroup of
the domain of `m`.
"""
function decomposition_group(K::AnticNumberField, P::NfOrdIdl, mG::Map)
@@ -1712,7 +1712,7 @@ end
# Inertia subgroup of a prime ideal
#
################################################################################
-
+
@doc Markdown.doc"""
inertia_subgroup(P::NfOrdIdl; G::Vector{NfToNfMor}) -> Vector{NfToNfMor}
@@ -1720,7 +1720,7 @@ Given a prime ideal $P$ in a normal number field, it returns a vector of the aut
such that $\sigma_i(P) = P$ for all $i = 1,\dots, s$ and induce the identity on the residue field.
If a subgroup $G$ of automorphisms is given, the output is the intersection of the inertia group with $G$.
"""
-
+
function inertia_subgroup(P::NfOrdIdl; G::Vector{NfToNfMor} = NfToNfMor[])
@assert isprime(P)
O = order(P)
@@ -1803,7 +1803,7 @@ end
@doc Markdown.doc"""
inertia_subgroup(K::AnticNumberField, P::NfOrdIdl, m::Map) -> Grp, GrpToGrp
-
+
Given a prime ideal $P$ of a number field $K$ and a map `m` return from
`automorphism_group(K)`, return the intertia subgroup of $P$ as a subgroup of
the domain of `m`.
@@ -1838,9 +1838,9 @@ end
@doc Markdown.doc"""
ramification_group(K::AnticNumberField, P::NfOrdIdl, m::Map) -> Grp, GrpToGrp
-
+
Given a prime ideal $P$ of a number field $K$ and a map `m` return from
-`automorphism_group(K)`, return the ramification group of $P$ as a subgroup of
+`automorphism_group(K)`, return the ramification group of $P$ as a subgroup of
the domain of `m`.
"""
function ramification_group(K::AnticNumberField, P::NfOrdIdl, i::Int, mG::Map)
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Relative.jl b/src/NumFieldOrd/NfOrd/Ideal/Relative.jl
index cf5ba92f68..beafa28203 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Relative.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Relative.jl
@@ -248,7 +248,7 @@ function prime_decomposition_type_nonindex(f::Map, p::NfOrdIdl, ZK = maximal_ord
Gp = factor_shape(gcd(Fp(f(K(p.gen_two))), Fp(G)))
else
Fpp = PolynomialRing(GF(minimum(p), cached = false), cached = false)[1]
- Gp = factor_shape(gcd(Fpp(f(K(p.gen_two))), Fpp(G)))
+ Gp = factor_shape(gcd(Fpp(f(K(p.gen_two))), Fpp(G)))
end
res = Vector{Tuple{Int, Int}}(undef, sum(values(Gp)))
ind = 1
diff --git a/src/NumFieldOrd/NfOrd/Ideal/TwoElement.jl b/src/NumFieldOrd/NfOrd/Ideal/TwoElement.jl
index bf26ee382d..b0aaa08b2f 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/TwoElement.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/TwoElement.jl
@@ -30,7 +30,7 @@ Returns whether $A$ has normal two element generators.
"""
function has_2_elem_normal(A::NfAbsOrdIdl)
#the one ideal <1, ?> is automatomatically normal>
- if isdefined(A, :gens_normal)
+ if isdefined(A, :gens_normal)
return isone(A.gen_one) || A.gens_normal > 1
end
if has_2_elem(A) && defines_2_normal(A)
@@ -51,7 +51,7 @@ function isconsistent(A::NfAbsOrdIdl)
if has_2_elem_normal(A) && !iszero(A.gen_two)
if !defines_2_normal(A)
@show "Not 2 normal"
- vshow(A)
+ vshow(A)
return false
end
end
@@ -284,7 +284,7 @@ function assure_2_normal_difficult(A::NfAbsOrdIdl)
else
d = Int[2, 3, 5, 7]
end
-
+
I = ideal(ZK, 1)
for i = 1:length(d)
m1, m = ppio(m, fmpz(d[i]))
@@ -295,7 +295,7 @@ function assure_2_normal_difficult(A::NfAbsOrdIdl)
lp = prime_decomposition(ZK, d[i])
v = Int[valuation_of_ideal_difficult(A1, p[1]) for p = lp]
for i = 1:length(v)
- if v[i] > 0
+ if v[i] > 0
I *= lp[i][1]^v[i]
end
end
@@ -341,7 +341,7 @@ function assure_2_normal(A::NfAbsOrdIdl)
A.gens_normal = fmpz(1)
return nothing
end
-
+
if norm(A) == 0
A.gen_one = fmpz(0)
A.gen_two = zero(O)
@@ -389,7 +389,7 @@ function assure_2_normal(A::NfAbsOrdIdl)
mg = _minmod(m^2, gen)
g = gcd(m, mg)
-
+
if gcd(m, div(mg, g)) == 1
if gcd(m^n, _normmod(m^n, gen)) != norm(A)
@vprint :NfOrd 2 "\n\noffending ideal $A \ngen is $gen\nWrong ideal\n"
@@ -441,7 +441,7 @@ function assure_2_normal(A::NfAbsOrdIdl)
if cnt > 100 && is2_normal_difficult(A)
assure_2_normal_difficult(A)
@hassert :NfOrd 1 isconsistent(A)
- return
+ return
end
if cnt > 1000
error("Having a hard time making generators normal for $A")
diff --git a/src/NumFieldOrd/NfOrd/Ideal/Valuation.jl b/src/NumFieldOrd/NfOrd/Ideal/Valuation.jl
index edc81fb26f..f3d6473836 100644
--- a/src/NumFieldOrd/NfOrd/Ideal/Valuation.jl
+++ b/src/NumFieldOrd/NfOrd/Ideal/Valuation.jl
@@ -98,8 +98,8 @@ function val_func_index(p::NfOrdIdl)
P = p.gen_one
pi_2 = mod(pi.num.gen_two.elem_in_nf, P^2)
M = representation_matrix(O(pi_2, false))
-
-
+
+
local val
let P = P, O = O, M = M, p = p
function val(x::nf_elem, no::fmpq = fmpq(0))
@@ -151,12 +151,12 @@ function val_fun_generic_small(p::NfOrdIdl)
mul!(x, x, e)
while x in O && v < 10
v += 1
- if !iszero(no)
+ if !iszero(no)
nn = divexact(nn, norm(p))
if !divisible(nn, norm(p))
break
end
- end
+ end
x = mod(x, p_mod)
mul!(x, x, e)
end
@@ -191,13 +191,13 @@ function val_func_generic(p::NfOrdIdl)
x = x*e
while x in O
v += 1
- if !iszero(no)
+ if !iszero(no)
nn = divexact(nn, norm(p))
if !divisible(nn, norm(p))
break
end
x = mod(x, p_mod)
- end
+ end
mul!(x, x, e)
end
return v-valuation(d, P)*p.splitting_type[1]
@@ -225,7 +225,7 @@ function _isindex_divisor(O::NfOrd, P::NfOrdIdl)
@assert isprime_known(P) && isprime(P)
if !isone(denominator(P.gen_two.elem_in_nf))
return true
- end
+ end
R = GF(Int(minimum(P)), cached = false)
Rt, t = PolynomialRing(R, "x", cached = false)
f = Rt(nf(P).pol)
@@ -242,7 +242,7 @@ end
function assure_valuation_function(p::NfOrdIdl)
if isdefined(p, :valuation)
return nothing
- end
+ end
O = order(p)
K = nf(O)
# for generic ideals
@@ -265,7 +265,7 @@ function assure_valuation_function(p::NfOrdIdl)
return nothing
end
P = minimum(p)
- if degree(O) < 40 && p.splitting_type[1]*p.splitting_type[2] == degree(O)
+ if degree(O) < 40 && p.splitting_type[1]*p.splitting_type[2] == degree(O)
local val3
let P = P, p = p
function val3(s::nf_elem, no::fmpq = fmpq(0))
@@ -375,7 +375,7 @@ function valuation(a::nf_elem, p::NfOrdIdl, no::fmpq = fmpq(0))
end
@hassert :NfOrd 0 !iszero(a)
assure_valuation_function(p)
- if p.is_prime != 1
+ if p.is_prime != 1
return Int(p.valuation(a, no))::Int
end
#First, check the content of a as a polynomial.
@@ -457,7 +457,7 @@ function valuation_naive(x::NfAbsOrdElem, B::NfAbsOrdIdl)
return i
end
-function valuation_naive(x::T, B::NfAbsOrdIdl) where T <: Union{nf_elem, NfAbsNSElem}
+function valuation_naive(x::T, B::NfAbsOrdIdl) where T <: Union{nf_elem, NfAbsNSElem}
@assert !isone(B)
i = 0
C = B
diff --git a/src/NumFieldOrd/NfOrd/LLL.jl b/src/NumFieldOrd/NfOrd/LLL.jl
index 0c4852c201..57c1c436be 100644
--- a/src/NumFieldOrd/NfOrd/LLL.jl
+++ b/src/NumFieldOrd/NfOrd/LLL.jl
@@ -51,7 +51,7 @@ function lll(A::NfOrdIdl, v::fmpz_mat = zero_matrix(FlintZZ, 1, 1); prec::Int =
K = nf(order(A))
- if iszero(v)
+ if iszero(v)
if istotally_real(K)
#in this case the gram-matrix of the minkowski lattice is the trace-matrix
#which is exact.
@@ -161,16 +161,16 @@ function _lll(A::NfOrdIdl, v::fmpz_mat = zero_matrix(FlintZZ, 1, 1); prec::Int =
end
## lattice has lattice disc = order_disc * norm^2
## lll needs to yield a basis sth
- ## l[1,1] = |b_i|^2 <= 2^((n-1)/2) disc^(1/n)
+ ## l[1,1] = |b_i|^2 <= 2^((n-1)/2) disc^(1/n)
## and prod(l[i,i]) <= 2^(n(n-1)/2) disc
n = nrows(l)
disc = abs(discriminant(order(A)))*norm(A)^2 * den^(2*n) * fmpz(2)^(2*sv)
di = root(disc, n)+1
di *= fmpz(2)^(div(n+1,2)) * fmpz(2)^prec
- if compare_index(l, 1, 1, di) > 0
+ if compare_index(l, 1, 1, di) > 0
@v_do :ClassGroup 2 printstyled("LLL basis too large\n", color = :red);
- @v_do :ClassGroup 3 println("bound is ", di, " value at ", 1, " is ", l[1,1]);
+ @v_do :ClassGroup 3 println("bound is ", di, " value at ", 1, " is ", l[1,1]);
throw(LowPrecisionLLL())
end
pr = prod_diagonal(l)
@@ -196,7 +196,7 @@ end
The same order, but with the basis now being LLL reduced wrt. the Minkowski metric.
"""
function lll(M::NfAbsOrd; prec::Int = 100)
-
+
if isdefined(M, :lllO)
return M.lllO::typeof(M)
end
@@ -207,7 +207,7 @@ function lll(M::NfAbsOrd; prec::Int = 100)
M.lllO = On
return On::typeof(M)
end
-
+
if degree(K) == 2
On = _lll_quad(M)
M.lllO = On
@@ -222,7 +222,7 @@ function lll(M::NfAbsOrd; prec::Int = 100)
return On::typeof(M)
end
end
-
+
return _lll(M, prec)
end
@@ -375,7 +375,7 @@ function _lll(M::NfAbsOrd, prec::Int)
M1 = _ordering_by_T2(M)
prec = max(prec, 10*n)
prec = max(prec, 100 + 25*div(degree(M), 3) + Int(round(log(abs(discriminant(M))))))
-
+
if n > 10
if n > 100
prec, M1 = lll_precomputation(M1, prec)
@@ -389,7 +389,7 @@ function _lll(M::NfAbsOrd, prec::Int)
end
function _ordering_by_T2(M::NfAbsOrd, prec::Int = 32)
-
+
K = nf(M)
B = basis(M, K)
ints = fmpz[lower_bound(t2(x, prec), fmpz) for x in B]
@@ -526,7 +526,7 @@ function _lll_sublattice(M::NfAbsOrd, u::Vector{Int}; prec = 100)
@vprint :LLL 3 "Block of dimension $(l)\n"
prec = max(prec, 10*n)
local g::fmpz_mat
-
+
bas = basis(M, K)[u]
profile_sub = nbits(prod(Hecke.upper_bound(t2(x), fmpz) for x in bas))
@vprint :LLL 3 "Starting with profile $(profile_sub)\n"
@@ -587,10 +587,10 @@ function _lll_with_parameters(M::NfAbsOrd, parameters::Tuple{Float64, Float64},
dM = sum(nbits(Hecke.upper_bound(t2(x), fmpz)) for x in basis(M, K))
@vprint :LLL 1 "Input profile: $(dM)\n"
@vprint :LLL 1 "Target profile: $(nbits(disc^2)+divexact(n*(n-1), 2)) \n"
- att = 0
+ att = 0
while steps == -1 || att < steps
att += 1
- if att > 3
+ if att > 3
@vprint :LLL "Having a hard time computing a LLL basis"
end
@vprint :LLL 3 "Attempt number : $(att)\n"
@@ -606,7 +606,7 @@ function _lll_with_parameters(M::NfAbsOrd, parameters::Tuple{Float64, Float64},
@vprint :LLL 3 "Minkowski matrix computed\n"
diag_d = prod_diagonal(d)
g = identity_matrix(FlintZZ, n)
-
+
prec = div(prec, 2)
shift!(d, -prec) #TODO: remove?
@@ -614,7 +614,7 @@ function _lll_with_parameters(M::NfAbsOrd, parameters::Tuple{Float64, Float64},
fmpz_mat_entry_add_ui!(d, i, i, UInt(nrows(d)))
end
@vtime :LLL 3 ccall((:fmpz_lll, libflint), Nothing, (Ref{fmpz_mat}, Ref{fmpz_mat}, Ref{Nemo.lll_ctx}), d, g, ctx)
-
+
if nbits(maximum(abs, g)) <= div(prec, 2)
fl = true
disc = abs(discriminant(M))
@@ -624,7 +624,7 @@ function _lll_with_parameters(M::NfAbsOrd, parameters::Tuple{Float64, Float64},
fl = false
else
pr = prod_diagonal(d)
- if pr > fmpz(2)^(div(n*(n-1), 2)+(n*prec)) * disc
+ if pr > fmpz(2)^(div(n*(n-1), 2)+(n*prec)) * disc
fl = false
end
end
@@ -815,7 +815,7 @@ function reduce_ideal(I::FacElem{NfOrdIdl, NfOrdIdlSet})
@hassert :PID_Test 1 A*evaluate(a) == evaluate(I)
return A, a
end
-
+
# The bound should be sqrt(disc) (something from LLL)
@doc Markdown.doc"""
@@ -955,7 +955,7 @@ function _new_power_reduce(A::NfOrdIdl, e::fmpz, Ainv::NfOrdIdl, d::fmpz)
C2inv = IJ
C2d = dCinv*dCinv
end
-
+
if isodd(e)
if norm(A)*norm(C2) > bdisc
a = divexact(short_elem_product(C2inv, Ainv), C2d*d)
@@ -998,9 +998,9 @@ end
#
################################################################################
-# Claus and Tommy:
+# Claus and Tommy:
# We express the basis of IJ in terms of the basis of I (I contains IJ)
-# Then we compute the lll of the matrix of the coordinates. This way we get a
+# Then we compute the lll of the matrix of the coordinates. This way we get a
# better basis to start the computation of LLL
#We compute the hnf to have a guaranteed bound on the entries
function _lll_product_basis(I::NfOrdIdl, J::NfOrdIdl)
@@ -1013,7 +1013,7 @@ function _lll_product_basis(I::NfOrdIdl, J::NfOrdIdl)
divexact!(iA, iA, de)
hnf_modular_eldiv!(iA, minimum(J))
@vtime :LLL 3 lll!(iA, lll_ctx(0.3, 0.51))
- @vtime :LLL 3 lll!(iA)
+ @vtime :LLL 3 lll!(iA)
mul!(iA, iA, A)
return iA
end
diff --git a/src/NumFieldOrd/NfOrd/LLLctx.jl b/src/NumFieldOrd/NfOrd/LLLctx.jl
index 2d6432be7c..57687c2c34 100644
--- a/src/NumFieldOrd/NfOrd/LLLctx.jl
+++ b/src/NumFieldOrd/NfOrd/LLLctx.jl
@@ -94,7 +94,7 @@ function weighted_minkowski_gram_scaled(L::NfLattice, v::fmpz_mat, prec::Int)
for i=1:n
fmpz_mat_entry_add_ui!(g, i, i, UInt(nrows(d)))
end
- return g
+ return g
end
function lll(L::NfLattice, weights::fmpz_mat = zero_matrix(FlintZZ, 1, 1); starting_prec::Int = 100 + 25*div(dim(L), 3) + Int(round(log(abs(discriminant(L))))))
@@ -168,7 +168,7 @@ function _lll(L::NfLattice, weights::fmpz_mat, prec::Int)
disc = discriminant(L) * fmpz(2)^(2*sv)
di = root(disc, n) + 1
di *= fmpz(2)^(div(n+1,2)) * fmpz(2)^prec
- if compare_index(d, 1, 1, di) > 0
+ if compare_index(d, 1, 1, di) > 0
fl = false
end
pr = prod_diagonal(d)
diff --git a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl
index cedf299f32..a85fc9087d 100644
--- a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl
+++ b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl
@@ -249,7 +249,7 @@ end
@doc Markdown.doc"""
coefficient_ideals(M::PMat)
-Returns the vector of coefficient ideals.
+Returns the vector of coefficient ideals.
"""
coefficient_ideals(M::PMat) = M.coeffs
diff --git a/src/NumFieldOrd/NfOrd/MaxOrd/DedekindCriterion.jl b/src/NumFieldOrd/NfOrd/MaxOrd/DedekindCriterion.jl
index 49012cb153..4de8cb83b2 100644
--- a/src/NumFieldOrd/NfOrd/MaxOrd/DedekindCriterion.jl
+++ b/src/NumFieldOrd/NfOrd/MaxOrd/DedekindCriterion.jl
@@ -50,8 +50,8 @@ function dedekind_test(O::NfOrd, p::fmpz, compute_order::Type{Val{S}} = Val{true
Zyf = Zy(f)
- fmodp = Kx(Zyf)
-
+ fmodp = Kx(Zyf)
+
fac = factor_squarefree(fmodp)
g = prod(x for x in keys(fac.fac))
@@ -68,10 +68,10 @@ function dedekind_test(O::NfOrd, p::fmpz, compute_order::Type{Val{S}} = Val{true
@assert r == 0
setcoeff!(g1,i,q)
end
-
+
g1modp = Kx(g1)
U = gcd(gcd(g, h), g1modp)
-
+
if compute_order == Val{false}
if isone(U)
return true
@@ -80,7 +80,7 @@ function dedekind_test(O::NfOrd, p::fmpz, compute_order::Type{Val{S}} = Val{true
end
else
- pmaximal = (isone(U))
+ pmaximal = (isone(U))
if pmaximal
return true, O
@@ -132,26 +132,26 @@ dedekind_poverorder(O::NfOrd, p::Integer) = dedekind_poverorder(O, FlintZZ(p))
function dedekind_test_composite(O::NfOrd, p::fmpz)
@assert isequation_order(O)
-
+
Zy = PolynomialRing(FlintZZ, "y")[1]
R = ResidueRing(FlintZZ, p, cached = false)
Rx = PolynomialRing(R, "x", cached=false)[1]
f = Zy(nf(O).pol)
- fmodp = Rx(f)
-
+ fmodp = Rx(f)
+
# Now, I would like to have the squarefree factorization of fmodp
# I go for the f/gcd(f,f')
-
+
divs, gcdfderf = _gcd_with_failure(fmodp, derivative(fmodp))
-
+
if !isone(divs)
return gcd(divs, p), O
end
-
+
sqff = divexact(fmodp, gcdfderf)
-
+
# first build 1/p ( f - g*h)
gZ = lift(Zy,sqff)
@@ -159,14 +159,14 @@ function dedekind_test_composite(O::NfOrd, p::fmpz)
g1 = f - gZ*hZ
g1 = divexact(g1, p)
-
+
g1modp = Rx(g1)
- divs, par1 = _gcd_with_failure(gcdfderf, sqff)
+ divs, par1 = _gcd_with_failure(gcdfderf, sqff)
if !isone(divs)
return gcd(divs, p), O
end
- divs, U = _gcd_with_failure(par1, g1modp)
+ divs, U = _gcd_with_failure(par1, g1modp)
if !isone(divs)
return gcd(divs, p), O
end
diff --git a/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl b/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl
index d5ece9f58a..ff983f8e7c 100644
--- a/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl
+++ b/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrd.jl
@@ -301,7 +301,7 @@ function _TameOverorderBL(O::NfOrd, lp::Vector{fmpz})
end
else
if isdefining_polynomial_nice(nf(O)) && iscoprime(index(OO), q)
- q1, OOq = dedekind_test_composite(EquationOrder(K), q)
+ q1, OOq = dedekind_test_composite(EquationOrder(K), q)
if !isone(q1)
push!(M, q1)
push!(M, divexact(q, q1))
diff --git a/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrdNS.jl b/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrdNS.jl
index 43f05ac6c8..53d9cce3f6 100644
--- a/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrdNS.jl
+++ b/src/NumFieldOrd/NfOrd/MaxOrd/MaxOrdNS.jl
@@ -53,7 +53,7 @@ function _maximal_order_round_four(O::NfAbsOrd{<:NumField{fmpq}, <:NumFieldElem{
O1 = pmaximal_overorder(O, p)
if valuation(discriminant(O1), p) < valuation(discriminant(OO),p)
OO += O1
- end
+ end
@vprint :NfOrd 1 "done\n"
end
end
@@ -177,7 +177,7 @@ function _maximal_order_of_components(L::NfAbsNS) where {S, T}
end
end
return B, lp, d
-end
+end
function pradical_trace1(O::NfAbsOrd{NfAbsNS, NfAbsNSElem}, p::Union{Int, fmpz})
return pradical_trace(O, p)
diff --git a/src/NumFieldOrd/NfOrd/MaxOrd/Polygons.jl b/src/NumFieldOrd/NfOrd/MaxOrd/Polygons.jl
index e21526c6c3..c0945fc1a3 100644
--- a/src/NumFieldOrd/NfOrd/MaxOrd/Polygons.jl
+++ b/src/NumFieldOrd/NfOrd/MaxOrd/Polygons.jl
@@ -497,7 +497,7 @@ function _order_for_polygon_overorder(K::S, elt::Vector{T}, dold::fmpq = fmpq(0)
break
end
- B = basis_matrix(prods, FakeFmpqMat)
+ B = basis_matrix(prods, FakeFmpqMat)
hnf_modular_eldiv!(B.num, B.den, :lowerleft)
dd = B.num[nrows(B) - degree(K) + 1, 1]
@@ -605,11 +605,11 @@ function _decomposition(O::NfAbsOrd, I::NfAbsOrdIdl, Ip::NfAbsOrdIdl, T::NfAbsOr
end
k = (1-1/BigInt(p))^degree(O) < 0.1
-
+
if !k
#The probability of finding a random generator is high
for j in 1:length(ideals)
-
+
P = ideals[j][1]
f = P.splitting_type[2]
#@vprint :NfOrd 1 "Chances for finding second generator: ~$((1-1/BigInt(p)))\n"
@@ -688,7 +688,7 @@ function _decomposition(O::NfAbsOrd, I::NfAbsOrdIdl, Ip::NfAbsOrdIdl, T::NfAbsOr
if issimple(nf(O)) && isdefining_polynomial_nice(nf(O))
u = O(mod(u.elem_in_nf, p))
end
-
+
@hassert :NfOrd 1 containment_by_matrices(u, P)
modulo = norm(P)*p
if iszero(mod(norm(u), modulo))
diff --git a/src/NumFieldOrd/NfOrd/NarrowPicardGroup.jl b/src/NumFieldOrd/NfOrd/NarrowPicardGroup.jl
index 691e5a9c7e..a2ba2bda7f 100644
--- a/src/NumFieldOrd/NfOrd/NarrowPicardGroup.jl
+++ b/src/NumFieldOrd/NfOrd/NarrowPicardGroup.jl
@@ -55,7 +55,7 @@ function narrow_picard_group(O::NfOrd)
I0 = mC(C[i])
I = I0^(order(C[i]))
push!(idealgens, I0)
- # I is principal
+ # I is principal
fl, a = isprincipal(I)
@assert fl
q = elem_to_Q(elem_in_nf(a))
@@ -106,7 +106,7 @@ function narrow_picard_group(O::NfOrd)
end
# A test
-
+
_Q, = units_modulo_totally_positive_units(O)
r, s = signature(nf(O))
@assert order(BS) == divexact(order(C) * 2^r, order(_Q))
diff --git a/src/NumFieldOrd/NfOrd/NfOrd.jl b/src/NumFieldOrd/NfOrd/NfOrd.jl
index f986ff7f7c..bd714bea50 100644
--- a/src/NumFieldOrd/NfOrd/NfOrd.jl
+++ b/src/NumFieldOrd/NfOrd/NfOrd.jl
@@ -344,7 +344,7 @@ function index(O::NfAbsOrd; copy::Bool = true)
!isone(denominator(i)) && error("Order does not contain the equation order")
O.index = abs(numerator(i))
end
- if copy
+ if copy
return deepcopy(O.index)
else
return O.index
@@ -529,7 +529,7 @@ Checks whether $a$ lies in $\mathcal O$.
"""
function in(a::nf_elem, O::NfOrd)
@assert parent(a) == nf(O)
- if isdefining_polynomial_nice(nf(O)) && contains_equation_order(O)
+ if isdefining_polynomial_nice(nf(O)) && contains_equation_order(O)
d = denominator!(O.tcontain_fmpz, a)
if isone(d)
return true
@@ -652,7 +652,7 @@ function norm_change_const(O::NfOrd; cached::Bool = true)
if cached && isdefined(O, :norm_change_const)
return O.norm_change_const::Tuple{BigFloat, BigFloat}
end
-
+
z = _norm_change_const(O.basis_nf)
O.norm_change_const = z
return z::Tuple{BigFloat, BigFloat}
@@ -827,7 +827,7 @@ end
any_order(K::NumberField)
Return some order in $K$. In case the defining polynomial for $K$
-is monic and integral, this just returns the equation order.
+is monic and integral, this just returns the equation order.
In the other case $\mathbb Z[\alpha]\cap \mathbb Z[1/\alpha]$
is returned.
"""
@@ -1300,7 +1300,7 @@ function different(R::NfAbsOrd; proof::Bool = true)
end
if norm(D) == nD
nt += 1
- if nt > 20
+ if nt > 20
if proof
if !isgorenstein(R)
error("function only works for Gorenstein")
diff --git a/src/NumFieldOrd/NfOrd/Overorders.jl b/src/NumFieldOrd/NfOrd/Overorders.jl
index fe6a964d72..54e2efae0f 100644
--- a/src/NumFieldOrd/NfOrd/Overorders.jl
+++ b/src/NumFieldOrd/NfOrd/Overorders.jl
@@ -24,7 +24,7 @@ function defines_minimal_overorder(B::Vector, l::Vector)
m[1, i] = numerator(x.coeffs[i])
end
fl = iszero_mod_hnf!(m, M.num)
- return fl, M
+ return fl, M
end
function defines_minimal_overorder(B::Vector{nf_elem}, l::Vector{nf_elem})
@@ -39,7 +39,7 @@ function defines_minimal_overorder(B::Vector{nf_elem}, l::Vector{nf_elem})
m[1, i] = numerator(coeff(x, i - 1))
end
fl = iszero_mod_hnf!(m, M.num)
- return fl, M
+ return fl, M
end
################################################################################
@@ -250,7 +250,7 @@ function _minimal_overorders_nonrecursive_meataxe(O, M)
end
B = mA.bottom_snf_basis
-
+
autos = GrpAbFinGenMap[]
for i in 1:degree(O)
@@ -331,7 +331,7 @@ function _minimal_poverorders_in_ring_of_multipliers(O, P, excess = Int[0], use_
d = degree(O)
K = _algebra(O)
#@assert isone(B[1])
-
+
autos = GrpAbFinGenMap[]
for i in 1:degree(O)
@@ -359,13 +359,13 @@ function _minimal_poverorders_in_ring_of_multipliers(O, P, excess = Int[0], use_
else
subs = stable_subgroups(A, autos, minimal = true, op = (G, z) -> sub(G, z, false))
end
-
+
for i in 1:mA.offset
potential_basis[i] = mA.bottom_snf_basis[i]
end
offset = mA.offset
-
+
#The degree of the extension divides the degree of a prime of M lying over P
lQ = prime_ideals_over(M, P)
rel_fs = fmpz[divexact(valuation(norm(Q), p), f) for Q in lQ]
@@ -403,11 +403,11 @@ function _minimal_poverorders_in_ring_of_multipliers(O, P, excess = Int[0], use_
end
end
end
-
+
if !(2 in fac) && length(lQ) == 1 && norm(P)^rel_fs[1] == order(A)
return orders
end
-
+
for s in subs
T = image(s[2], false)
G = domain(T[2])
@@ -431,8 +431,8 @@ function _minimal_poverorders_in_ring_of_multipliers(O, P, excess = Int[0], use_
L = Order(K, hnf!(bL, :lowerleft), check = false, cached = false)
push!(orders, L)
end
-
-
+
+
return orders
end
@@ -452,9 +452,9 @@ function _minimal_poverorders_at_2(O, P, excess = Int[])
push!(orders, O1)
return orders
end
-
+
f = valuation(norm(P), 2)
-
+
autos = GrpAbFinGenMap[]
for i in 1:degree(O)
@@ -471,7 +471,7 @@ function _minimal_poverorders_at_2(O, P, excess = Int[])
push!(autos, induce(mA, x -> x^2))
filter!(x -> !iszero(x.map), autos)
-
+
potential_basis = Vector{elem_type(K)}(undef, d)
offset = mA.offset
@@ -531,11 +531,11 @@ function _minimal_poverorders_at_2(O, P, excess = Int[])
end
end
end
-
+
if !(2 in fac) && length(lQ) == 1 && norm(P)^rel_fs[1] == order(A)
return orders
end
-
+
for s in subs
T = image(s[2], false)
G = domain(T[2])
@@ -555,8 +555,8 @@ function _minimal_poverorders_at_2(O, P, excess = Int[])
L = Order(K, bL, check = false, cached = false)
push!(orders, L)
end
-
-
+
+
return orders
end
@@ -771,7 +771,7 @@ function poverorders_one_step_generic(O, p::fmpz)
end
offset = mA.offset
-
+
excess = 0
subs = stable_subgroups(A, autos, op = (G, z) -> sub(G, z, false))
@@ -792,7 +792,7 @@ function poverorders_one_step_generic(O, p::fmpz)
end
b, bmat = defines_order(K, deepcopy(potential_basis))
bmat = hnf!(bmat)
- if b
+ if b
push!(orders, Order(K, bmat))
else
excess += 1
@@ -900,7 +900,7 @@ function poverorders_nonrecursive_meataxe(O, N, p::fmpz)
end
offset = mA.offset
-
+
excess = 0
subs = stable_subgroups(A, autos, op = (G, z) -> sub(G, z, false))
@@ -921,7 +921,7 @@ function poverorders_nonrecursive_meataxe(O, N, p::fmpz)
end
b, bmat = defines_order(K, deepcopy(potential_basis))
bmat = hnf!(bmat)
- if b
+ if b
push!(orders, Order(K, bmat))
else
excess += 1
@@ -985,9 +985,9 @@ function pprimary_overorders_bass(O, P)
push!(res1, O2n)
O3 = O2
P = prime_ideals_over(O2, primes[1])[1]
- O2 = ring_of_multipliers(P)
+ O2 = ring_of_multipliers(P)
end
-
+
res2 = typeof(O)[]
O3 = O1
O2 = ring_of_multipliers(primes[2])
@@ -996,7 +996,7 @@ function pprimary_overorders_bass(O, P)
push!(res2, O2)
O3 = O2
P = prime_ideals_over(O2, primes[2])[1]
- O2 = ring_of_multipliers(P)
+ O2 = ring_of_multipliers(P)
end
append!(res, res1)
append!(res, res2)
@@ -1006,7 +1006,7 @@ function pprimary_overorders_bass(O, P)
end
end
return res
-
+
end
################################################################################
diff --git a/src/NumFieldOrd/NfOrd/RayClassGrp.jl b/src/NumFieldOrd/NfOrd/RayClassGrp.jl
index eb07e34201..dc757b25d6 100644
--- a/src/NumFieldOrd/NfOrd/RayClassGrp.jl
+++ b/src/NumFieldOrd/NfOrd/RayClassGrp.jl
@@ -15,7 +15,7 @@ mutable struct MapRayClassGrp <: Map{GrpAbFinGen, FacElemMon{Hecke.NfOrdIdlSet},
fact_mod::Dict{NfOrdIdl, Int} #The factorization of the finite part of the defining modulus
gens::Tuple{Vector{NfOrdIdl}, Vector{GrpAbFinGenElem}}
-
+
#Dictionaries to cache preimages. Used in the action on the ray class group
prime_ideal_preimage_cache::Dict{NfOrdIdl, GrpAbFinGenElem}
prime_ideal_cache::Vector{NfOrdIdl}
@@ -111,7 +111,7 @@ function __assure_princ_gen(c::Hecke.ClassGrpCtx{SMat{fmpz}}, nquo::Int)
return res
end
-function _assure_princ_gen(mC::MapClassGrp)
+function _assure_princ_gen(mC::MapClassGrp)
if isdefined(mC, :princ_gens)
return nothing
end
@@ -190,7 +190,7 @@ function class_as_ray_class(C::GrpAbFinGen, mC::MapClassGrp, exp_class::Function
function disclog1(J::NfOrdIdl)
return mQ(mC\(J))
end
-
+
function disclog1(J::FacElem{NfOrdIdl, NfOrdIdlSet})
a = X[0]
for (f, k) in J.fac
@@ -214,9 +214,9 @@ function class_as_ray_class(C::GrpAbFinGen, mC::MapClassGrp, exp_class::Function
mp1.clgrpmap = mC
return Q, mp1
end
-
+
local disclog
- let X = X, mC = mC
+ let X = X, mC = mC
function disclog(J::NfOrdIdl)
return X((mC\J).coeff)
end
@@ -241,21 +241,21 @@ end
function empty_ray_class(m::NfOrdIdl)
O = order(parent(m))
X = abelian_group(Int[])
-
+
local exp
let O = O
function exp(a::GrpAbFinGenElem)
return FacElem(Dict(ideal(O,1) => fmpz(1)))
end
end
-
+
local disclog
let X = X
function disclog(J::Union{NfOrdIdl, FacElem{NfOrdIdl}})
return id(X)
end
end
-
+
mp = Hecke.MapRayClassGrp()
mp.header = Hecke.MapHeader(X, FacElemMon(parent(m)) , exp, disclog)
mp.defining_modulus = (m, InfPlc[])
@@ -620,7 +620,7 @@ end
#
@doc Markdown.doc"""
ray_class_group(m::NfOrdIdl, inf_plc::Vector{InfPlc}; n_quo::Int, lp::Dict{NfOrdIdl, Int}) -> GrpAbFinGen, MapRayClassGrp
-
+
Given an ideal $m$ and a set of infinite places of $K$,
this function returns the corresponding ray class group as an abstract group $\mathcal {Cl}_m$ and a map going
from the group into the group of ideals of $K$ that are coprime to $m$.
@@ -777,13 +777,13 @@ function ray_class_group(m::NfOrdIdl, inf_plc::Vector{InfPlc} = Vector{InfPlc}()
R[j, ngens(C)+ind-1+s] = -a[1, s]
end
end
- end
-
+ end
+
X = abelian_group(R)
if n_quo != -1
X.exponent = n_quo
end
-
+
local disclog
let X = X, mC = mC, C = C, exp_class = exp_class, powers = powers, groups_and_maps = groups_and_maps, quo_rings = quo_rings, lH = lH, diffC = diffC, n_quo = n_quo, m = m, expon = expon
invd = invmod(fmpz(diffC), expon)
@@ -976,7 +976,7 @@ function ray_class_groupQQ(O::NfOrd, modulus::Int, inf_plc::Bool, n_quo::Int)
R=ResidueRing(FlintZZ, modulus, cached=false)
U, mU = unit_group_mod(R, n_quo)
U.exponent = n_quo
- if inf_plc
+ if inf_plc
function disc_log1(I::NfOrdIdl)
@assert gcd(minimum(I),modulus)==1
i = Int(mod(I.minimum, modulus))
@@ -1068,7 +1068,7 @@ function find_gens(mR::MapRayClassGrp; coprime_to::fmpz = fmpz(-1))
if coprime_to != -1
mm = lcm(mm, coprime_to)
end
- mm = lcm(mm, discriminant(EquationOrder(nf(O))))
+ mm = lcm(mm, discriminant(EquationOrder(nf(O))))
if isdefined(mR, :gens)
if coprime_to == -1
return mR.gens[1], mR.gens[2]
@@ -1123,7 +1123,7 @@ function find_gens(mR::MapRayClassGrp; coprime_to::fmpz = fmpz(-1))
push!(lp, ideal(O, gens_m[i][1]))
q, mq = quo(R, sR, false)
s, ms = snf(q)
- if order(s) == 1
+ if order(s) == 1
if !isdefined(mR, :gens)
mR.gens = (lp, sR)
end
@@ -1135,7 +1135,7 @@ function find_gens(mR::MapRayClassGrp; coprime_to::fmpz = fmpz(-1))
push!(lp, ideal(O, gens_m[i][1]))
q, mq = quo(R, sR, false)
s, ms = snf(q)
- if order(s) == 1
+ if order(s) == 1
if !isdefined(mR, :gens)
mR.gens = (lp, sR)
end
diff --git a/src/NumFieldOrd/NfOrd/ResidueRing.jl b/src/NumFieldOrd/NfOrd/ResidueRing.jl
index 93d0c54e46..7ca43936f0 100644
--- a/src/NumFieldOrd/NfOrd/ResidueRing.jl
+++ b/src/NumFieldOrd/NfOrd/ResidueRing.jl
@@ -402,7 +402,7 @@ function ==(x::AbsOrdQuoRing, y::AbsOrdQuoRing)
return base_ring(x) === base_ring(y) && ideal(x) == ideal(y)
end
-function ==(x::AbsOrdQuoRingElem, y::AbsOrdQuoRingElem)
+function ==(x::AbsOrdQuoRingElem, y::AbsOrdQuoRingElem)
mod!(x.elem, parent(x))
mod!(y.elem, parent(x))
return x.elem == y.elem
diff --git a/src/NumFieldOrd/NfOrd/ResidueRingMultGrp.jl b/src/NumFieldOrd/NfOrd/ResidueRingMultGrp.jl
index e35fe2ab80..a2b919f043 100644
--- a/src/NumFieldOrd/NfOrd/ResidueRingMultGrp.jl
+++ b/src/NumFieldOrd/NfOrd/ResidueRingMultGrp.jl
@@ -92,7 +92,7 @@ function _multgrp(Q::NfOrdQuoRing, save_tame_wild::Bool = false; method = nothin
G, GtoQ = _direct_product(groups, maps, prime_powers, Q, save_tame_wild)
S, StoG, StoQ = snf(G, GtoQ)
-
+
if save_tame_wild
for s = 1:length(tame_ind)
StoQ.tame[tame_ind[s][1]].disc_log = StoG\(G[tame_ind[s][2]]) #Relies on the ordering tame\wild in the construction!
@@ -135,7 +135,7 @@ function _multgrp_mod_pv(p::NfOrdIdl, v::Int, pv::NfOrdIdl; method=nothing)
@assert issnf(G2)
wild_part[p] = G2toO
gen1 = G1toO(G1[1])
-
+
rel1 = exponent(G1)
# G2.snf[end] is the order of the biggest cyclic subgroup of G2
gen1_obcs = powermod(gen1, G2.snf[end], pnumv)
@@ -147,7 +147,7 @@ function _multgrp_mod_pv(p::NfOrdIdl, v::Int, pv::NfOrdIdl; method=nothing)
G1toO.disc_log = G[1]
tame_part[p] = G1toO
-
+
obcs_inv = gcdx(G2.snf[end], rel1)[2]
function disc_log2(x::NfOrdQuoRingElem)
y = OtoQ\x
@@ -196,7 +196,7 @@ function _multgrp_mod_p(p::NfOrdIdl, pnumv::fmpz = fmpz(0))
res += 1
end
return fmpz[res]
- else
+ else
return fmpz[pohlig_hellman(gen_quo,n,y;factor_n=factor_n, big_step_cache = big_step_cache)]
end
end
@@ -235,7 +235,7 @@ end
function _1_plus_p_mod_1_plus_pv(p::NfOrdIdl, v::Int, pv::NfOrdIdl, pnumv::fmpz = fmpz(0); method=nothing)
@hassert :NfOrdQuoRing 2 isprime(p)
@assert v >= 1
-
+
if method == :quadratic
gens, rels, disc_log = _iterative_method(p,v;base_method=:quadratic,use_p_adic=false)
elseif method == :artin_hasse
@@ -325,7 +325,7 @@ end
#
-# Given generators and relations for groups of two consecutives steps, this function computes
+# Given generators and relations for groups of two consecutives steps, this function computes
# generators and relations for the product
#
function _expand(g::Vector{NfOrdElem}, M::fmpz_mat, h::Vector{NfOrdElem}, N::Vector{fmpz}, disc_log::Function, pl::NfOrdIdl)
@@ -333,7 +333,7 @@ function _expand(g::Vector{NfOrdElem}, M::fmpz_mat, h::Vector{NfOrdElem}, N::Vec
M1 = zero_matrix(FlintZZ, length(N), length(N))
for i = 1:length(N)
M1[i, i] = N[i]
- end
+ end
return h, M1
end
isempty(h) && return g,M
@@ -361,7 +361,7 @@ function _expand(g::Vector{NfOrdElem}, M::fmpz_mat, h::Vector{NfOrdElem}, N::Vec
end
end
append!(g,h)
-
+
return g, Z
end
@@ -378,7 +378,7 @@ function _pu_mod_pv(pu::NfOrdIdl, pv::NfOrdIdl)
@assert isone(N.den)
G = abelian_group(N.num)
S, mS=snf(G)
-
+
#Generators
gens=Vector{NfOrdElem}(undef, ngens(S))
for i=1:ngens(S)
@@ -388,8 +388,8 @@ function _pu_mod_pv(pu::NfOrdIdl, pv::NfOrdIdl)
add!(gens[i], gens[i], mod(x[j], S.snf[end])*b[j])
end
end
-
- #Disclog
+
+ #Disclog
M = basis_mat_inv(pu, copy = false)*mS.imap
x_fakemat2 = FakeFmpqMat(zero_matrix(FlintZZ, 1, ncols(M)), fmpz(1))
local disclog
@@ -407,7 +407,7 @@ function _pu_mod_pv(pu::NfOrdIdl, pv::NfOrdIdl)
end
end
return gens, S.snf, disclog
-
+
end
# Let p be a prime ideal above a prime number pnum. Let e = v_p(pnum) be
@@ -470,7 +470,7 @@ function _artin_hasse_method(p::NfOrdIdl, u::Int, v::Int; pu::NfOrdIdl=p^u, pv::
local discrete_logarithm
let Q = Q, pnum = pnum, dlog = dlog
function discrete_logarithm(x::NfOrdElem)
- res = dlog(artin_hasse_log(Q(x), pnum))
+ res = dlog(artin_hasse_log(Q(x), pnum))
for i = 1:length(res)
res[i] = mod(res[i], M[end])
end
@@ -516,7 +516,7 @@ function artin_hasse_log(y::NfOrdQuoRingElem, pnum::fmpz)
invi = invmod(fmpz(i), m)
if iseven(i)
sub!(s, s, invi*t)
- else
+ else
add!(s, s, invi*t)
end
end
@@ -551,7 +551,7 @@ function _p_adic_method(p::NfOrdIdl, u::Int, v::Int; pu::NfOrdIdl=p^u, pv::NfOrd
powers = Dict{Int, nf_elem}()
local discrete_logarithm
let Q = Q, p = p, v = v, dlog = dlog, powers = powers
- function discrete_logarithm(b::NfOrdElem)
+ function discrete_logarithm(b::NfOrdElem)
res = dlog(p_adic_log(Q, p, v, b, powers))
for i = 1:length(res)
res[i] = mod(res[i], M[end])
@@ -608,7 +608,7 @@ function p_adic_exp(Q::NfOrdQuoRing, p::NfOrdIdl, v::Int, x::NfOrdElem)
end
add!(s, s, Q(inc.elem))
i_old = i
- end
+ end
return s.elem
end
@@ -644,9 +644,9 @@ function p_adic_log(Q::NfOrdQuoRing, p::NfOrdIdl, v::Int, y::NfOrdElem, powers::
val_p_xi += val_p_x
val_p_xi - val_p_i >= v && continue
mul!(xi, xi, x^(i-i_old))
- if iszero(val_pnum_i)
+ if iszero(val_pnum_i)
inc = _divexact(Q(xi), fmpz(i))
- else
+ else
if haskey(powers, val_p_i)
el = powers[val_p_i]
else
@@ -657,7 +657,7 @@ function p_adic_log(Q::NfOrdQuoRing, p::NfOrdIdl, v::Int, y::NfOrdElem, powers::
denom = O(i*el, false)
inc = divexact(Q(numer),Q(denom))
end
- if isodd(i)
+ if isodd(i)
add!(s, s, inc)
else
sub!(s, s, inc)
@@ -670,9 +670,9 @@ function p_adic_log(Q::NfOrdQuoRing, p::NfOrdIdl, v::Int, y::NfOrdElem, powers::
val_p_xi += val_p_x
val_p_xi - val_p_i >= v && continue
mul!(xi, xi, x^(i-i_old))
- if iszero(val_pnum_i)
+ if iszero(val_pnum_i)
inc = _divexact(Q(xi), fmpz(i))
- else
+ else
if haskey(powers, val_p_i)
el = powers[val_p_i]
else
@@ -683,7 +683,7 @@ function p_adic_log(Q::NfOrdQuoRing, p::NfOrdIdl, v::Int, y::NfOrdElem, powers::
denom = O(i*el, false)
inc = divexact(Q(numer),Q(denom))
end
- if isodd(i)
+ if isodd(i)
add!(s, s, inc)
else
sub!(s, s, inc)
@@ -796,26 +796,26 @@ function _prime_part_multgrp_mod_p(p::NfOrdIdl, prime::Int)
@hassert :NfOrdQuoRing 2 isprime(p)
O = order(p)
Q, mQ = ResidueField(O,p)
-
+
n = norm(p) - 1
s=valuation(n,prime)
powerp=prime^s
m=divexact(n,powerp)
-
+
powm=divexact(powerp,prime)
found=false
g=Q(1)
while found==false
g = rand(Q)
- if g != Q(0)
+ if g != Q(0)
g=g^m
- if g^powm != Q(1)
+ if g^powm != Q(1)
found=true
end
end
end
inv=gcdx(m,fmpz(powerp))[2]
-
+
function disclog(x::NfOrdElem)
t=mQ(x)^m
if powerp<10
@@ -923,10 +923,10 @@ function _find_gen(Q::FqFiniteField, powm::Vector{fmpz}, m::fmpz)
g = g^m
found = true
for i=1:length(powm)
- if isone(g^powm[i])
+ if isone(g^powm[i])
found = false
break
- end
+ end
end
end
return g
@@ -944,7 +944,7 @@ function _n_part_multgrp_mod_p(p::NfOrdIdl, n::Int)
k = gcd(npart, fmpz(n))
fac = factor(k)
powm = fmpz[divexact(npart, x) for x in keys(fac.fac)]
-
+
#
# We search for a random element with the right order
#
@@ -971,8 +971,8 @@ function _n_part_multgrp_mod_p(p::NfOrdIdl, n::Int)
mul!(el, el, w)
end
return fmpz[mod(fmpz(s)*inv, k)]
- else
- return fmpz[pohlig_hellman(w, k, t)*inv]
+ else
+ return fmpz[pohlig_hellman(w, k, t)*inv]
end
end
end
@@ -1041,16 +1041,16 @@ function _mult_grp_mod_n(Q::NfOrdQuoRing, y1::Dict{NfOrdIdl, Int}, y2::Dict{NfOr
end
tame_part[q].generators[1] = powermod(tame_part[q].generators[1], e1, minimum(idQ, copy = false))
end
-
+
i += ngens(G2)
nq = norm(q) - 1
@assert issnf(G2)
obcs = G2.snf[end] # order of the biggest cyclic subgroup
obcs_inv = gcdx(nq, obcs)[2]
-
+
local disc_log2
- let Q = Q, nq = nq, G2toO = G2toO
+ let Q = Q, nq = nq, G2toO = G2toO
function disc_log2(x::NfOrdElem)
y = Q(x)^nq
z = G2toO.discrete_logarithm(y.elem)
@@ -1059,8 +1059,8 @@ function _mult_grp_mod_n(Q::NfOrdQuoRing, y1::Dict{NfOrdIdl, Int}, y2::Dict{NfOr
end
return z
end
- end
-
+ end
+
G2toO2 = GrpAbFinGenToNfAbsOrdMap(G2, O, G2toO.generators, disc_log2)::GrpAbFinGenToAbsOrdMap{NfOrd, NfOrdElem}
push!(maps, G2toO2)
wild_part[q] = G2toO2
@@ -1338,7 +1338,7 @@ function _direct_product(groups::Vector{GrpAbFinGen}, maps::Vector{U}, ideals::V
end
gens = map(Q, [ g.elem for g in maps[1].generators ])
-
+
local disc_log1
let maps = maps
function disc_log1(x::AbsOrdQuoRingElem)
@@ -1416,8 +1416,8 @@ function _direct_product(groups::Vector{GrpAbFinGen}, maps::Vector{U}, ideals::V
return result
end
end
-
-
+
+
m = GrpAbFinGenToAbsOrdQuoRingMultMap(G, Q, generators, disc_log)
if tame_wild
m.tame = tame
diff --git a/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl b/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl
index f3d5a3de6d..4e6f8fae8c 100644
--- a/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl
+++ b/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl
@@ -166,8 +166,8 @@ function strong_echelon_form_naive!(A::Generic.Mat{NfOrdQuoRingElem})
end
end
- for i in j+1:m
-
+ for i in j+1:m
+
if iszero(T[1, i])
continue
end
@@ -303,7 +303,7 @@ function z_split(I::NfOrdIdl)
else
nz = prod(b[i, i] for i in 2:n)
end
-
+
A = NfOrdIdl[]
B = NfOrdIdl[]
@@ -388,7 +388,7 @@ function _strong_echelon_form_split(M::MatElem{NfOrdQuoRingElem}, ideals1)
m = ncols(M)
M_cur = zero_matrix(Q, n, m)
-
+
if length(ideals) == 1
return _strong_echelon_form_nonsplit(M)
end
@@ -439,7 +439,7 @@ function _strong_echelon_form_split(M::MatElem{NfOrdQuoRingElem}, ideals1)
end
end
-
+
_assure_weakly_normal_presentation(I)
gI = gcd(Q(I.gen_one), Q(I.gen_two))
@@ -478,7 +478,7 @@ end
function mul!(a::MatElem{NfOrdQuoRingElem}, b::MatElem{NfOrdQuoRingElem}, c::NfOrdQuoRingElem)
for i = 1:nrows(b)
for j = 1:ncols(b)
- mul!(a[i, j], b[i, j], c)
+ mul!(a[i, j], b[i, j], c)
end
end
return a
@@ -487,7 +487,7 @@ end
function mul_special!(a::MatElem{NfOrdQuoRingElem}, b::NfOrdQuoRingElem)
for i = 1:min(nrows(a), ncols(a))
for j = i:ncols(a)
- mul!(a[i, j], a[i, j], b)
+ mul!(a[i, j], a[i, j], b)
end
end
return a
@@ -496,7 +496,7 @@ end
function add_special!(a::MatElem{NfOrdQuoRingElem}, b::MatElem{NfOrdQuoRingElem})
for i = 1:min(nrows(b), ncols(b))
for j = i:ncols(b)
- add!(a[i, j], a[i, j], b[i, j])
+ add!(a[i, j], a[i, j], b[i, j])
end
end
return a
@@ -505,7 +505,7 @@ end
function add!(a::MatElem{NfOrdQuoRingElem}, b::MatElem{NfOrdQuoRingElem}, c::MatElem{NfOrdQuoRingElem})
for i = 1:nrows(b)
for j = 1:ncols(b)
- add!(a[i, j], b[i, j], c[i, j])
+ add!(a[i, j], b[i, j], c[i, j])
end
end
return a
@@ -526,7 +526,7 @@ end
# a *:= l;
# b *:= gi;
# assert g eq 1;
-# end if;
+# end if;
# assert 1 eq a+b;
# r := r*b+m*a;
# l *:= gi;
@@ -572,7 +572,7 @@ function _strong_echelon_form_nonsplit!(M)
ccall((:fmpz_mat_strong_echelon_form_mod, libflint), Nothing, (Ref{fmpz_mat}, Ref{fmpz}), forflint, modulus(RmodIZ))
for i in 1:min(n, m)
for j = 1:i-1
- zero!(M[i, j])
+ zero!(M[i, j])
end
for j in i:m
M[i, j] = Q(forflint[i, j])
@@ -669,7 +669,7 @@ function test_pseudohnf()
end
@show length(ideals)
-
+
gc()
@time pseudo_hnf_mod(pm, d, strategy = :split)
gc()
diff --git a/src/NumFieldOrd/NfOrd/TorsionUnits.jl b/src/NumFieldOrd/NfOrd/TorsionUnits.jl
index 149c11d1c9..34b97d2acc 100644
--- a/src/NumFieldOrd/NfOrd/TorsionUnits.jl
+++ b/src/NumFieldOrd/NfOrd/TorsionUnits.jl
@@ -1,6 +1,6 @@
################################################################################
#
-# NfOrd/TorsionUnits.jl : Torsion units in generic number field orders
+# NfOrd/TorsionUnits.jl : Torsion units in generic number field orders
#
# This file is part of Hecke.
#
@@ -160,7 +160,7 @@ function torsion_units_gen_order(O::T) where T <: Union{NfAbsOrd, NfRelOrd}
u = g^divexact(ord, ord_p)
while !(u in O)
u = u^p_int
- ord_p = divexact(ord_p, p_int)
+ ord_p = divexact(ord_p, p_int)
end
ord_O *= ord_p
end
@@ -203,17 +203,17 @@ function _torsion_units_lattice_enum(O::NfOrd)
local i
v = minkowski_map(x, p)
w = minkowski_map(y, p)
-
+
t = zero(parent(v[1]))
-
+
for i in 1:r1
t = t + v[i]*w[i]
end
-
+
for i in (r1 + 1):(r1 + 2*r2)
t = t + v[i]*w[i]
end
-
+
return t
end
@@ -225,7 +225,7 @@ function _torsion_units_lattice_enum(O::NfOrd)
A = ArbField(p, false)
M = ArbMatSpace(A, n, n,false)()
-
+
while true
A = ArbField(p, false)
M = ArbMatSpace(A, n, n, false)()
@@ -394,7 +394,7 @@ function _torsion_group_order_divisor(K::NumField)
while true
p = next_prime(p)
if divides(numerator(d1), fmpz(p))[1] || divides(denominator(d1), fmpz(p))[1]
-
+
end
lP = prime_decomposition(OK, p)
@@ -466,7 +466,7 @@ function _torsion_units_gen(K::AnticNumberField)
ord *= Int(p)^(i)
break
end
- end
+ end
end
_set_nf_torsion_units(K, (ord, gen))
return ord, gen
@@ -502,7 +502,7 @@ function _torsion_units_gen(K::NumField)
ord *= Int(p)^(i)
break
end
- end
+ end
end
set_special(K, :torsion_units => (ord, gen))
return ord, gen
diff --git a/src/NumFieldOrd/NfOrd/Unit.jl b/src/NumFieldOrd/NfOrd/Unit.jl
index 599b4e5a89..70d718b44d 100644
--- a/src/NumFieldOrd/NfOrd/Unit.jl
+++ b/src/NumFieldOrd/NfOrd/Unit.jl
@@ -1,6 +1,6 @@
################################################################################
#
-# NfOrd/Units.jl : Units in generic number field orders
+# NfOrd/Units.jl : Units in generic number field orders
#
# This file is part of Hecke.
#
diff --git a/src/NumFieldOrd/NfOrd/Unit/FindUnits.jl b/src/NumFieldOrd/NfOrd/Unit/FindUnits.jl
index 9f5e682cb8..f03b5dfaba 100644
--- a/src/NumFieldOrd/NfOrd/Unit/FindUnits.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/FindUnits.jl
@@ -28,7 +28,7 @@ function find_candidates(x::ClassGrpCtx, u::UnitGrpCtx, add::Int = 0)
end
push!(u.relations_used, xj)
else
- if xj in add_units
+ if xj in add_units
continue
end
end
@@ -43,7 +43,7 @@ function find_candidates(x::ClassGrpCtx, u::UnitGrpCtx, add::Int = 0)
end
push!(u.relations_used, xj)
else
- if xj in add_units
+ if xj in add_units
continue
end
end
@@ -126,7 +126,7 @@ function _unit_group_find_units(u::UnitGrpCtx, x::ClassGrpCtx; add_orbit::Bool =
end
end
new_add = 0
- while not_larger < not_larger_bound
+ while not_larger < not_larger_bound
add += new_add
new_add = 2
k, add_units, s1 = find_candidates(x, u, add)
@@ -185,11 +185,11 @@ function _unit_group_find_units(u::UnitGrpCtx, x::ClassGrpCtx; add_orbit::Bool =
@v_do :UnitGroup 2 pushindent()
m = add_unit!(u, y)
- if m
+ if m
new_add = 0
done[i] = true
- not_larger = 0
- if has_full_rank(u)
+ not_larger = 0
+ if has_full_rank(u)
@vprint :UnitGroup 1 "improved reg, reg is $(tentative_regulator(u))\n"
if first
idx, expected_reg = _validate_class_unit_group(x, u)
@@ -224,7 +224,7 @@ function _unit_group_find_units(u::UnitGrpCtx, x::ClassGrpCtx; add_orbit::Bool =
@v_do :UnitGroup 2 popindent()
end
-
+
if has_full_rank(u)
add_done = false
for i = 1:length(elements)
@@ -239,7 +239,7 @@ function _unit_group_find_units(u::UnitGrpCtx, x::ClassGrpCtx; add_orbit::Bool =
done[i] = true
continue
end
- add_done = add_unit!(u, elements[i]) || add_done
+ add_done = add_unit!(u, elements[i]) || add_done
if expected_reg > divexact(abs(tentative_regulator(u)), 2)
done = trues(length(elements))
not_larger = not_larger_bound + 1
@@ -263,14 +263,14 @@ function _unit_group_find_units(u::UnitGrpCtx, x::ClassGrpCtx; add_orbit::Bool =
@vprint :UnitGroup 1 "Regulator of current unit group is $(u.tentative_regulator)\n"
else
@vprint :UnitGroup 1 "current rank is $(length(u.units)), need $r\n"
- end
+ end
@vprint :UnitGroup 1 "-"^80 * "\n"
@vprint :UnitGroup 1 "Independent unit time: $time_indep\n"
@vprint :UnitGroup 1 "Adding dependent unit time: $time_add_dep_unit\n"
@vprint :UnitGroup 1 "Torsion test time: $time_torsion\n"
-
-
+
+
if starting_full_rank
return 1, div(starting_idx, _validate_class_unit_group(x, u)[1])
elseif has_full_rank(u)
diff --git a/src/NumFieldOrd/NfOrd/Unit/IsUnit.jl b/src/NumFieldOrd/NfOrd/Unit/IsUnit.jl
index 63736cb31b..1761586f56 100644
--- a/src/NumFieldOrd/NfOrd/Unit/IsUnit.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/IsUnit.jl
@@ -10,7 +10,7 @@
Returns whether $x$ is invertible or not.
"""
function isunit(x::NfOrdElem)
- return abs(norm(x)) == 1
+ return abs(norm(x)) == 1
end
_isunit(x::NfOrdElem) = isunit(x)
diff --git a/src/NumFieldOrd/NfOrd/Unit/Map.jl b/src/NumFieldOrd/NfOrd/Unit/Map.jl
index e170deeadd..880214409d 100644
--- a/src/NumFieldOrd/NfOrd/Unit/Map.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/Map.jl
@@ -57,7 +57,7 @@ function unit_group_disc_log(x::FacElem{nf_elem, AnticNumberField} , U::UnitGrpC
push!(res, r[i])
end
return G(res)
-end
+end
function unit_group_fac_elem(c::ClassGrpCtx; redo::Bool = false)
u = unit_group_ctx(c, redo = redo)
diff --git a/src/NumFieldOrd/NfOrd/Unit/Reduction.jl b/src/NumFieldOrd/NfOrd/Unit/Reduction.jl
index 580a209f87..750e23d9fe 100644
--- a/src/NumFieldOrd/NfOrd/Unit/Reduction.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/Reduction.jl
@@ -109,6 +109,6 @@ function reduce(u::Vector{T}, prec::Int = 32) where T
return u
end
@vprint :UnitGroup 1 "trying to reduce further...\n"
- end
+ end
end
diff --git a/src/NumFieldOrd/NfOrd/Unit/Relation.jl b/src/NumFieldOrd/NfOrd/Unit/Relation.jl
index a9938ea1f4..74fe17134c 100644
--- a/src/NumFieldOrd/NfOrd/Unit/Relation.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/Relation.jl
@@ -1,12 +1,12 @@
# Checks whether x[1]^z[1] * ... x[n]^z[n]*y^[n+1] is a torsion unit
# This can be improved
-function _check_relation_mod_torsion(x::Vector{FacElem{nf_elem, AnticNumberField}}, y::FacElem{nf_elem, AnticNumberField}, z::Vector{fmpz}, p::Int = 16)
+function _check_relation_mod_torsion(x::Vector{FacElem{nf_elem, AnticNumberField}}, y::FacElem{nf_elem, AnticNumberField}, z::Vector{fmpz}, p::Int = 16)
(length(x) + 1 != length(z)) && error("Lengths of arrays does not fit")
r = x[1]^z[1]
for i in 2:length(x)
r = r*x[i]^z[i]
- end
+ end
w = r*y^z[length(z)]
@@ -77,7 +77,7 @@ function _find_rational_relation!(rel::Vector{fmpz}, v::arb_mat, bound::fmpz)
for i in 1:r
rel[i] = numerator(z[i]*dlcm)
- end
+ end
rel[r + 1] = -dlcm
diff --git a/src/NumFieldOrd/NfOrd/Unit/UnitGrpCtx.jl b/src/NumFieldOrd/NfOrd/Unit/UnitGrpCtx.jl
index 15fc47c01b..4fc932049b 100644
--- a/src/NumFieldOrd/NfOrd/Unit/UnitGrpCtx.jl
+++ b/src/NumFieldOrd/NfOrd/Unit/UnitGrpCtx.jl
@@ -19,7 +19,7 @@ end
################################################################################
#
-# Initialization
+# Initialization
#
################################################################################
@@ -31,7 +31,7 @@ end
function _search_rational_relation(U::UnitGrpCtx{S}, y::S, bound::fmpz) where S
p = _rel_add_precision(U)
r = rank(U)
-
+
@v_do :UnitGroup 1 pushindent()
p, B = _conj_log_mat_cutoff_inv(U, p)
@@ -83,10 +83,10 @@ function _add_dependent_unit!(U::UnitGrpCtx{S}, y::S, rel_only::Type{Val{T}} = V
@assert has_full_rank(U)
K = nf(order(U))
-
+
deg = degree(K)
r = rank(U)
-
+
rreg = tentative_regulator(U)
bound = _denominator_bound_in_relation(rreg, K)
@vprint :UnitGroup 1 "Adding dependent unit ... \n"
@@ -302,10 +302,10 @@ function tentative_regulator(U::UnitGrpCtx)
if isdefined(U, :tentative_regulator)
rreg = U.tentative_regulator
else
- @vprint :UnitGroup 1 "Computing regulator of independent units with 64 bits ... \n"
+ @vprint :UnitGroup 1 "Computing regulator of independent units with 64 bits ... \n"
rreg = regulator(U.units, 64)
U.tentative_regulator = rreg
- @vprint :UnitGroup 1 "done \n"
+ @vprint :UnitGroup 1 "done \n"
end
return rreg
end
diff --git a/src/NumFieldOrd/NfOrd/Zeta.jl b/src/NumFieldOrd/NfOrd/Zeta.jl
index 7c8bc94623..d300aaf896 100644
--- a/src/NumFieldOrd/NfOrd/Zeta.jl
+++ b/src/NumFieldOrd/NfOrd/Zeta.jl
@@ -36,7 +36,7 @@ export zeta_log_residue
################################################################################
#
-# Macros to make floating point life (hopefully) easier
+# Macros to make floating point life (hopefully) easier
#
################################################################################
@@ -94,7 +94,7 @@ function _approx_error_bf(disc::fmpz, degree::Int, Tc = BigFloat)
logd_up = Tc(0)::Tc
logd_down = Tc(0)::Tc
sqrt_logd_up = Tc(0)::Tc
-
+
setrounding(Tc,RoundDown) do
logd_down = log(Tc(abs(disc)))
end
@@ -108,9 +108,9 @@ function _approx_error_bf(disc::fmpz, degree::Int, Tc = BigFloat)
C1 = @with_round_down(Tc(FlintQQ(2324)//FlintQQ(1000)),Tc)
C2 = @with_round_down(Tc(FlintQQ(388)//FlintQQ(100)),Tc)
- C3 = Tc(2)
+ C3 = Tc(2)
C4 = @with_round_down(Tc(FlintQQ(426)//FlintQQ(100)),Tc)
-
+
function F(X)#(X::Tc)
A1 = @with_round_down(C1*logd_down/(@with_round_up(sqrt(X)*log(3*X),Tc)),Tc)
A2 = @with_round_down(1 + C2/@with_round_up(log(X/9),Tc),Tc)
@@ -136,18 +136,18 @@ function _find_threshold(f, C, ste, decreasing::Bool, Tc = BigFloat)
x1 = 2*x0
y = f(x1)
end
-
+
dista = abs(x0-x1)
while !( y < C && dista < ste)
- if y > C
+ if y > C
x1 = x0 + 3*dista/2
else
x1 = x0 - dista/2
end
dista = abs(x1-x0)
-
+
x0 = x1
y = f(x0)
end
@@ -167,11 +167,11 @@ end
pro2 = logp*pm2
pro2 = pro2*m
-
+
# Now the inverse
inv2 = inv(pro2)
- # Now sqrt(x)log(X)/p^(m/2)*m*p
+ # Now sqrt(x)log(X)/p^(m/2)*m*p
pro3 = aa*inv2
pro3 = pro3 - 1
@@ -181,7 +181,7 @@ end
function _comp_summand(R, p::Int, m::Int, aa::arb)
return _comp_summand(R, fmpz(p), m, aa)
end
-
+
# Computing the g_K(X) term of Belabas-Friedmann
function _term_bf(O::NfOrd, B::Int, R::ArbField)
@@ -211,7 +211,7 @@ function _term_bf(O::NfOrd, B::Int, R::ArbField)
prodx9 = logxx09 * sqrtxx09
# small helper function (is this fast?)
-
+
while p < xx0
max_exp = _max_power_in(p, xx0)
@@ -222,14 +222,14 @@ function _term_bf(O::NfOrd, B::Int, R::ArbField)
summ = summ - summand
end
- #x += @elapsed
+ #x += @elapsed
lP = prime_decomposition_type(O, p)
for P in lP
Pnorm = fmpz(p)^P[1]
if Pnorm < xx0
max_exp = _max_power_in(Pnorm, xx0)
-
+
for m in 1:max_exp
summand = _comp_summand(R, Pnorm, m, prodx)
summ = summ + summand
@@ -238,7 +238,7 @@ function _term_bf(O::NfOrd, B::Int, R::ArbField)
end
if p < xx09
-
+
max_exp = _max_power_in(p, xx09)
for m in 1:max_exp
@@ -250,7 +250,7 @@ function _term_bf(O::NfOrd, B::Int, R::ArbField)
Pnorm = fmpz(p)^P[1]
if (Pnorm < xx09)
max_exp = _max_power_in(Pnorm, xx09)
-
+
for m in 1:max_exp
summand = _comp_summand(R, Pnorm, m, prodx9)
summ = summ - summand
@@ -280,7 +280,7 @@ function _residue_approx_bf(O::NfOrd, error::Float64)
der = Int(20)
- @assert error > 0.5^der
+ @assert error > 0.5^der
error_prime = @with_round_down(error - 0.5^der, BigFloat)
@@ -297,7 +297,7 @@ function _residue_approx_bf(O::NfOrd, error::Float64)
x0 = Int(ceil(_find_threshold(F, error_prime, Float64(10), true, Float64)))
x0 = x0 + 1
- prec = 64
+ prec = 64
val = _term_bf(O, x0, ArbField(prec, cached = false))
diff --git a/src/NumFieldOrd/NfOrd/norm_eqn.jl b/src/NumFieldOrd/NfOrd/norm_eqn.jl
index 5dd8fdd0fb..9e188a2f91 100644
--- a/src/NumFieldOrd/NfOrd/norm_eqn.jl
+++ b/src/NumFieldOrd/NfOrd/norm_eqn.jl
@@ -8,15 +8,15 @@ function norm_1_generators(A::Vector{NfOrdIdl})
f = matrix(FlintZZ, 1, length(A), [degree(x) for x = A])
k = nullspace(f)[2]
-
+
id = [FacElem(A, [k[i,j] for i=1:length(A)]) for j=1:ncols(k)]
- return id
+ return id
end
@doc Markdown.doc"""
norm_equation(K::AnticNumerField, a) -> nf_elem
-For $a$ an integer or rational, try to find $T \in K$ s.th.
+For $a$ an integer or rational, try to find $T \in K$ s.th.
$N(T) = a$. Raises an error if unsuccessful.
"""
function norm_equation(K::AnticNumberField, a)
@@ -52,15 +52,15 @@ For a fmpz $a$, try to find $T \in K$ s.th. $N(T) = a$
holds. If successful, return true and $T$, otherwise false and some element.
In \testtt{extra} one can pass in additional prime numbers that
are allowed to occur in the solution. This will then be supplemented.
-The element will be returned in factored form.
+The element will be returned in factored form.
"""
function isnorm(K::AnticNumberField, a::fmpz; extra::Vector{fmpz}=fmpz[])
L = lll(maximal_order(K))
- C, mC = narrow_class_group(L)
+ C, mC = narrow_class_group(L)
# println("narrow group is : $C")
S = union(Set(keys(factor(a).fac)), Set(keys(factor(discriminant(L)).fac)))
S = union(S, Set(extra))
-
+
g = Set(elem_type(C)[])
for p = S
P = prime_ideals_over(L, typeof(p)[p])
diff --git a/src/NumFieldOrd/NumFieldOrdElem.jl b/src/NumFieldOrd/NumFieldOrdElem.jl
index b7ca93e1c6..207a636915 100644
--- a/src/NumFieldOrd/NumFieldOrdElem.jl
+++ b/src/NumFieldOrd/NumFieldOrdElem.jl
@@ -312,7 +312,7 @@ end
@doc Markdown.doc"""
absolute_tr(a::NumFieldOrdElem) -> fmpz
-Return the absolute trace as an integer.
+Return the absolute trace as an integer.
"""
absolute_tr(a::NfAbsOrdElem) = tr(a)
absolute_tr(a::NfRelOrdElem) = absolute_tr(tr(a))
@@ -324,7 +324,7 @@ absolute_tr(a::NfRelOrdElem) = absolute_tr(tr(a))
################################################################################
@doc Markdown.doc"""
- norm(a::NumFieldOrdElem)
+ norm(a::NumFieldOrdElem)
Returns the norm of $a$ as an element in the base ring.
"""
@@ -336,7 +336,7 @@ end
@doc Markdown.doc"""
absolute_norm(a::NumFieldOrdElem) -> fmpz
-Return the absolute norm as an integer.
+Return the absolute norm as an integer.
"""
absolute_norm(a::NfAbsOrdElem) = norm(a)
absolute_norm(a::NfRelOrdElem) = absolute_norm(norm(a))
diff --git a/src/NumFieldOrd/NumFieldOrdIdl.jl b/src/NumFieldOrd/NumFieldOrdIdl.jl
index 22a83e7eb0..26c3baf8db 100644
--- a/src/NumFieldOrd/NumFieldOrdIdl.jl
+++ b/src/NumFieldOrd/NumFieldOrdIdl.jl
@@ -162,7 +162,7 @@ function uniformizer(P::NfAbsOrdIdl)
if isdefined(P, :gens_normal) && P.gens_normal == p
return P.gen_two
elseif isone(ramification_index(P))
- return order(P)(p)
+ return order(P)(p)
else
if p > 250
r = 500 # should still have enough elements...
@@ -358,7 +358,7 @@ function isintegral(I::NfOrdFracIdl)
return denominator(I) == 1
end
-function isintegral(a::NfRelOrdFracIdl)
+function isintegral(a::NfRelOrdFracIdl)
@assert ismaximal(order(a))
return defines_ideal(order(a), basis_pmatrix(a, copy = false))
end
diff --git a/src/QuadForm/Enumeration.jl b/src/QuadForm/Enumeration.jl
index 33ca70e15c..bcffb76029 100644
--- a/src/QuadForm/Enumeration.jl
+++ b/src/QuadForm/Enumeration.jl
@@ -47,7 +47,7 @@ function __pseudo_cholesky!(C::fmpq_mat, G)
C[i, j] = G[i, j]
end
end
- for i = 1:limit-1
+ for i = 1:limit-1
for j = i+1:limit
C[j, i] = deepcopy(C[i, j])
C[i, j] = divexact(C[i, j], C[i, i])
@@ -82,7 +82,7 @@ function __pseudo_cholesky!(C::Matrix{fmpq}, G)
C[i, j] = G[i, j]
end
end
- for i = 1:limit-1
+ for i = 1:limit-1
for j = i+1:limit
C[j, i] = _deepcopy_cheap(C[i, j])
#C[i, j] = divexact(C[i, j], C[i, i])
@@ -144,7 +144,7 @@ function __enumerate_gram(G::fmpz_mat, l::Union{Nothing, Int}, c::Int)
@hassert :Lattice 1 length(__enumerate_gram(G, l, c, Rational{Int128})) == length(res)
else
@vprint :Lattice 1 "Enumerating using fmpq\n"
- res = __enumerate_cholesky(Q, c)
+ res = __enumerate_cholesky(Q, c)
end
@hassert :Lattice 1 length(__enumerate_gram(G, l, c, fmpq)) == length(res)
return res
@@ -208,7 +208,7 @@ function __enumerate_cholesky(Q::Matrix{fmpq}, l::Union{Int, fmpz, Nothing}, c::
#_t = isqrt(FlintZZ(floor(divexact(T[i], Q[i, i]))))
#_new_upp = Int(FlintZZ(ceil(_t + 2 - U[i])))
#_new_low = Int(FlintZZ(floor(-(_t + 2) - U[i]))) - 1
-
+
@inbounds _new_upp, _new_low = _compute_bounds(T[i], Qd[i], U[i], t1, t2, t3, t4, t5)
@inbounds x[i] = _new_low
@@ -231,7 +231,7 @@ function __enumerate_cholesky(Q::Matrix{fmpq}, l::Union{Int, fmpz, Nothing}, c::
i = i - 1
#U[i] = sum(Q[i, j] * x[j] for j in (i + 1):n)
update_U!(U, Q, i, n, x, t1, t2)
- @goto compute_bounds
+ @goto compute_bounds
end
end
@@ -323,14 +323,14 @@ function __enumerate_cholesky(Q::Matrix{S}, l::Union{Int, Nothing}, c::Int) wher
#_t = isqrt(FlintZZ(floor(divexact(T[i], Q[i, i]))))
#_new_upp = Int(FlintZZ(ceil(_t + 2 - U[i])))
#_new_low = Int(FlintZZ(floor(-(_t + 2) - U[i]))) - 1
-
+
_new_upp, _new_low = @inbounds _compute_bounds(T[i], Qd[i], U[i])
@inbounds x[i] = _new_low
@inbounds L[i] = _new_upp
@label main_loop
-
+
@inbounds x[i] = x[i] + 1
@inbounds if x[i] > L[i]
@@ -347,7 +347,7 @@ function __enumerate_cholesky(Q::Matrix{S}, l::Union{Int, Nothing}, c::Int) wher
#U[i] = sum(Q[i, j] * x[j] for j in (i + 1):n)
update_U!(U, Q, i, n, x)
- @goto compute_bounds
+ @goto compute_bounds
end
end
diff --git a/src/QuadForm/Herm/Genus.jl b/src/QuadForm/Herm/Genus.jl
index 5d45f2a2df..c5adebe027 100644
--- a/src/QuadForm/Herm/Genus.jl
+++ b/src/QuadForm/Herm/Genus.jl
@@ -1500,7 +1500,7 @@ function genus_generators(L::HermLat)
E = nf(R)
D = different(R)
b, P0, bad = smallest_neighbour_prime(L)
-
+
local bad_prod::ideal_type(base_ring(R))
if isempty(bad)
diff --git a/src/QuadForm/Herm/GenusRep.jl b/src/QuadForm/Herm/GenusRep.jl
index ebb3e61fbe..5d02a5144d 100644
--- a/src/QuadForm/Herm/GenusRep.jl
+++ b/src/QuadForm/Herm/GenusRep.jl
@@ -98,7 +98,7 @@ function genus_representatives(L::HermLat; max = inf, use_auto::Bool = true,
missing_mass = Ref(mass)
local result::Vector{typeof(L)}
-
+
if definite
result = typeof(L)[]
for L in LL
@@ -291,7 +291,7 @@ function neighbour(L, B, xG, x, h, P, CC, split)
local C::ideal_type(R)
- if CC isa Int
+ if CC isa Int
C = split ? involution(L)(P) : P
else
C = CC
@@ -353,7 +353,7 @@ function iterated_neighbours(L::HermLat, P; use_auto = false, max = inf,
#require IsModular(L, P) : "The lattice must be locally modular";
#require Rank(L) ge 2: "The rank of the lattice must be at least 2";
#require IsIsotropic(L, P): "The lattice must be locally isotropic";
-
+
if callback == false && isdefinite(L)
_callback = stdcallback
else
@@ -377,7 +377,7 @@ function iterated_neighbours(L::HermLat, P; use_auto = false, max = inf,
no_lattices = length(result) - oldlength
oldlength = length(result)
if use_mass && no_lattices > 0
- _mass = _mass - sum(fmpq[1//automorphism_group_order(result[i]) for i in (length(result) - no_lattices + 1):length(result)])
+ _mass = _mass - sum(fmpq[1//automorphism_group_order(result[i]) for i in (length(result) - no_lattices + 1):length(result)])
if iszero(_mass)
break
end
diff --git a/src/QuadForm/Herm/LocallyIsometricSublattice.jl b/src/QuadForm/Herm/LocallyIsometricSublattice.jl
index efc7fab0a0..0e9d8a4e4d 100644
--- a/src/QuadForm/Herm/LocallyIsometricSublattice.jl
+++ b/src/QuadForm/Herm/LocallyIsometricSublattice.jl
@@ -261,7 +261,7 @@ function _locally_isometric_sublattice_even_ramified(M, L, p, P, absolute_map)
KM = map_entries(x -> E(h\x), _KM)
_new_pmat = _sum_modules(pseudo_matrix(KM * BBM), pM)
LL = lattice(ambient_space(M), _new_pmat)
-
+
if islocally_isometric(X, LL, p)
break
end
@@ -287,7 +287,7 @@ function locally_isometric_sublattice(M::HermLat, L::HermLat, p)
absolute_map = absolute_simple_field(ambient_space(M))[2]
P = D[1][1]
-
+
if length(D) == 2 # split case
LL = _locally_isometric_sublattice_split(M, L, p, P, absolute_map)
elseif length(D) == 1 && D[1][2] == 1 # inert case
diff --git a/src/QuadForm/Herm/Mass.jl b/src/QuadForm/Herm/Mass.jl
index dd3968ccfc..c066fcea57 100644
--- a/src/QuadForm/Herm/Mass.jl
+++ b/src/QuadForm/Herm/Mass.jl
@@ -62,7 +62,7 @@ function _local_factor_dyadic(L::HermLat, p)
t = iseven(e) ? k1 : k0
return (q^t + 1) * lf
end
-
+
if !b
if iseven(e)
return q^(m * (f2 - l) - k1) * (q^m1 - 1) * lf
@@ -221,7 +221,7 @@ function local_factor(L::HermLat, p)
if length(s) == 1 && !ram
return fmpq(1)
end
-
+
m = rank(L)
local f::fmpq
if ram
@@ -279,7 +279,7 @@ function _standard_mass(L::HermLat, prec::Int = 10)
RR = ArbField(wprec, cached = false)
_stdmass = RR(stdmass)
-
+
local relzeta::arb
while true
diff --git a/src/QuadForm/Lattices.jl b/src/QuadForm/Lattices.jl
index e542a5d184..9018cc68e3 100644
--- a/src/QuadForm/Lattices.jl
+++ b/src/QuadForm/Lattices.jl
@@ -877,7 +877,7 @@ function assert_has_automorphisms(L::AbsLat{<: NumField}; redo::Bool = false)
end
# Create the automorphism context and compute generators as well as orders
-
+
C = ZLatAutoCtx(ZgramL)
fl, Csmall = try_init_small(C)
if fl
@@ -962,7 +962,7 @@ end
@doc Markdown.doc"""
automorphism_group_generators(L::AbsLat; ambient_representation = true)
-Given a definite lattice $L$ returns generators for the automorphism group of $L$.
+Given a definite lattice $L$ returns generators for the automorphism group of $L$.
If `ambient_representation` is `true` (the default), the transformations are represented
with respect to the ambient space of $L$. Otherwise, the transformations are represented
with respect to the (pseudo-)basis of $L$.
@@ -1092,7 +1092,7 @@ function isisometric(L::AbsLat{<: NumField}, M::AbsLat{<: NumField};
fl, s1 = can_solve_with_solution(BabsmatL, basis_matrix_of_rational_span(L), side = :left)
fl, s2 = can_solve_with_solution(basis_matrix_of_rational_span(M), BabsmatM, side = :left)
T = s1 * change_base_ring(E, T) * s2
- @hassert :Lattice 1 T * gram_matrix(rational_span(M)) *
+ @hassert :Lattice 1 T * gram_matrix(rational_span(M)) *
_map(transpose(T), involution(L)) ==
gram_matrix(rational_span(L))
if !ambient_representation
@@ -1120,7 +1120,7 @@ end
function maximal_sublattices(L::AbsLat, p; use_auto::Bool = false,
callback = false, max = inf)
@req base_ring(L) == order(p) "asdsd"
-
+
B = local_basis_matrix(L, p, type = :submodule)
n = nrows(B)
R = base_ring(L)
diff --git a/src/QuadForm/LineOrbits.jl b/src/QuadForm/LineOrbits.jl
index cf7db5ee2e..e7f9a3ba6b 100644
--- a/src/QuadForm/LineOrbits.jl
+++ b/src/QuadForm/LineOrbits.jl
@@ -337,7 +337,7 @@ function _line_orbits(G::Vector)
end
res = Tuple{eltype(P), Int}[]
-
+
visited = trues(l)
sofar = zero(BigInt)
newline = zero_matrix(K, 1, n)
@@ -346,7 +346,7 @@ function _line_orbits(G::Vector)
# temporary variables in some cases
while sofar < l
pt = findfirst(visited)
- @assert pt !== nothing
+ @assert pt !== nothing
visited[pt] = false
norb = 1
cnd = 1
@@ -407,13 +407,13 @@ function _normalize!(x::gfp_mat)
el = x[1, j]
if !iszero(el)
piv = j
- ell = inv(el)
+ ell = inv(el)
break
end
end
@assert piv != 0
-
+
for j in (piv+1):ncols(x)
el = x[j] * ell
Nemo.setindex_raw!(x, el.data, 1, j)
@@ -465,13 +465,13 @@ function _normalize!(x::MatElem{gfp_fmpz_elem})
el = x[1, j]
if !iszero(el)
piv = j
- ell = inv(el)
+ ell = inv(el)
break
end
end
@assert piv != 0
-
+
for j in (piv+1):ncols(x)
t = x[1, j]
mul!(t, t, ell)
@@ -560,7 +560,7 @@ function _normalize!(x::fq_nmod_mat)
end
@assert piv != 0
-
+
for j in (piv+1):ncols(x)
el = ccall((:fq_nmod_mat_entry, libflint), Ptr{fq_nmod},
(Ref{fq_nmod_mat}, Int, Int), x, 0, j - 1)
@@ -692,7 +692,7 @@ function _normalize!(x::fq_mat)
end
@assert piv != 0
-
+
for j in (piv+1):ncols(x)
el = ccall((:fq_mat_entry, libflint), Ptr{fq},
(Ref{fq_mat}, Int, Int), x, 0, j - 1)
diff --git a/src/QuadForm/Misc.jl b/src/QuadForm/Misc.jl
index c49321c645..e62fb34172 100644
--- a/src/QuadForm/Misc.jl
+++ b/src/QuadForm/Misc.jl
@@ -133,7 +133,7 @@ function _find_special_class(u, p)
K = nf(R)
@assert valuation(u, p) == 0
k, _h = ResidueField(R, p)
- h = extend(_h, K)
+ h = extend(_h, K)
fl, s = issquare_with_sqrt(h(u))
@assert fl
u = divexact(u, (h\s)^2)
@@ -141,16 +141,16 @@ function _find_special_class(u, p)
e = valuation(2, p)
pi = elem_in_nf(uniformizer(p))
val = isone(u) ? inf : valuation(u - 1, p)
- while val < 2 * e
+ while val < 2 * e
if isodd(val)
return u
end
fl, s = issquare_with_sqrt(h((u - 1)//pi^val))
- @assert fl
+ @assert fl
# TODO:FIXME the div is wrong for negative valuations I think
@assert val >= 0
u = divexact(u, (1 + (h\s) * pi^(div(val, 2)))^2)
- val = valuation(u - 1, p)
+ val = valuation(u - 1, p)
end
kt, t = PolynomialRing(k, "t", cached = false)
return val == 2 * e && isirreducible(kt([h(divexact(u - 1, 4)), one(k), one(k)])) ? u : one(K)
@@ -320,7 +320,7 @@ function _idempotents(x::Vector)
#println("V:\n", sprint(show, "text/plain", V))
m = lcm(fmpz[minimum(x[i], copy = false) for i in 1:length(x)])
-
+
H = hnf_modular_eldiv!(V, m) # upper right
for i in 2:(1 + d)
@@ -676,7 +676,7 @@ end
################################################################################
#
-# Treat FlintQQ as a number field
+# Treat FlintQQ as a number field
#
################################################################################
diff --git a/src/QuadForm/Morphism.jl b/src/QuadForm/Morphism.jl
index d7c24c4722..b6faee383f 100644
--- a/src/QuadForm/Morphism.jl
+++ b/src/QuadForm/Morphism.jl
@@ -198,7 +198,7 @@ mutable struct ZLatAutoCtx{S, T, V}
for i in 1:length(z.G)
z.issymmetric[i] = issymmetric(z.G[i])
end
-
+
return z
end
@@ -228,7 +228,7 @@ function init(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1), use_dic
# Compute the necessary short vectors
r = length(C.G)
-
+
n = nrows(C.G[1])
if bound == -1
@@ -240,7 +240,7 @@ function init(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1), use_dic
@vprint :Lattice 1 "Computing short vectors of length $bound\n"
- @vtime :Lattice 1 V = _short_vectors_gram_integral(C.G[1], bound)
+ @vtime :Lattice 1 V = _short_vectors_gram_integral(C.G[1], bound)
vectors = Vector{fmpz_mat}(undef, length(V))
@@ -257,7 +257,7 @@ function init(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1), use_dic
k += 1
end
if v[k] < 0
- v .*= -1
+ v .*= -1
end
vfmpz = matrix(FlintZZ, 1, n, v)
@@ -296,12 +296,12 @@ function init(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1), use_dic
for i in 1:dim(C)
z[1, C.per[i]] = 1
k = find_point(z, C.V)
- C.std_basis[i] = k
+ C.std_basis[i] = k
z[1, C.per[i]] = 0
end
end
- #
+ #
C.v = Vector{fmpz_mat}(undef, length(C.G))
@@ -338,7 +338,7 @@ function init(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1), use_dic
C.ng[1] = 1
# Calculate orbit lengths
-
+
nH = 0
for i in 1:dim(C)
@@ -385,7 +385,7 @@ function try_init_small(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1
end
@assert bound > 0
- @vtime :Lattice 1 V = _short_vectors_gram_integral(C.G[1], bound)
+ @vtime :Lattice 1 V = _short_vectors_gram_integral(C.G[1], bound)
vectors = Vector{Vector{Int}}(undef, length(V))
@@ -426,7 +426,7 @@ function try_init_small(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1
end
if v[k] < 0
- v .*= -1
+ v .*= -1
end
if vectors_nbits > abs_maxbits_vectors
@@ -454,7 +454,7 @@ function try_init_small(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1
end
V = VectorList(vectors, lengths, use_dict)
-
+
Csmall.V = V
@@ -482,12 +482,12 @@ function try_init_small(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1
for i in 1:dim(Csmall)
z[Csmall.per[i]] = 1
k = find_point(z, V)
- Csmall.std_basis[i] = k
+ Csmall.std_basis[i] = k
z[Csmall.per[i]] = 0
end
end
- #
+ #
Csmall.v = Vector{Matrix{Int}}(undef, length(C.G))
@@ -529,7 +529,7 @@ function try_init_small(C::ZLatAutoCtx, auto::Bool = true, bound::fmpz = fmpz(-1
Csmall.ng[1] = 1
# Calculate orbit lengths
-
+
nH = 0
for i in 1:dim(Csmall)
@@ -576,7 +576,7 @@ end
# vector sums */
# scpvecs(&comb[i].list, &sumveclist, i, fp.e, flags.DEPTH, V, F);
#/* compute a basis for the lattice that is generated by the vector sums and
-# a transformation matrix that expresses the basis in terms of the
+# a transformation matrix that expresses the basis in terms of the
# vector sums */
# base(&comb[i], &sumvecbase, sumveclist, F.A[0], dim);
# if (flags.PRINT == 1)
@@ -683,11 +683,11 @@ function compute_short_vectors(C::ZLatAutoCtx, max::fmpz = fmpz(-1))
for k in 2:length(C.G)
z[k] = (m * C.G[k] * mt)[1, 1]
end
- C.V[i] = m
+ C.V[i] = m
C.V_length[i] = z
end
#@show length(C.V)
- C.max = max
+ C.max = max
return C
end
@@ -762,7 +762,7 @@ function possible(V, W, F, Ftr, _issymmetric, n, f, per, I, J)
end
# length is correct
-
+
good_scalar = true
@inbounds for k in 1:f
@@ -810,10 +810,10 @@ end
# for j from per[i] to per[dim-1] the
# value f[i][j] in the fingerprint f is
# the number of vectors, which have the
-# same scalar product with the
-# basis-vectors per[0]...per[i-1] as the
-# basis-vector j and the same length as
-# this vector with respect to all
+# same scalar product with the
+# basis-vectors per[0]...per[i-1] as the
+# basis-vector j and the same length as
+# this vector with respect to all
# invariant forms
function fingerprint(C::ZLatAutoCtx)
@@ -856,7 +856,7 @@ function fingerprint(C::ZLatAutoCtx)
per[mini], per[i] = per[i], per[mini]
- # Set entries below the minimal entry to zero
+ # Set entries below the minimal entry to zero
for j in (i + 1):n
fp[j, per[i]] = 0
end
@@ -931,7 +931,7 @@ Base.replace!(::typeof(-), m::fmpz_mat) = -m
function _operate(point, A, V, tmp)
# V.v is a sorted list of length V.n of vectors
# of dimension V.dim, the number of V.v[nr]*A in
-# the list is returned, where a negative number
+# the list is returned, where a negative number
# indicates the negative of a vector
tmp = _vec_times_matrix!(tmp, V[point], A)
#w = V[abs(point)] * A
@@ -1012,7 +1012,7 @@ function _orbitlen_naive(point::Int, orblen::Int, G::Vector{fmpz_mat}, nG::Int,
while !isempty(working_list)
current_point = pop!(working_list)
for i in 1:nG
- if current_point < 0
+ if current_point < 0
new_point_coord = -V[abs(current_point)] * G[i]
else
new_point_coord = V[current_point] * G[i]
@@ -1152,7 +1152,7 @@ function auto(C::ZLatAutoCtx{S, T, U}) where {S, T, U}
end
end
if step == sta
- # test, whether on step flags.STAB some generators may be omitted
+ # test, whether on step flags.STAB some generators may be omitted
tries = C.nsg[step]
while tries <= C.ng[step]
#for tries in C.nsg[step]:C.ng[step]
@@ -1193,7 +1193,7 @@ end
function _get_generators(C::ZLatAutoCtx{S, T, U}) where {S, T, U}
# Extract generators
-
+
gens = T[]
orde = prod(fmpz.(C.orders))
@@ -1289,13 +1289,13 @@ function cand(candidates, I, x, C::ZLatAutoCtx{S, T, U}, comb) where {S, T, U}
#@show C.V[j]
for i in 1:length(C.G)
_issym = C.issymmetric[i]
- CAiI = C.G[i][C.per[I]]
+ CAiI = C.G[i][C.per[I]]
Cvi = C.v[i]
#@show Cvi
-
+
# vec is the vector of scalar products of V.v[j] with the first I base vectors
- # x[1]...x[I]
-
+ # x[1]...x[I]
+
for k in 1:(I - 1)
#@show x[k]
xk = x[k]
@@ -1515,17 +1515,17 @@ end
function stab(I, C::ZLatAutoCtx{SS, T, U}) where {SS, T, U}
V = C.V
-# computes the orbit of fp.e[I] under the
-# generators in G->g[I]...G->g[n-1] and elements
+# computes the orbit of fp.e[I] under the
+# generators in G->g[I]...G->g[n-1] and elements
# stabilizing fp.e[I],
# has some heuristic break conditions,
-# the generators in G->g[i] stabilize
-# fp.e[0]...fp.e[i-1] but not fp.e[i],
+# the generators in G->g[i] stabilize
+# fp.e[0]...fp.e[i-1] but not fp.e[i],
# G->ng[i] is the number of generators in G->g[i],
# the first G->nsg[i] of which are elements which
-# are obtained as stabilizer elements in
+# are obtained as stabilizer elements in
# g[0],...,G->g[i-1]>, G->ord[i] is the orbit
-# length of fp.e[i] under
+# length of fp.e[i] under
# g[i],...,G->g[n-1]> *****/
#group *G;
#fpstruct fp;
@@ -1538,8 +1538,8 @@ function stab(I, C::ZLatAutoCtx{SS, T, U}) where {SS, T, U}
#
#/* some heuristic break conditions for the computation of stabilizer elements:
# it would be too expensive to calculate all the stabilizer generators, which
-# are obtained from the orbit, since this is highly redundant,
-# on the other hand every new generator which enlarges the group is much
+# are obtained from the orbit, since this is highly redundant,
+# on the other hand every new generator which enlarges the group is much
# cheaper than one obtained from the backtrack,
# after Maxfail subsequent stabilizer elements, that do not enlarge the group,
# Rest more elements are calculated even if they leave the group unchanged,
@@ -1563,7 +1563,7 @@ function stab(I, C::ZLatAutoCtx{SS, T, U}) where {SS, T, U}
Maxfail += 1
end
end
-
+
nH = 0
for i in I:dim
nH += C.ng[i]
@@ -1609,7 +1609,7 @@ function stab(I, C::ZLatAutoCtx{SS, T, U}) where {SS, T, U}
if fail >= Maxfail
#/* there have already been Maxfail successive failures, now a random generator
- # is applied to a random point of the orbit to get Rest more stabilizer
+ # is applied to a random point of the orbit to get Rest more stabilizer
# elements */
cnd = rand(1:len)
i = rand(1:nH)
@@ -1673,7 +1673,7 @@ function stab(I, C::ZLatAutoCtx{SS, T, U}) where {SS, T, U}
end
resize!(Hj, nH + 1)
#/* the new generator is appended to H */
-#/* the number of failures is reset to 0 */
+#/* the number of failures is reset to 0 */
else
#/* the new stabilizer element S does not enlarge the orbit of e[j] */
fail += 1
@@ -1709,7 +1709,7 @@ function stabil(x1, x2, per, G, V, C)
XG = matgen(x, dim, per, V)
X2 = matgen(x2, dim, per, V)
-
+
b, S = can_solve_with_solution(X2, XG, side = :left)
return S
end
@@ -1729,7 +1729,7 @@ function stabil(x1, x2, per, G::Matrix{Int}, V, C)
SS = zeros(Int, dim, dim)
_psolve(SS, X2, XG, dim, C.prime)
@hassert :Lattice 1 SS * X22 == XGG
-
+
return SS
end
@@ -1739,7 +1739,7 @@ zero_matrix(Int, r, c) = zeros(Int, r, c)
base_ring(::Vector{Int}) = Int
-function _one(::Type{Matrix{Int}}, n::Int)
+function _one(::Type{Matrix{Int}}, n::Int)
z = zeros(Int, n, n)
for i in 1:n
z[i, i] = 1
@@ -1755,7 +1755,7 @@ _zero(::Type{fmpz_mat}, n::Int, m::Int) = zero_matrix(FlintZZ, n, m)
function matgen(x, dim, per, v)
#/***** generates the matrix X which has as row
-# per[i] the vector nr. x[i] from the
+# per[i] the vector nr. x[i] from the
# list v *****
X = zero_matrix(base_ring(v[1]), dim, dim)
#@show x
@@ -1884,15 +1884,15 @@ function iso(step, x, C, Ci, Co, G)
end
function isostab(pt, G, C::ZLatAutoCtx{S, T, U}, Maxfail) where {S, T, U}
-# computes the orbit of V.v[pt]
-# under the generators
+# computes the orbit of V.v[pt]
+# under the generators
# G[0],...,G[nG-1] and elements
-# stabilizing V.v[pt], which are
+# stabilizing V.v[pt], which are
# stored in H, returns the number
# of generators in H
# a heuristic break condition for the computation of stabilizer elements:
# it would be too expensive to calculate all the stabilizer generators, which
-# are obtained from the orbit, since this is highly redundant,
+# are obtained from the orbit, since this is highly redundant,
# on the other hand every new generator which enlarges the group reduces the
# number of orbits and hence the number of candidates to be tested,
# after Maxfail subsequent stabilizer elements, that do not enlarge the group,
@@ -2019,7 +2019,7 @@ function isocand(CI, I, x, Ci::ZLatAutoCtx{S, T, U}, Co) where {S, T, U}
end
good = true
for k in 1:(I - 1)
- if vec[k] != Ci.G[i][Ci.per[I], Ci.per[k]] || vec2[k] != Ci.G[i][Ci.per[k], Ci.per[I]]
+ if vec[k] != Ci.G[i][Ci.per[I], Ci.per[k]] || vec2[k] != Ci.G[i][Ci.per[k], Ci.per[I]]
good = false
break
end
@@ -2029,7 +2029,7 @@ function isocand(CI, I, x, Ci::ZLatAutoCtx{S, T, U}, Co) where {S, T, U}
end
good = true
for k in 1:(I - 1)
- if vec[k] != -Ci.G[i][Ci.per[I], Ci.per[k]] || vec2[k] != -Ci.G[i][Ci.per[k], Ci.per[I]]
+ if vec[k] != -Ci.G[i][Ci.per[I], Ci.per[k]] || vec2[k] != -Ci.G[i][Ci.per[k], Ci.per[I]]
good = false
break
diff --git a/src/QuadForm/Quad/Lattices.jl b/src/QuadForm/Quad/Lattices.jl
index 91a1595b11..4d2580ef6a 100644
--- a/src/QuadForm/Quad/Lattices.jl
+++ b/src/QuadForm/Quad/Lattices.jl
@@ -475,7 +475,7 @@ function ismaximal_integral(L::QuadLat, p)
for x in PP
@assert !iszero(x)
xV = matrix(k, 1, length(x), x) * V
- e = elem_type(K)[ hext\(xV[1, i]) for i in 1:ncols(xV) ]
+ e = elem_type(K)[ hext\(xV[1, i]) for i in 1:ncols(xV) ]
v = matrix(K, 1, length(e), e)
_z = (v * G * transpose(v))[1, 1]
# Test if valv >= val2 + 2
@@ -575,7 +575,7 @@ function maximal_integral_lattice(V::QuadSpace)
n = norm(L)
@assert isintegral(n)
end
-
+
return maximal_integral_lattice(L)
end
diff --git a/src/QuadForm/Quad/NormalForm.jl b/src/QuadForm/Quad/NormalForm.jl
index 9526845069..87fadcbacd 100644
--- a/src/QuadForm/Quad/NormalForm.jl
+++ b/src/QuadForm/Quad/NormalForm.jl
@@ -138,7 +138,7 @@ end
Return the normal `D` and the transformation `T` to the `p`-adic normal form of
the symmetric matrix `G`, such that `d * D = d * B * G * B'` holds modulo `p^prec`.
-If `prec == -1`,
+If `prec == -1`,
Let `p` be odd and `u` be the smallest non-square modulo `p`. The normal form
is a block diagonal matrix with blocks `p^k G_k` such that `G_k` is either the
@@ -1087,7 +1087,7 @@ function _normalize_twobytwo(G, p)
D = B * G * B'
end
@assert _val(D[2, 2], p) == 1
-
+
if mod(lift(det(D)), 8) == 3
# # in this case we can transform D to
# # 2 1
diff --git a/src/QuadForm/Quad/Spaces.jl b/src/QuadForm/Quad/Spaces.jl
index 06f9df68cf..eaf01cf127 100644
--- a/src/QuadForm/Quad/Spaces.jl
+++ b/src/QuadForm/Quad/Spaces.jl
@@ -1449,7 +1449,7 @@ function _isisotropic_with_vector(F::MatrixElem)
if _isisotropic(D[3:5], p)
continue
end
-
+
local x::elem_type(K)
local y::elem_type(K)
diff --git a/src/QuadForm/QuadBin.jl b/src/QuadForm/QuadBin.jl
index 7fbc272ebe..1c22b39ed6 100644
--- a/src/QuadForm/QuadBin.jl
+++ b/src/QuadForm/QuadBin.jl
@@ -465,7 +465,7 @@ function isequivalent(f::QuadBin{fmpz}, g::QuadBin{fmpz}; proper::Bool = true)
if proper || is_prop
return is_prop
end
-
+
# note that our definition of improper equivalence
# differs from that of Buchmann and Vollmer
# their action is det f * q(f(x,y))
@@ -495,7 +495,7 @@ function isequivalent(f::QuadBin{fmpz}, g::QuadBin{fmpz}; proper::Bool = true)
f1 = reduction(binary_quadratic_form(f[3], f[2], f[1]))
return f1 == gred
end
-
+
return false
end
end
@@ -505,7 +505,7 @@ function _isequivalent_reducible(f::QuadBin{fmpz}, g::QuadBin{fmpz}; proper = tr
return false
end
- c = content(f)
+ c = content(f)
if content(g) != c
return false
end
diff --git a/src/QuadForm/Spaces.jl b/src/QuadForm/Spaces.jl
index 259c51602d..2b3f72a25a 100644
--- a/src/QuadForm/Spaces.jl
+++ b/src/QuadForm/Spaces.jl
@@ -487,7 +487,7 @@ end
#
################################################################################
-# TODO: Use absolute_coordinates
+# TODO: Use absolute_coordinates
function restrict_scalars(V::AbsSpace, K::FlintRationalField,
alpha = one(base_ring(V)))
E = base_ring(V)
diff --git a/src/QuadForm/Torsion.jl b/src/QuadForm/Torsion.jl
index 817461aa29..c7fcb6cbc1 100644
--- a/src/QuadForm/Torsion.jl
+++ b/src/QuadForm/Torsion.jl
@@ -728,8 +728,8 @@ EXAMPLES::
julia> brown_invariant(T)
4
"""
-function brown_invariant(T::TorQuadMod)
- @req T.modulus_qf == 2 "the torsion quadratic form must have values in Q/2Z"
+function brown_invariant(T::TorQuadMod)
+ @req T.modulus_qf == 2 "the torsion quadratic form must have values in Q/2Z"
brown = ResidueRing(ZZ, 8)(0)
for p in prime_divisors(exponent(T))
q = normal_form(primary_part(T, p)[1])[1]
@@ -744,7 +744,7 @@ end
@doc Markdown.doc"""
genus(T::TorQuadMod, signature_pair::Tuple{Int, Int}) -> ZGenus
-
+
Return the genus defined by a TorQuadMod T and the ``signature_pair``.
If no such genus exists, raise a ``ErrorException``.
diff --git a/src/RCF/Types.jl b/src/RCF/Types.jl
index 4558ef8a10..1f757ed8ff 100644
--- a/src/RCF/Types.jl
+++ b/src/RCF/Types.jl
@@ -95,7 +95,7 @@ mutable struct RCFCharacter{S, T}
mrcond::Union{MapClassGrp, MapRayClassGrp}
mp_cond::GrpAbFinGenMap
charcond::Map #Character directly on the rcf given by the conductor
-
+
function RCFCharacter(C::ClassField{S, T}, x::GrpAbFinGenElem, mGhat::Map) where {S, T}
z = new{S, T}()
z.C = C
diff --git a/src/RCF/autos.jl b/src/RCF/autos.jl
index 53e1ec484a..b5a34fefde 100644
--- a/src/RCF/autos.jl
+++ b/src/RCF/autos.jl
@@ -182,25 +182,25 @@ Given a cyclotomic extension $C$ of a number field $K$ and an automorphism $\tau
computes an extension of $\tau$ to $C$.
"""
-function extend_to_cyclotomic(C::CyclotomicExt, tau::NfToNfMor)
- K = domain(tau)
+function extend_to_cyclotomic(C::CyclotomicExt, tau::NfToNfMor)
+ K = domain(tau)
@assert K == base_field(C.Kr)
gKr = gen(C.Kr)
if euler_phi(C.n) == degree(C.Kr)
#The extension with the roots of unity is disjoint from K
#Therefore, the minimal polynomial has coefficient over QQ.
return hom(C.Kr, C.Kr, tau, gKr)
- end
- g = C.Kr.pol
- tau_g = parent(g)([tau(coeff(g, i)) for i=0:degree(g)])
- i = 1
- z = deepcopy(gKr)
- while gcd(i, C.n) != 1 || !iszero(tau_g(z))
- i += 1
- mul!(z, z, gKr)
- end
- return hom(C.Kr, C.Kr, tau, z)
-
+ end
+ g = C.Kr.pol
+ tau_g = parent(g)([tau(coeff(g, i)) for i=0:degree(g)])
+ i = 1
+ z = deepcopy(gKr)
+ while gcd(i, C.n) != 1 || !iszero(tau_g(z))
+ i += 1
+ mul!(z, z, gKr)
+ end
+ return hom(C.Kr, C.Kr, tau, z)
+
end
function new_extend_aut(A::ClassField, auto::T) where T <: Map
@@ -473,11 +473,11 @@ function extend_aut_pp(A::ClassField, autos::Vector{NfToNfMor}, p::fmpz)
if d == 2
return extend_aut2(A, autos)
end
-
+
m = minimum(defining_modulus(A)[1])
ind_image = 1
if !isone(gcd(d, m)) && d != minimum(degree(x) for x in Cp)
- #Difficult case. First, we check that the extension and
+ #Difficult case. First, we check that the extension and
#the cyclotomic extension are disjoint
ind_image = check_disjoint_cyclotomic(A, p)
if !isone(ind_image)
@@ -591,7 +591,7 @@ end
#This function restricts the automorphisms in autos to the number field generated by the class fields in Cp
# incs are the inclusions of the class fields in K
function restriction(K::NfRelNS{nf_elem}, Cp::Vector{ClassField_pp{S, T}}, autos::Vector{NfRelNSToNfRelNSMor_nf_elem}, incs::Vector{NfRelToNfRelNSMor_nf_elem}) where {S, T}
-
+
C = cyclotomic_extension(base_field(Cp[1]), maximum(degree(x) for x in Cp))
#First, I compute the images in K of the generators of the class fields
# and their images under the automorphisms
@@ -1032,7 +1032,7 @@ function extend_autos_hard_case(A::ClassField, autos::Vector{NfToNfMor}, p::fmpz
gens_real_KK = Vector{FacElem{nf_elem, AnticNumberField}}(undef, ngens(S))
for i = 1:ngens(S)
imgSi = mS(S[i])
- gens_real_KK[i] = prod(KK.gens[j]^imgSi[j] for j = 1:ngens(KK))
+ gens_real_KK[i] = prod(KK.gens[j]^imgSi[j] for j = 1:ngens(KK))
end
KK_real = kummer_extension(gens_real_KK, S.snf)
new_act_on_gens = Vector{Vector{FacElem{nf_elem, AnticNumberField}}}(undef, length(KK.gen))
@@ -1046,7 +1046,7 @@ function extend_autos_hard_case(A::ClassField, autos::Vector{NfToNfMor}, p::fmpz
act_on_gen_i[j] = FacElem(D1)
end
new_act_on_gens[i] = act_on_gen_i
- end
+ end
@show find_frob = find_gens(KK_real, new_act_on_gens, minimum(defining_modulus(A)[1]))
error("stop")
AA, gAA = number_field(KK_real)
diff --git a/src/RCF/class_fields.jl b/src/RCF/class_fields.jl
index 682c649286..67f1aa816e 100644
--- a/src/RCF/class_fields.jl
+++ b/src/RCF/class_fields.jl
@@ -320,7 +320,7 @@ end
@doc Markdown.doc"""
prime_decomposition_type(C::ClassField, p::NfAbsOrdIdl) -> (Int, Int, Int)
-For a prime $p$ in the base ring of $r$, determine the splitting type of $p$
+For a prime $p$ in the base ring of $r$, determine the splitting type of $p$
in $r$. ie. the tuple $(e, f, g)$ giving the ramification degree, the inertia
and the number of primes above $p$.
"""
@@ -357,7 +357,7 @@ end
ray_class_field(m::MapRayClassGrp) -> ClassField
Creates the (formal) abelian extension defined by the map $m: A \to I$
-where $I$ is the set of ideals coprime to the modulus defining $m$ and $A$
+where $I$ is the set of ideals coprime to the modulus defining $m$ and $A$
is a quotient of the ray class group (or class group). The map $m$
must be the map returned from a call to {class_group} or {ray_class_group}.
"""
@@ -369,7 +369,7 @@ end
ray_class_field(m::Union{MapClassGrp, MapRayClassGrp}, quomap::GrpAbFinGenMap) -> ClassField
For $m$ a map computed by either {ray_class_group} or {class_group} and
-$q$ a canonical projection (quotient map) as returned by {quo} for q
+$q$ a canonical projection (quotient map) as returned by {quo} for q
quotient of the domain of $m$ and a subgroup of $m$, create the
(formal) abelian extension where the (relative) automorphism group
is canonically isomorphic to the codomain of $q$.
diff --git a/src/RCF/conductor.jl b/src/RCF/conductor.jl
index f0a045dfd0..97c39752d5 100644
--- a/src/RCF/conductor.jl
+++ b/src/RCF/conductor.jl
@@ -473,7 +473,7 @@ function discriminant(C::ClassField)
end
end
-
+
@assert typeof(m) == NfOrdIdl
mR = C.rayclassgroupmap
@@ -652,7 +652,7 @@ function norm_group(f::Nemo.PolyElem, mR::T, isabelian::Bool = true; of_closure:
end
function norm_group(l_pols::Vector{T}, mR::U, isabelian::Bool = true; of_closure::Bool = false, cached::Bool = true, check::Bool = false) where {T <: PolyElem{nf_elem}, U <: Union{MapClassGrp, MapRayClassGrp}}
-
+
R = domain(mR)
O = order(codomain(mR))
K = nf(O)
@@ -666,19 +666,19 @@ function norm_group(l_pols::Vector{T}, mR::U, isabelian::Bool = true; of_closure
#Thus I will check for every prime if the projection has discriminant 0
n = lcm(Int[degree(x) for x = l_pols])
- if of_closure
+ if of_closure
#we cannot work in the quotient, it "could" be lcm(factorial(degree(x)) for x = f)
Q, mQ = quo(R, GrpAbFinGenElem[])
else
Q, mQ = quo(R, n, false)
end
-
+
p = maximum(degree(x)+1 for x = l_pols)
-
- listprimes = GrpAbFinGenElem[]
+
+ listprimes = GrpAbFinGenElem[]
# Adding small primes until it stabilizes
- B = prod(Int[degree(x) for x in l_pols])
+ B = prod(Int[degree(x) for x in l_pols])
max_stable = 50*n
stable = max_stable
denom = lcm([denominator(coeff(x, i)) for x in l_pols for i = 0:degree(x)])
@@ -697,7 +697,7 @@ function norm_group(l_pols::Vector{T}, mR::U, isabelian::Bool = true; of_closure
continue
end
if divides(indexO, fmpz(p))[1]
- continue
+ continue
end
found = false
L = prime_decomposition(O, p, 1)
@@ -707,9 +707,9 @@ function norm_group(l_pols::Vector{T}, mR::U, isabelian::Bool = true; of_closure
continue
end
F, mF = ResidueFieldSmallDegree1(O, L[i][1])
- mFp = extend_easy(mF, K)
+ mFp = extend_easy(mF, K)
all_deg = Vector{Int}[]
- #=
+ #=
the idea, taking 2 polys:
f splits in d_i
g splits in e_i
@@ -747,7 +747,7 @@ function norm_group(l_pols::Vector{T}, mR::U, isabelian::Bool = true; of_closure
Q, mQ = quo(R, listprimes, false)
found = true
stable = max_stable
- end
+ end
end
if !found
stable -= 1
@@ -831,8 +831,8 @@ function norm_group(KK::KummerExt, mp::NfToNfMor, mR::Union{MapRayClassGrp, MapC
zk = order(codomain(mR))
# disc(ZK/Q) = N(disc(ZK/zk)) * disc(zk)^deg
# we need the disc ZK/k, well a conductor.
-
-
+
+
n = degree(KK)
els = GrpAbFinGenElem[]
stable = 0
@@ -990,7 +990,7 @@ end
function factored_modulus(A::ClassField_pp{MapClassGrp, T}) where T
return Dict{NfOrdIdl, Int}()
end
-
+
function maximal_abelian_subfield(A::ClassField, mp::NfToNfMor)
k = domain(mp)
K = codomain(mp)
@@ -1387,7 +1387,7 @@ function Base.intersect(I::NfAbsOrdIdl, R::NfAbsOrd)
@assert fl
return minimum(m, I)
end
-
+
Base.intersect(R::NfAbsOrd, I::NfAbsOrdIdl) = intersect(I, R)
function Base.intersect(I::NfOrdFracIdl, R::NfAbsOrd)
diff --git a/src/RCF/cyclo.jl b/src/RCF/cyclo.jl
index df9b235513..3b8b3b62e2 100644
--- a/src/RCF/cyclo.jl
+++ b/src/RCF/cyclo.jl
@@ -50,7 +50,7 @@ function simplify!(C::CyclotomicExt)
return nothing
end
Ka, mKa = simplified_absolute_field(C.Kr, cached = false)
- Ks, mKs = simplify(Ka, cached = false)
+ Ks, mKs = simplify(Ka, cached = false)
abs2rel = mKs*mKa
imKa = inv(abs2rel)
small2abs = hom(base_field(C.Kr), Ks, imKa(C.Kr(gen(base_field(C.Kr)))))
@@ -194,7 +194,7 @@ function cyclotomic_extension(k::AnticNumberField, n::Int; cached::Bool = true,
Kr, Kr_gen = number_field(fk, "z_$n", cached = false, check = false)
if degree(fk) != 1
Ka, abs2rel, small2abs = collapse_top_layer(Kr, cached = false)
-
+
if compute_maximal_order && !simplified
# An equation order defined from a factor of a
# cyclotomic polynomial is always maximal by Dedekind
diff --git a/src/RCF/kummer_extensions.jl b/src/RCF/kummer_extensions.jl
index 4ae2609f38..158aa2320b 100644
--- a/src/RCF/kummer_extensions.jl
+++ b/src/RCF/kummer_extensions.jl
@@ -289,7 +289,7 @@ end
#
################################################################################
-# In this context, we are computing the Frobenius for conjugate prime ideals
+# In this context, we are computing the Frobenius for conjugate prime ideals
# We save the projection of the factor base, we can reuse them
#Computes a set of prime ideals of the base field of K such that the corresponding Frobenius
#automorphisms generate the automorphism group
@@ -299,10 +299,10 @@ function find_gens(K::KummerExt, S::PrimesSet, cp::fmpz=fmpz(1))
end
k = base_field(K)
ZK = maximal_order(k)
- R = K.AutG
+ R = K.AutG
sR = Vector{GrpAbFinGenElem}(undef, length(K.gen))
lp = Vector{NfOrdIdl}(undef, length(K.gen))
-
+
indZK = index(ZK)
q, mq = quo(R, GrpAbFinGenElem[], false)
s, ms = snf(q)
@@ -326,7 +326,7 @@ function find_gens(K::KummerExt, S::PrimesSet, cp::fmpz=fmpz(1))
for i = 1:length(D)
D[i] = Vector{gfp_poly}(undef, length(K.gen[i].fac))
end
-
+
first = false
for P in LP
try
@@ -342,7 +342,7 @@ function find_gens(K::KummerExt, S::PrimesSet, cp::fmpz=fmpz(1))
if iszero(mq(f))
continue
end
- #At least one of the coefficient of the element
+ #At least one of the coefficient of the element
#must be invertible in the snf form.
el = ms\f
to_be = false
@@ -361,7 +361,7 @@ function find_gens(K::KummerExt, S::PrimesSet, cp::fmpz=fmpz(1))
q, mq = quo(R, sR[1:ind-1], false)
s, ms = snf(q)
end
- if order(s) == 1
+ if order(s) == 1
break
end
@vprint :ClassField 3 "Index: $(exponent(s))^($(valuation(order(s), exponent(s))))\n"
@@ -396,7 +396,7 @@ end
function _compute_frob(K, mF, p, cached, D)
z_p = image(mF, K.zeta)^(K.n-1)
-
+
# K = k(sqrt[n_i](gen[i]) for i=1:length(gen)), an automorphism will be
# K[i] -> zeta^divexact(n, n_i) * ? K[i]
# Frob(sqrt[n](a), p) = sqrt[n](a)^N(p) (mod p) = zeta^r sqrt[n](a)
@@ -545,13 +545,13 @@ function reduce_mod_powers(a::FacElem{nf_elem, AnticNumberField}, n::Int, decom:
d = d1^(div(k, n) + 1)
end
b1 *= d^n #non-optimal, but integral...
- return FacElem(b1)
+ return FacElem(b1)
end
function reduce_mod_powers(a::FacElem{nf_elem, AnticNumberField}, n::Int, primes::Vector{NfOrdIdl})
vals = fmpz[valuation(a, p) for p in primes]
lp = Dict{NfOrdIdl, fmpz}(primes[i] => vals[i] for i = 1:length(primes) if !iszero(vals[i]))
- return reduce_mod_powers(a, n, lp)
+ return reduce_mod_powers(a, n, lp)
end
function reduce_mod_powers(a::FacElem{nf_elem, AnticNumberField}, n::Int)
diff --git a/src/RCF/rcf.jl b/src/RCF/rcf.jl
index 42beefd202..f61ea55174 100644
--- a/src/RCF/rcf.jl
+++ b/src/RCF/rcf.jl
@@ -200,7 +200,7 @@ function _s_unit_for_kummer_using_Brauer(C::CyclotomicExt, f::fmpz)
if isdefined(ZK, :lllO)
ZK = ZK.lllO::NfOrd
end
-
+
lP = Hecke.NfOrdIdl[]
for p = keys(lf.fac)
@@ -298,7 +298,7 @@ end
function find_gens_descent(mR::Map, A::ClassField_pp, cp::fmpz)
ZK = order(domain(mR))
C = cyclotomic_extension(nf(ZK), degree(A))
- R = codomain(mR)
+ R = codomain(mR)
Zk = order(codomain(A.rayclassgroupmap))
sR = GrpAbFinGenElem[]
lp = elem_type(domain(mR))[]
@@ -439,7 +439,7 @@ function find_gens_descent(mR::Map, A::ClassField_pp, cp::fmpz)
q, mq = quo(R, sR, false)
s, ms = snf(q)
end
- if order(q) == 1
+ if order(q) == 1
break
end
end
@@ -631,7 +631,7 @@ function _rcf_find_kummer(CF::ClassField_pp{S, T}) where {S, T}
CF.a = FacElem(one(C.Ka))
return nothing
end
- k, mk = kernel(h, false)
+ k, mk = kernel(h, false)
G = domain(h)
# Now, we find the kummer generator by considering the action
@@ -688,7 +688,7 @@ end
#roots of unit over the base field and the action of the automorphisms on it.
#The Kummer generator is always primitive! (Carlo and Claus)
function _find_prim_elem(CF::ClassField_pp, AutA)
-
+
AutA_gen = CF.AutG
A = domain(AutA_gen[1])
pe = gen(A)
@@ -700,7 +700,7 @@ function _find_prim_elem(CF::ClassField_pp, AutA)
Auto = Dict{GrpAbFinGenElem, NfRelElem{nf_elem}}(find_orbit(AutA_gen, AutA, pe))
end
end
- @vprint :ClassField 2 "have action on the primitive element!!!\n"
+ @vprint :ClassField 2 "have action on the primitive element!!!\n"
return pe, Auto
end
@@ -711,13 +711,13 @@ function find_orbit(auts, AutG, x)
order = 1
elements = Tuple{GrpAbFinGenElem, NfRelElem{nf_elem}}[(id(AutG), x)]
g = S[1]
-
+
while !iszero(g)
order = order +1
push!(elements, (g, auts[1](elements[end][2])))
g = g + S[1]
end
-
+
for i in 2:t
previous_order = order
for j = 1:previous_order
@@ -827,7 +827,7 @@ function _aut_A_over_k(C::CyclotomicExt, CF::ClassField_pp)
CF.AutR = AutA_rel
auts_in_snf!(CF)
return nothing
-
+
end
function auts_in_snf!(CF::ClassField_pp)
@@ -943,7 +943,7 @@ function _rcf_descent(CF::ClassField_pp)
else
@vprint :ClassField 2 "Computing automorphisms of the extension and orbit of primitive element\n"
pe, Auto = _find_prim_elem(CF, AutA)
-
+
@vprint :ClassField 2 ".. interesting...\n"
# want: hom: AutA = Gal(A/k) -> Gal(K/k) = domain(mq)
# K is the target field.
@@ -1022,8 +1022,8 @@ function _rcf_descent(CF::ClassField_pp)
end
end
genssq = NfRelToNfRelMor_nf_elem_nf_elem[gsq]
-
-
+
+
@assert Int(order(q)) == degree(CF)
#now, hopefully either norm or trace will be primitive for the target
@@ -1041,11 +1041,11 @@ function _rcf_descent(CF::ClassField_pp)
end
res = power_sums_to_polynomial(tr_in_K)
return res
- end
+ end
end
-
-
+
+
@vprint :ClassField 2 "trying relative trace\n"
@assert length(os) > 0
t = os[1]
diff --git a/src/RCF/rcf_stark.jl b/src/RCF/rcf_stark.jl
index bb065c4182..75937c9216 100644
--- a/src/RCF/rcf_stark.jl
+++ b/src/RCF/rcf_stark.jl
@@ -11,7 +11,7 @@ end
#
################################################################################
-function Base.show(io::IO, C::RCFCharacter)
+function Base.show(io::IO, C::RCFCharacter)
println(IOContext(io, :compact => true), "Character of $(C.C)")
end
@@ -272,7 +272,7 @@ function _find_coeffs(K, pol, v)
c = coeff(pol, i-1)
bn = 3*nbits(Hecke.upper_bound(c, fmpz))
fl, comb = _approximate(c, bconjs, bn)
- if !fl
+ if !fl
add = 10
while !fl && add < 100
fl, comb = _approximate(c, bconjs, bn)
@@ -328,7 +328,7 @@ function _find_suitable_quadratic_extension(C::T) where T <: ClassField_pp
ctx = rayclassgrp_ctx(OK, Int(exponent(C))*2)
allow_cache!(ctx.class_group_map)
lc = ideals_up_to(OK, bound, conductor(C)[1])
- cnt = 0
+ cnt = 0
while true
@vprint :ClassField 1 "Batch of ideals with $(length(lc)) elements \n"
for I in lc
@@ -828,7 +828,7 @@ function _C(chi::RCFCharacter, prec::Int)
OK = order(c)
nc = norm(c)
p = const_pi(RR)^degree(OK)
- d = sqrt(RR(abs(discriminant(OK))))*sqrt(RR(nc))
+ d = sqrt(RR(abs(discriminant(OK))))*sqrt(RR(nc))
return d//sqrt(p)
end
@@ -977,11 +977,11 @@ function _compute_A_coeffs(n::Int, nterms::Int, prec::Int)
res = Vector{arb}(undef, n+1)
q = divexact(i-1, 2)
r0 = spi*_coeff_0_odd(n, q)
- vg = coeffs_exp_odd[q+1]
+ vg = coeffs_exp_odd[q+1]
res[n+1] = zero(RR)
for j = 1:n
mul!(vg[n-j+1], vg[n-j+1], r0)
- res[j] = vg[n-j+1]
+ res[j] = vg[n-j+1]
end
end
res_final[i+1] = res
diff --git a/src/RCF/rcf_subfield.jl b/src/RCF/rcf_subfield.jl
index 913061cade..1ddb7fa394 100644
--- a/src/RCF/rcf_subfield.jl
+++ b/src/RCF/rcf_subfield.jl
@@ -45,7 +45,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
for (p, v) in fM0
p1 = Hecke.intersect_prime(mL, p)
if !haskey(fm0, p1)
- if iscoprime(minimum(p1, copy = false), n)
+ if iscoprime(minimum(p1, copy = false), n)
fm0[p1] = 1
else
fm0[p1] = v
@@ -57,14 +57,14 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
#Now, I have problems, so I need to add the ramification of the other extension.
for (p, v) in f
if !haskey(fm0, p)
- if isone(gcd(minimum(p), n))
+ if isone(gcd(minimum(p), n))
fm0[p] = 1
else
fm0[p] = v
end
else
- if !isone(gcd(minimum(p), n))
- fm0[p] = max(v, fm0[p])
+ if !isone(gcd(minimum(p), n))
+ fm0[p] = max(v, fm0[p])
end
end
lPP = prime_decomposition(mL, p)
@@ -77,7 +77,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
end
end
infplc = InfPlc[]
- if iszero(mod(n, 2))
+ if iszero(mod(n, 2))
infplc = real_places(L)
end
@vprint :ClassField 3 "Checking if I can compute the field over a subfield\n"
@@ -87,7 +87,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
end
#Now, the norm group of K over L
@vtime :ClassField 3 ngL, mngL = Hecke.norm_group(mL, mr)
- @hassert :ClassField 1 divisible(divexact(fmpz(degree(codomain(mL))), degree(domain(mL))), divexact(order(r), order(ngL)))
+ @hassert :ClassField 1 divisible(divexact(fmpz(degree(codomain(mL))), degree(domain(mL))), divexact(order(r), order(ngL)))
if !divisible(order(ngL), degree(C)) || !divisible(exponent(C), n)
return false, C
end
@@ -101,7 +101,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
fM0[p] = max(v, fM0[p])
else
fM0[p] = v
- end
+ end
end
end
inf_plc2 = InfPlc[]
@@ -127,7 +127,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
@hassert :ClassField 1 isisomorphic(cokernel(mk, false)[1], codomain(C.quotientmap))
mp = mk*proj
ck, mck = cokernel(mp, false)
- #If everything could work, then ck should be the direct product of the abelian extension I am searching for and
+ #If everything could work, then ck should be the direct product of the abelian extension I am searching for and
#the maximal abelian subextension of K/L
G1 = snf(cokernel(mngL, false)[1])[1]
G2 = snf(codomain(C.quotientmap))[1]
@@ -138,7 +138,7 @@ function translate_extension(mL::NfToNfMor, C::ClassField_pp)
fl, ms1 = has_complement(ms)
@assert fl
mq1 = cokernel(ms1, false)[2]
- mqq = mck * mq1
+ mqq = mck * mq1
@hassert :ClassField 1 domain(mqq) == r
C1 = ClassField_pp{MapRayClassGrp, GrpAbFinGenMap}()
C1.quotientmap = mqq
@@ -161,7 +161,7 @@ function translate_up(mL::NfToNfMor, C::ClassField_pp, C1::ClassField_pp)
mul!(img, img, gen(CEK.Kr))
end
end
- mrel = hom(CEL.Kr, CEK.Kr, mL, img)
+ mrel = hom(CEL.Kr, CEK.Kr, mL, img)
#@hassert :Fields 1 isconsistent(mrel)
g = mrel(CEL.mp[1](gen(CEL.Ka)))
mp = hom(CEL.Ka, CEK.Ka, CEK.mp[1]\(g), check = false)
@@ -183,7 +183,7 @@ function translate_up(mL::NfToNfMor, C::ClassField_pp, C1::ClassField_pp)
C.A = number_field(fdef, cached = false, check = false)[1]
#Now, the primitive element of the target extension seen in Cpp.K
mrel2 = hom(C1.K, C.K, mp, gen(C.K))
- C.pe = mrel2(C1.pe)
+ C.pe = mrel2(C1.pe)
CEKK = cyclotomic_extension(K, d)
@hassert :ClassField 1 iszero(map_coefficients(CEKK.mp[2], fdef, cached = false)(C.pe))
C.o = d1
diff --git a/src/Sparse/Matrix.jl b/src/Sparse/Matrix.jl
index bcd9c5b728..7c47e3a0a6 100644
--- a/src/Sparse/Matrix.jl
+++ b/src/Sparse/Matrix.jl
@@ -901,7 +901,7 @@ end
#
################################################################################
@doc Markdown.doc"""
- push!(A::SMat{T}, B::SRow{T}) where T
+ push!(A::SMat{T}, B::SRow{T}) where T
Appends the sparse row ```B``` to ```A```.
"""
diff --git a/src/Sparse/Module.jl b/src/Sparse/Module.jl
index 6c9917a31f..05f1145ebd 100644
--- a/src/Sparse/Module.jl
+++ b/src/Sparse/Module.jl
@@ -4,7 +4,7 @@
# Hecke.lift, Hecke.rational_reconstruction, Hecke.elementary_divisors,
# Hecke.rank, Hecke.det
-export det_mc, id, isupper_triangular, norm2, hadamard_bound2,
+export det_mc, id, isupper_triangular, norm2, hadamard_bound2,
hnf, hnf!, echelon_with_transform
add_verbose_scope(:HNF)
@@ -45,7 +45,7 @@ function add_gen!(M::ModuleCtxNmod, g::SRow{nmod})
push!(M.gens, g)
return true
end
- return false
+ return false
end
function add_gen!(M::ModuleCtx_fmpz, g::SRow{fmpz}, always::Bool = true)
@@ -57,7 +57,7 @@ function add_gen!(M::ModuleCtx_fmpz, g::SRow{fmpz}, always::Bool = true)
else
always && push!(M.rel_gens, g)
end
- return false
+ return false
end
function check_index(M::ModuleCtx_fmpz)
@@ -171,7 +171,7 @@ end
function non_trivial_pivot(M::ModuleCtx_fmpz)
h = check_index(M)
- if h == 0
+ if h == 0
return missing_pivot(M)
end
C = M.basis
diff --git a/src/Sparse/Row.jl b/src/Sparse/Row.jl
index e2c26b7058..a9953f937f 100644
--- a/src/Sparse/Row.jl
+++ b/src/Sparse/Row.jl
@@ -421,7 +421,7 @@ end
function +(A::SRow{T}, B::SRow{T}) where T
if length(A.values) == 0
- return B
+ return B
elseif length(B.values) == 0
return A
end
@@ -435,7 +435,7 @@ function -(A::SRow{T}, B::SRow{T}) where T
else
return add_scaled_row(B, A, base_ring(B)(-1))
end
- end
+ end
return add_scaled_row(B, A, base_ring(A)(-1))
end
@@ -486,7 +486,7 @@ function div(A::SRow{T}, b::T) where T
if !iszero(nv)
push!(B.pos, p)
push!(B.values, nv)
- end
+ end
end
return B
end
@@ -650,7 +650,7 @@ function add_scaled_row!(Ai::SRow{fmpz}, Aj::SRow{fmpz}, c::fmpz)
n = add!(n, n, Aj.values[pj])
# n = c*Ai.values[pi] + Aj.values[pj]
- if !iszero(n)
+ if !iszero(n)
nb = max(nb, nbits(n))
push!(sr.pos, Ai.pos[pi])
push!(sr.values, n)
diff --git a/src/Sparse/Solve.jl b/src/Sparse/Solve.jl
index 548557bb76..957b8d4eb3 100644
--- a/src/Sparse/Solve.jl
+++ b/src/Sparse/Solve.jl
@@ -372,8 +372,8 @@ function echelon!(S::SMat{T}; complete::Bool = false) where T <: FieldElem
j += 1
end
end
- i += 1
- end
+ i += 1
+ end
if complete
for i = nrows(S):-1:2
p = S[i].pos[1]
diff --git a/src/analytic.jl b/src/analytic.jl
index bc794f8455..a79f425872 100644
--- a/src/analytic.jl
+++ b/src/analytic.jl
@@ -323,7 +323,7 @@ function class_group_expected(d::fmpz, deg::Int, B::Int, samples::Int = 100)
else
Int(c)
end
-end
+end
#= D is supposed to be the disccriminant
n the dimension
diff --git a/src/conjugates.jl b/src/conjugates.jl
index ac4fd360df..9a4aebcfa0 100644
--- a/src/conjugates.jl
+++ b/src/conjugates.jl
@@ -1,5 +1,5 @@
-export conjugates_init, isconstant, issquarefree, conjugates, angle, cos,
+export conjugates_init, isconstant, issquarefree, conjugates, angle, cos,
sin, abs, abs2, sqrt
function isconstant(f::PolyElem)
@@ -20,7 +20,7 @@ function conjugates_init(f_in::Union{fmpz_poly, fmpq_poly})
end
g = PolynomialRing(FlintZZ, string(var(parent(f_in))), cached = false)[1](gz)
f = g
- else
+ else
f = f_in
end
isconstant(gcd(f, derivative(f))) || error("poly should be square-free")
@@ -36,7 +36,7 @@ function conjugates_init(f_in::Union{fmpz_poly, fmpq_poly})
push!(r_d, rr)
continue
end
- if imag(rr) > 0
+ if imag(rr) > 0
push!(c_d, rr)
continue
end
@@ -167,7 +167,7 @@ end
function minkowski_matrix(K::AnticNumberField, p::Int = 50)
c = roots_ctx(K)
- if isdefined(c, :minkowski_matrix)
+ if isdefined(c, :minkowski_matrix)
if c.minkowski_mat_p == p
return c.minkowski_matrix
elseif c.minkowski_mat_p >= p
diff --git a/src/helper.jl b/src/helper.jl
index c306b14976..ea378e3ebd 100644
--- a/src/helper.jl
+++ b/src/helper.jl
@@ -70,7 +70,7 @@ function check_return_type(f::DataType, M::Module, print_only_bad::Bool = false)
print("--------------------------------------------------------------------------------\n")
end
end
-end
+end
function check_bad_return_type(M::Module)
for x in names(M)
diff --git a/system/Build.jl b/system/Build.jl
index 7c67ffd0e6..8f3a30cc9e 100644
--- a/system/Build.jl
+++ b/system/Build.jl
@@ -11,7 +11,7 @@ println(f, "using Pkg")
println(f, "Hecke.system(\"precompile.jl\")")
close(f)
-PackageCompiler.create_sysimage([:Hecke], sysimage_path="/tmp/Hecke.$(Libdl.dlext)", precompile_execution_file="/tmp/CompileHecke.jl")
+PackageCompiler.create_sysimage([:Hecke], sysimage_path="/tmp/Hecke.$(Libdl.dlext)", precompile_execution_file="/tmp/CompileHecke.jl")
println("(re)start julia as")
println("\tjulia -J /tmp/Hecke.$(Libdl.dlext)")
\ No newline at end of file
diff --git a/system/HeckeProfile.jl b/system/HeckeProfile.jl
index 1c6b171357..0e577e5bf6 100644
--- a/system/HeckeProfile.jl
+++ b/system/HeckeProfile.jl
@@ -94,7 +94,7 @@ end
iz = find(bt .== 0)
then bt[1:iz[1]-1] is a complete trace
bt[iz[1]+1:iz[2]-1] the next, ...
-=#
+=#
function callers_frame(fname::Symbol, bt::Vector, lidict::Profile.LineInfoDict)
counts = []
@@ -127,7 +127,7 @@ function callers_frame(fname::Symbol, bt::Vector, lidict::Profile.LineInfoDict)
break
end
end
- end
+ end
return counts
end
@@ -146,7 +146,7 @@ function leafs(bt::Vector, lidict::Profile.LineInfoDict, skipC::Bool = false)
push!(M, fr.func)
skip = true
break
- end
+ end
else
skip = f!=0
end
@@ -161,14 +161,14 @@ function counts(bt::Vector, lidict::Profile.LineInfoDict, skipC::Bool = false)
continue
end
for fr = lidict[f]
- if skipC
+ if skipC
if !fr.from_c
push!(M, fr.func)
end
else
push!(M, fr.func)
end
- end
+ end
end
return M
end
@@ -198,8 +198,8 @@ function prune(fname::Symbol, bt::Vector, lidict::Profile.LineInfoDict)
push!(last, g)
break
end
- end
- end
+ end
+ end
if bingo
append!(rt, reverse(last))
push!(rt, UInt(0))
@@ -265,7 +265,7 @@ function graph(bt::Vector, lidict::Profile.LineInfoDict, skipC::Bool = true, ski
e[t] = 1
end
last = fn
- end
+ end
end
return g
end
@@ -278,7 +278,7 @@ end
function parents_with_count(g::Graph{T}, c::T) where {T}
return [(a, d) for ((a,b), d) = g.e if b==c]
-end
+end
function children(g::Graph{T}, c::T) where {T}
return [b for (a,b) = keys(g.e) if a==c]
@@ -296,6 +296,6 @@ end
HeckeProfile.children(G, :+)
...
-=#
+=#
end
diff --git a/test/AlgAss/AlgMat.jl b/test/AlgAss/AlgMat.jl
index c7bfb10e26..dfa56b215d 100644
--- a/test/AlgAss/AlgMat.jl
+++ b/test/AlgAss/AlgMat.jl
@@ -15,7 +15,7 @@
end
@testset "Radical" begin
-
+
mats = [[0 0 0 0 0 0 0 0 0 0;
1 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
diff --git a/test/AlgAssAbsOrd/Conjugacy/Conjugacy.jl b/test/AlgAssAbsOrd/Conjugacy/Conjugacy.jl
index 88141f7609..a4c112f166 100644
--- a/test/AlgAssAbsOrd/Conjugacy/Conjugacy.jl
+++ b/test/AlgAssAbsOrd/Conjugacy/Conjugacy.jl
@@ -4,7 +4,7 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, -9604, -7056, -12076, -2392, -2253, 952, 46, -16, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -4900, -140]
-
+
b = fmpz[-4645900, -49391, -3848404, -16744, -15771, 6664, 17066, 470484,
33488, 3779643, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1,
0, -2, 0, -26, 0, -8, 0, 1, 0, 0, 1, 0, 9, -55750240, -592692,
diff --git a/test/EllCrv/EllCrv.jl b/test/EllCrv/EllCrv.jl
index 5214cb71aa..27d63bdea6 100644
--- a/test/EllCrv/EllCrv.jl
+++ b/test/EllCrv/EllCrv.jl
@@ -96,7 +96,7 @@
@test @inferred isfinite(P)
@test @inferred !isinfinite(P)
-# the error is/was from doing QQ(K(0)) - which is possible now
+# the error is/was from doing QQ(K(0)) - which is possible now
# @test_throws MethodError E43_a1([gen(K), gen(K)])
@test_throws ErrorException E43_a1([2, 2])
diff --git a/test/Examples/MultiQuad.jl b/test/Examples/MultiQuad.jl
index a4a873f6bf..01a3659008 100644
--- a/test/Examples/MultiQuad.jl
+++ b/test/Examples/MultiQuad.jl
@@ -10,6 +10,6 @@
# f = MultiQuad.saturate(e, 2)
# @test MultiQuad.Hecke.class_group_get_pivot_info(f) == (1, BitSet([]))
-end
+end
diff --git a/test/FieldFactory/FieldFactory.jl b/test/FieldFactory/FieldFactory.jl
index 6e2f9f19e6..c7c357e52b 100644
--- a/test/FieldFactory/FieldFactory.jl
+++ b/test/FieldFactory/FieldFactory.jl
@@ -5,7 +5,7 @@
@testset "Quadratic Fields" begin
lq = fields(2, 1, fmpz(10)^4)
@test length(lq) == 6086
-
+
lqreal = fields(2, 1, fmpz(10)^4, only_real = true)
@test length(lqreal) == 3043
@@ -17,17 +17,17 @@
end
@test ind == 3043
end
- end
+ end
println("Biquadratic Fields")
@time begin
@testset "Biquadratic Fields" begin
l = fields(4, 2, fmpz(10)^6)
@test length(l) == 1014
-
+
l1 = fields(4, 2, fmpz(10)^6, only_real = true)
@test length(l1) == 196
-
+
ind = 0
for x in l
if istotally_real(x.field)
@@ -43,7 +43,7 @@
@testset "Abelian fields" begin
l = fields(6, 2, fmpz(10)^6)
@test length(l) == 10
-
+
l1 = fields(9, 2, fmpz(10)^13)
@test length(l1) == 4
end
@@ -55,11 +55,11 @@
@testset "Direct product decomposition" begin
@time l_direct_product = fields(12, 4, fmpz(10)^13)
@test length(l_direct_product) == 25
-
+
@time l_without = fields(12, 4, fmpz(10)^13, using_direct_product = false)
@test length(l_without) == 25
- d1 = length(fields(24, 13, fmpz(10)^24))
+ d1 = length(fields(24, 13, fmpz(10)^24))
d2 = length(fields(24, 13, fmpz(10)^24, using_direct_product = false))
@test d1 == d2
@@ -96,14 +96,14 @@
l = fields(4, 2, fmpz(10)^6)
forQ8 = Hecke.check_obstruction(l, L, 2, [2])
@test length(forQ8) == 53
-
-
+
+
lQ8 = fields(8, 4, fmpz(10)^12)
@test length(lQ8) == 2
-
+
lQ8_2 = fields(8, 4, forQ8, fmpz(10)^12)
@test length(lQ8_2) == 2
-
+
lQ8real = fields(8, 4, forQ8, fmpz(10)^12, only_real = true)
@test length(lQ8real) == 1
end
@@ -124,7 +124,7 @@
@test length(lsieved) == 24
end
end
-
+
println("Obstructions: prime power case")
@time begin
@testset "Obstructions: prime_power_case" begin
@@ -153,7 +153,7 @@
end
end
-
+
println("Some examples")
@time begin
@testset "Some examples" begin
diff --git a/test/FunField/DegreeLocalization.jl b/test/FunField/DegreeLocalization.jl
index 5826f85878..9eee1c2534 100644
--- a/test/FunField/DegreeLocalization.jl
+++ b/test/FunField/DegreeLocalization.jl
@@ -72,7 +72,7 @@ L = Localization(R, degree)
@test divides(L(1//x), L(1//x)) == (true, L(1))
@test_throws DivideError divexact(L(1//(x + 1)), L())
-
+
for i in 1:300
a = rand(L, 0:10, -10:10)
b = rand(L, 0:10, -10:10)
diff --git a/test/GrpAb/Elem.jl b/test/GrpAb/Elem.jl
index 4715af4480..3fe32e380d 100644
--- a/test/GrpAb/Elem.jl
+++ b/test/GrpAb/Elem.jl
@@ -75,11 +75,11 @@
aa = @inferred(2 * a)
@test aa == G([2, 0, 0])
-
+
aa = @inferred(a * 2)
@test aa == G([2, 0, 0])
-
+
aa = @inferred(fmpz(2) * a)
@test aa == G([2, 0, 0])
end
@@ -87,7 +87,7 @@
@testset "Neutral element" begin
G = abelian_group([3, 3, 3])
a = G[1]
-
+
aa = @inferred(a * fmpz(2))
@test aa == G([2, 0, 0])
@@ -180,7 +180,7 @@
@test length(collect(G)) == 3*9*27
end
-
+
@testset "Helper" begin
@testset "Reduce mod Hermite normal form" begin
a = FlintZZ[21 32 43]
@@ -198,7 +198,7 @@
Hecke.reduce_mod_hnf_ur!(a, H)
@test a == FlintZZ[0 0 1]
end
-
+
@testset "Smith normal form with transform" begin
M = MatrixSpace(FlintZZ,1,1)([0])
S = MatrixSpace(FlintZZ,1,1)([0])
diff --git a/test/GrpAb/GrpAbFinGen.jl b/test/GrpAb/GrpAbFinGen.jl
index 3c6bf2a98d..a948303584 100644
--- a/test/GrpAb/GrpAbFinGen.jl
+++ b/test/GrpAb/GrpAbFinGen.jl
@@ -220,7 +220,7 @@
H, mH = @inferred sub(G, fmpz(2))
@test isisomorphic(H, abelian_group([3, 3, 6, 5]))
-
+
G = abelian_group([2, 2, 6, 6])
H, mH = @inferred sub(G, 2)
@test isisomorphic(H, abelian_group([3, 3]))
@@ -316,10 +316,10 @@
A = abelian_group([3 1; 0 3])
B = abelian_group([9 2 1; 0 12 1; 0 0 25])
C = abelian_group([3, 4, 0])
- @test isisomorphic(hom(tensor_product(A, B, task = :none), C)[1],
+ @test isisomorphic(hom(tensor_product(A, B, task = :none), C)[1],
hom(A, hom(B, C)[1])[1])
end
-
+
@testset "Complement" begin
d = rand(2:1000)
d1 = rand(2:1000)
diff --git a/test/GrpAb/Lattice.jl b/test/GrpAb/Lattice.jl
index ab7d7d8c4b..43ec173f35 100644
--- a/test/GrpAb/Lattice.jl
+++ b/test/GrpAb/Lattice.jl
@@ -118,7 +118,7 @@
b, M = @inferred Hecke.can_map_into(L, Q, H)
@test !b
-
+
HH, mHH = sub(G, [G[2]], true, L)
b, GG, MH, MHH = @inferred Hecke.can_map_into_overstructure(L, H, HH)
@test b
diff --git a/test/GrpAb/Map.jl b/test/GrpAb/Map.jl
index 235c22fcc0..f319edd04b 100644
--- a/test/GrpAb/Map.jl
+++ b/test/GrpAb/Map.jl
@@ -77,7 +77,7 @@
b = @inferred issurjective(h)
@test b
end
-
+
@testset "Bijectivity" begin
G = abelian_group([4, 4, 4])
H = abelian_group([4, 4, 4])
diff --git a/test/GrpAb/SubgroupEnum.jl b/test/GrpAb/SubgroupEnum.jl
index 223e99925c..0268dd7f77 100644
--- a/test/GrpAb/SubgroupEnum.jl
+++ b/test/GrpAb/SubgroupEnum.jl
@@ -11,7 +11,7 @@
end
@testset "Given subgroup type" begin
-
+
T = psubgroups(G, 3, subtype = [3])
@test 0 == length(collect(T))
@@ -25,7 +25,7 @@
T = psubgroups(G, 3, subtype = [2])
@test 9 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[9] for t in T])
-
+
T = psubgroups(G, 3, subtype = [1, 1])
@test 13 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[3, 3] for t in T])
@@ -51,7 +51,7 @@
TH = psubgroups(G, 3, subtype = [2])
@test 9 == length(collect(TH))
@test all([snf(t[1])[1].snf == fmpz[9] for t in TH])
-
+
TH = psubgroups(G, 3, subtype = [1, 1])
@test 13 == length(collect(TH))
@test all([snf(t[1])[1].snf == fmpz[3, 3] for t in TH])
@@ -73,7 +73,7 @@
T = psubgroups(G, 3, quotype = [1, 1], fun = quo)
@test 13 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[3, 3] for t in T])
-
+
T = psubgroups(G, 3, quotype = [2, 1, 1], fun = quo)
@test 1 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[3, 3, 9] for t in T])
@@ -81,7 +81,7 @@
T = psubgroups(G, 3, quotype = Int[], fun = quo)
@test 1 == length(collect(T))
@test all([order(t[1]) == 1 for t in T])
-
+
TH = psubgroups(G, 3, quotype = [2], fun = quo)
@test 9 == length(collect(TH))
@test all([snf(t[1])[1].snf == fmpz[9] for t in TH])
@@ -89,7 +89,7 @@
TH = psubgroups(G, 3, quotype = [1, 1], fun = quo)
@test 13 == length(collect(TH))
@test all([snf(t[1])[1].snf == fmpz[3, 3] for t in TH])
-
+
TH = psubgroups(G, 3, quotype = [2, 1, 1], fun = quo)
@test 1 == length(collect(TH))
@test all([snf(t[1])[1].snf == fmpz[3, 3, 9] for t in TH])
@@ -98,7 +98,7 @@
@test 1 == length(collect(TH))
@test all([order(t[1]) == 1 for t in TH])
end
-
+
@testset "Given order" begin
T = psubgroups(G, 3, order = 1)
@@ -112,11 +112,11 @@
T = psubgroups(G, 3, order = 9)
@test 22 == length(collect(T))
@test all([order(t[1]) == 9 for t in T])
-
+
T = psubgroups(G, 3, order = 81)
@test 1 == length(collect(T))
@test all([order(t[1]) == 81 for t in T])
-
+
TH = psubgroups(G, 3, order = 1)
@test 1 == length(collect(TH))
@test all([order(t[1]) == 1 for t in TH])
@@ -128,7 +128,7 @@
TH = psubgroups(G, 3, order = 9)
@test 22 == length(collect(TH))
@test all([order(t[1]) == 9 for t in TH])
-
+
TH = psubgroups(G, 3, order = 81)
@test 1 == length(collect(TH))
@test all([order(t[1]) == 81 for t in TH])
@@ -147,11 +147,11 @@
T = psubgroups(G, 3, index = 9, fun = quo)
@test 22 == length(collect(T))
@test all([order(t[1]) == 9 for t in T])
-
+
T = psubgroups(G, 3, index = 81, fun = quo)
@test 1 == length(collect(T))
@test all([order(t[1]) == 81 for t in T])
-
+
TH = psubgroups(G, 3, index = 1, fun = quo)
@test 1 == length(collect(TH))
@test all([order(t[1]) == 1 for t in TH])
@@ -163,7 +163,7 @@
TH = psubgroups(G, 3, index = 9, fun = quo)
@test 22 == length(collect(TH))
@test all([order(t[1]) == 9 for t in TH])
-
+
TH = psubgroups(G, 3, index = 81, fun = quo)
@test 1 == length(collect(TH))
@test all([order(t[1]) == 81 for t in TH])
@@ -192,7 +192,7 @@
T = subgroups(G, subtype = [5, 5, 9, 3])
@test 1 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[15, 45] for t in T])
-
+
T = subgroups(G, subtype = [3, 5, 9, 5])
@test 1 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[15, 45] for t in T])
@@ -202,12 +202,12 @@
@testset "Given quotype" begin
T = subgroups(G, quotype = [25, 27], fun = quo)
@test 0 == length(collect(T))
-
+
T = subgroups(G, quotype = [5, 7], fun = quo)
@test 6 == length(collect(T))
@test all([snf(t[1])[1].snf == fmpz[35] for t in T])
end
-
+
@testset "Given order" begin
T = subgroups(G, order = 5*7*3)
@test 24 == length(collect(T))
diff --git a/test/LocalField/Conjugates.jl b/test/LocalField/Conjugates.jl
index b97a4ec93c..98ceb27c6c 100644
--- a/test/LocalField/Conjugates.jl
+++ b/test/LocalField/Conjugates.jl
@@ -16,7 +16,7 @@
end
@testset "Completion" begin
-
+
if VERSION < v"1.6.0-DEV.1332"
L1, mL1 = completion(k, 37, 1)
L2, mL2 = completion(k, 37, 3)
@@ -42,5 +42,5 @@
end
end
end
-
+
diff --git a/test/LocalField/LocalField.jl b/test/LocalField/LocalField.jl
index 23d9a82375..fbd2b6c704 100644
--- a/test/LocalField/LocalField.jl
+++ b/test/LocalField/LocalField.jl
@@ -1,5 +1,5 @@
@testset "LocalField" begin
-
+
@testset "Creation" begin
Qx, x = FlintQQ["x"]
f = x^2-2*x+2
@@ -16,7 +16,7 @@
@test degree(L) == 2
@test absolute_degree(L) == 4
@test prime(L) == 2
-
+
Q2 = PadicField(2, 10)
Q2s, s = PolynomialRing(Q2, "s")
f = s^2+s+1
@@ -42,9 +42,9 @@
K = QadicField(3, 4, 10)[1]
Kx, x = PolynomialRing(K, "x")
L = eisenstein_extension(x^20+3)[1]
- b = @inferred basis(L)
+ b = @inferred basis(L)
for i = 1:10
- r = 1+2*uniformizer(L)^i * sum([rand(1:10)*b[i] for i in 1:5])
+ r = 1+2*uniformizer(L)^i * sum([rand(1:10)*b[i] for i in 1:5])
M = @inferred representation_matrix(r)
n = @inferred norm(r)
@test n == det(M)
@@ -129,12 +129,12 @@
Kx, x = PolynomialRing(K, "x", cached = false)
L, b = Hecke.eisenstein_extension(x^7+2, "a")
pi = uniformizer(L)
- @test iszero(log(pi))
+ @test iszero(log(pi))
B = basis(L)
for i = 15:20
el = sum([rand(FlintZZ, 0:10)*B[j] for j = 1:7])*pi^i
explog = exp(log(1+el))
- logexp = log(exp(el))
+ logexp = log(exp(el))
@test iszero(setprecision(explog, precision(explog)-35) - 1 - el)
@test iszero(setprecision(logexp, precision(logexp)-35)-el)
end
diff --git a/test/LocalField/Poly.jl b/test/LocalField/Poly.jl
index 65bb60b5cd..4d89c36539 100644
--- a/test/LocalField/Poly.jl
+++ b/test/LocalField/Poly.jl
@@ -3,8 +3,8 @@
K = PadicField(2, 100)
Kx, x = PolynomialRing(K, "x")
L, gL = eisenstein_extension(x^2+2, "a")
-
- @testset "Fun Factor" for F in [K, L]
+
+ @testset "Fun Factor" for F in [K, L]
Fx, x = PolynomialRing(F, "x")
f = x^5
for i = 0:4
@@ -16,29 +16,29 @@
c = K(rand(FlintZZ, 1:100))
u += 2*c*x^i
end
-
+
g = f*u
u1, f1 = @inferred Hecke.fun_factor(g)
@test u == u1
@test f1 == f
end
-
+
@testset "Gcd" for F in [K, L]
Fx, x = PolynomialRing(F, "x")
f = (2*x+1)*(x+1)
g = x^3+1
gg = @inferred gcd(f, g)
- @test gg == x+1
-
+ @test gg == x+1
+
f = (2*x+1)*(x+1)
g = (2*x+1)*(x+2)
@test gcd(f, g) == 2*x+1
-
+
f = (x + 1//K(2)) * (2*x^2+x+1)
g = 2*x+1
@test gcd(f, g) == g
end
-
+
@testset "Gcdx" for F in [K, L]
Fx, x = PolynomialRing(F, "x")
f = (2*x+1)*(x+1)
@@ -46,24 +46,24 @@
d, u, v = gcdx(f, g)
@test d == gcd(f, g)
@test u*f + v*g == d
-
+
f = (2*x+1)*(x+1)
g = (2*x+1)*(x+2)
d, u, v = @inferred gcdx(f, g)
@test gcd(f, g) == d
@test d == u*f + v*g
-
+
f = (x + 1//K(2)) * (2*x^2+x+1)
g = 2*x+1
d, u, v = gcdx(f, g)
@test g == d
@test u*f + v*g == d
- end
-
+ end
+
@testset "Hensel" for F in [K, L]
Fx, x = PolynomialRing(F, "x")
- f = (x+1)^3
- g = (x^2+x+1)
+ f = (x+1)^3
+ g = (x^2+x+1)
h = x^2 +2*x + 8
ff = f*g*h
lf = @inferred Hecke.Hensel_factorization(ff)
@@ -84,5 +84,5 @@
b = derivative(a)
rab = @inferred resultant(a, b)
@test rab == det(sylvester_matrix(a, b))
- end
+ end
end
diff --git a/test/Map/NumField.jl b/test/Map/NumField.jl
index df6e7cfe40..48fb0a1d23 100644
--- a/test/Map/NumField.jl
+++ b/test/Map/NumField.jl
@@ -52,7 +52,7 @@
end
# AnticNumberField -> NfRel{nf_elem}
-
+
QQQ, q = NumberField(x - 1, "q")
QQQt, t = QQQ["t"]
K, a = NumberField(x^2 - 2, "a")
@@ -190,7 +190,7 @@
@test f(L(a)) == LL(-a)
# NfRel to NfRelNfRel
-
+
Qx, x = QQ["x"]
_K, a = NumberField(x^2 - 2, "a")
_Ky, y = _K["y"]
@@ -201,7 +201,7 @@
f = hom(Ka, K, c, inverse = (-_b^2 - _b + 5, _b))
# NfAbsNS
-
+
K, a = NumberField([x^2 - 2])
f = @inferred id_hom(K)
for i in 1:10
diff --git a/test/Map/NumberField.jl b/test/Map/NumberField.jl
index 623c0bed31..b76a25cb0d 100644
--- a/test/Map/NumberField.jl
+++ b/test/Map/NumberField.jl
@@ -20,12 +20,12 @@ end
for i = 1:length(lP)
I_new = A[2](lP1[1])
id = findfirst(isequal(I_new), lP1)
- @test id != nothing
+ @test id != nothing
end
f = hom(K, K, a^4//12+a//2)
E = EquationOrder(K)
I = ideal(E, E(a))
- @test_throws ErrorException Hecke.induce_image(f, I)
+ @test_throws ErrorException Hecke.induce_image(f, I)
end
diff --git a/test/Misc/NumberField.jl b/test/Misc/NumberField.jl
index 4f213149ee..e36da2e06a 100644
--- a/test/Misc/NumberField.jl
+++ b/test/Misc/NumberField.jl
@@ -7,11 +7,11 @@
c, KtoL = Hecke.issubfield(K, L)
@test c == true
@test parent(KtoL(a)) == L
-
+
c, KtoL = Hecke.issubfield_normal(K, L)
@test c == true
@test parent(KtoL(a)) == L
-
+
OK = maximal_order(K)
OL = maximal_order(L)
c, KtoL = Hecke.issubfield(K, L)
diff --git a/test/Misc/Places.jl b/test/Misc/Places.jl
index ed717dd3a6..ae54509d4f 100644
--- a/test/Misc/Places.jl
+++ b/test/Misc/Places.jl
@@ -33,7 +33,7 @@
@test S[1] != S[2]
string(S[1]); # Just check that it does not error
-
+
S = infinite_places(K2)
@test length(S) == 5
@@ -47,7 +47,7 @@
r = conjugates_arb(a2)
@test overlaps(r[1], SR[1].r)
- @test overlaps(r[2], SC[1].r) && overlaps(r[3], SC[2].r) && overlaps(r[4], SC[3].r) && overlaps(r[5], SC[4].r)
+ @test overlaps(r[2], SC[1].r) && overlaps(r[3], SC[2].r) && overlaps(r[4], SC[3].r) && overlaps(r[5], SC[4].r)
P = infinite_place(K2, 1)
@test P == S[1]
@@ -82,7 +82,7 @@
@test !ispositive(b, infinite_places(K1))
@test ispositive(b, [C])
@test !istotally_positive(b)
-
+
c = b^10*b^2
sc = signs(c)
@test sc == Dict(P => 1)
@@ -120,7 +120,7 @@
@test !ispositive(b, [P, C])
@test !ispositive(b, infinite_places(K3))
@test !istotally_positive(b)
-
+
c = b^10*b^2
@test signs(c) == Dict(P => 1, P2 => 1)
@test sign(c, P) == 1
diff --git a/test/Misc/Poly.jl b/test/Misc/Poly.jl
index 3ca191e6d5..3528928eaf 100644
--- a/test/Misc/Poly.jl
+++ b/test/Misc/Poly.jl
@@ -55,7 +55,7 @@
end
function random_symmetric_matrix(x::Int)
- M = zero_matrix(FlintZZ, x, x)
+ M = zero_matrix(FlintZZ, x, x)
for i = 1:x
for j= i:x
a = rand(1:5)
@@ -69,6 +69,6 @@
for i = 1:20
@test _test_sturm()
end
-
-
+
+
end
diff --git a/test/Misc/Primes.jl b/test/Misc/Primes.jl
index 120d6e41d0..d358b46313 100644
--- a/test/Misc/Primes.jl
+++ b/test/Misc/Primes.jl
@@ -42,7 +42,7 @@
@test length(PP) == 35
@test PP[1] == T(101)
@test PP[end] == T(991)
- @test all(isprime(p) && iszero(mod(p - T(1), T(5))) for p in P)
+ @test all(isprime(p) && iszero(mod(p - T(1), T(5))) for p in P)
P = @inferred PrimesSet(T(100), T(1000))
PP = collect(P)
@@ -58,7 +58,7 @@
a = rand(0:modd)
end
P = @inferred PrimesSet(T(B), 2 * T(B), T(modd), T(a))
- @test all(isprime(p) && iszero(mod(p - T(a), T(modd))) for p in P)
+ @test all(isprime(p) && iszero(mod(p - T(a), T(modd))) for p in P)
end
end
diff --git a/test/Misc/RelFinField.jl b/test/Misc/RelFinField.jl
index 057d0e1bb9..bcbb06ef88 100644
--- a/test/Misc/RelFinField.jl
+++ b/test/Misc/RelFinField.jl
@@ -10,7 +10,7 @@
bK = @inferred base_field(K)
@test bK == F
o = @inferred order(K)
- @test o == 27^2
+ @test o == 27^2
@test absolute_degree(K) == 6
end
@@ -45,7 +45,7 @@
@test gL^3 == gL*gL*gL
@test gL^5 == 2*(gL^4+gL^2+1)
@test isone(-gL^5-gL^4-gL^2)
- end
+ end
@testset "Norm, Trace, Minpoly" begin
F, gF = FiniteField(3, 3, cached = false)
@@ -62,12 +62,12 @@
f = @inferred Hecke.absolute_minpoly(gL)
Fx = parent(f)
x = gen(Fx)
- @test f == x^5+x^4+x^2+1
+ @test f == x^5+x^4+x^2+1
g = @inferred minpoly(gL+1)
@test iszero(g(gL+1))
Rx = parent(g)
y = gen(Rx)
- @test g(y+1) == y^5+y^4+y^2+1
+ @test g(y+1) == y^5+y^4+y^2+1
end
@testset "Absolute basis and coordinates" begin
diff --git a/test/Misc/jordan_test.jl b/test/Misc/jordan_test.jl
index 4c191f5e16..44ec1b2d41 100644
--- a/test/Misc/jordan_test.jl
+++ b/test/Misc/jordan_test.jl
@@ -27,7 +27,7 @@
@test S*M*inv(S) == J
for i = 1:6
for j = 1:i-1
- @test iszero(J[i, j])
+ @test iszero(J[i, j])
end
end
for i = 1:5
@@ -50,5 +50,5 @@
CF, TM = rational_canonical_form(C)
@test CF == C
@test TM * C * inv(TM) == CF
-
+
end
diff --git a/test/Misc/meataxe.jl b/test/Misc/meataxe.jl
index 72c78f342c..d8d3a4a6cd 100644
--- a/test/Misc/meataxe.jl
+++ b/test/Misc/meataxe.jl
@@ -7,9 +7,9 @@
@test iszero(Hecke.cleanvect(M,v))
v[1,3]=1
@test !iszero(Hecke.cleanvect(M,v))
-
+
end
-
+
@testset "closure and spinning" begin
G=[MatrixSpace(F,4,4)([1,2,0,0,1,1,0,0,0,0,1,2,0,0,1,1])]
M=Hecke.ModAlgAss(G)
@@ -21,7 +21,7 @@
@test nrows(Hecke.closure(v,M.action))==4
end
-
+
@testset "meataxe" begin
G=[MatrixSpace(F,4,4)([1,2,0,0,1,1,0,0,0,0,1,2,0,0,1,1])]
M=Hecke.ModAlgAss(G)
@@ -29,19 +29,19 @@
@test !bool
@test nrows(B)==2
#@test nrows(Hecke.closure(B, M.action))==2
-
+
N=Hecke._actsub(B,G)
bool,B=meataxe(N)
@test bool
-
+
G=[MatrixSpace(F,3,3)([1,0,0,0,0,1,0,1,0]), MatrixSpace(F,3,3)([0,0,1,1,0,0,0,1,0])]
M=Hecke.ModAlgAss(G)
bool,B=meataxe(M)
@test !bool
#@test nrows(Hecke.closure(B, M.action))==nrows(B)
-
+
end
-
+
@testset "composition factors and series" begin
G=[MatrixSpace(F,4,4)([1,2,0,0,1,1,0,0,0,0,1,2,0,0,1,1])]
M=Hecke.ModAlgAss(G)
@@ -58,27 +58,27 @@
N=Hecke.ModAlgAss([matrix(F,2,2,[0,2,1,0])])
M.isirreducible= 1
@test Hecke.isisomorphic(M,N)
-
-
+
+
M1=matrix(F,2,2,[1,0,1,1])
M2=matrix(F,2,2,[1,1,0,1])
M=Hecke.ModAlgAss([M1,M2])
M.isirreducible= 1
-
+
N1=matrix(F,2,2,[2,2,1,0])
N2=matrix(F,2,2,[1,1,0,1])
N=Hecke.ModAlgAss([N1,N2])
-
+
@test Hecke.isisomorphic(M,N)
-
+
end
-
+
@testset "Submodules" begin
A=MatrixSpace(F,3,3)(1)
M=Hecke.ModAlgAss([A])
ls=minimal_submodules(M)
@test length(ls)==13
-
+
F = f(2) #FiniteField(2, 1, "a")
A=MatrixSpace(F,6,6)(1)
A[5,6]=1
diff --git a/test/Misc/stable_subgroups.jl b/test/Misc/stable_subgroups.jl
index 908be7b3c7..396650ee6e 100644
--- a/test/Misc/stable_subgroups.jl
+++ b/test/Misc/stable_subgroups.jl
@@ -1,23 +1,23 @@
@testset "ZpnGModules" begin
@testset "Minimal Submodules" begin
-
+
F, a = FiniteField(3,1,"a")
R = ResidueRing(FlintZZ,9)
-
+
V=abelian_group([3,3,9,9])
-
+
l=[1,1,3,0,2,1,3,3,1,1,1,1,0,0,0,1]
l1=[1,1,1,0,2,1,1,1,0,0,1,1,0,0,0,1]
A=MatrixSpace(R,4,4)(l)
A1=MatrixSpace(F,4,4)(l1)
-
+
M = ZpnGModule(V,[A])
M1 = Hecke.ModAlgAss([A1])
-
+
ls = minimal_submodules(M)
ls1 = minimal_submodules(M1)
-
+
@test length(ls) == length(ls1)
for y in ls
@test Hecke.issubmodule(M,y)
@@ -26,7 +26,7 @@
@testset "Dual Module" begin
-
+
R=ResidueRing(FlintZZ,9)
V=abelian_group([3,3,9,9])
V.issnf=true
@@ -40,12 +40,12 @@
for y in ls
@test Hecke.issubmodule(M,Hecke._dualize(y,V,v))
end
-
+
end
-
-
+
+
@testset "submodules with given structure" begin
-
+
R=ResidueRing(FlintZZ,8)
V=abelian_group([2,4,8,8])
V.issnf=true
@@ -59,12 +59,12 @@
M=ZpnGModule(V,[A,B,C])
ls=submodules(M,typesub=[2,3])
y=subgroups(V,quotype=[4,8])
-
+
mp1=Hecke.GrpAbFinGenMap(V,V,lift(A))
mp2=Hecke.GrpAbFinGenMap(V,V,lift(B))
mp3=Hecke.GrpAbFinGenMap(V,V,lift(C))
act=[mp1,mp2,mp3]
-
+
i=0
for el in y
if Hecke.isstable(act,el[2])
@@ -72,7 +72,7 @@
end
end
@test i==length(ls)
-
+
ls=submodules(M,typesub=[3])
y=subgroups(V,quotype=[8])
i=0
@@ -82,11 +82,11 @@
end
end
@test i==length(ls)
-
+
end
-
+
@testset "submodules" begin
-
+
R=ResidueRing(FlintZZ,4)
V=abelian_group([2,2,4])
V.issnf=true
@@ -96,7 +96,7 @@
ls=submodules(M)
lsub=subgroups(V)
@test length(collect(ls))==length(collect(lsub))
-
+
end
diff --git a/test/NfAbs/Elem.jl b/test/NfAbs/Elem.jl
index ab39b10748..f8abf31874 100644
--- a/test/NfAbs/Elem.jl
+++ b/test/NfAbs/Elem.jl
@@ -99,7 +99,7 @@ end
@test length(factor(t^10)) == 1
end
- K, a = NumberField(x - 1, "a")
+ K, a = NumberField(x - 1, "a")
Kt, t = K["t"]
f = t^5 -3 * t^4 - 104 * t^3 + 312 * t^2 + 400*t -1200
@test length(factor(f)) == 5
@@ -108,13 +108,13 @@ end
for i in 1:10
n = rand(1:10)
d = rand(1:10)
- K, a = NumberField(n//d * change_base_ring(FlintQQ, x - 1), "a")
+ K, a = NumberField(n//d * change_base_ring(FlintQQ, x - 1), "a")
Kt, t = K["t"]
f = t^5 -3 * t^4 - 104 * t^3 + 312 * t^2 + 400*t -1200
@test length(factor(f)) == 5
@test length(factor(f*t)) == 6
-
- K, a = NumberField(change_base_ring(FlintQQ, x) - n//d, "a")
+
+ K, a = NumberField(change_base_ring(FlintQQ, x) - n//d, "a")
Kt, t = K["t"]
f = t^5 -3 * t^4 - 104 * t^3 + 312 * t^2 + 400*t -1200
@test length(factor(f)) == 5
@@ -123,7 +123,7 @@ end
#Tommys
K, a = number_field(x^2 - x - 4)
- Ky, y = K["y"]
+ Ky, y = K["y"]
f = y^16+(39)*y^14+(449)*y^12+(1794)*y^10+(2830)*y^8+(1794)*y^6+(449)*y^4+(39)*y^2+(1)
@test length(factor(f)) == 2
diff --git a/test/NfOrd/Clgp.jl b/test/NfOrd/Clgp.jl
index 58dbf83411..f5492cdcec 100644
--- a/test/NfOrd/Clgp.jl
+++ b/test/NfOrd/Clgp.jl
@@ -22,7 +22,7 @@ using Random
Cl, mCl = Hecke.class_group(O, redo = true)
U, mU = Hecke.unit_group(O)
@test order(Cl) == h
-
+
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
U, mU = Hecke.unit_group(O)
@test order(Cl) == h
@@ -46,7 +46,7 @@ using Random
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
U, mU = Hecke.unit_group(O)
@test order(Cl) == 1
-
+
O = Order(K, shuffle(basis(O)), isbasis = true)
O.ismaximal = 1
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
@@ -60,7 +60,7 @@ using Random
O = maximal_order(K)
Cl, mCl = Hecke.class_group(O)
@test order(Cl) == 8
-
+
O = Order(K, shuffle(basis(O)), isbasis = true)
O.ismaximal = 1
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
@@ -95,7 +95,7 @@ end
@testset "K = Q" begin
K, a = NumberField(x, "a", cached = false)
O = maximal_order(K)
-
+
Cl, mCl = Hecke.class_group(O, redo = true)
U, mU = Hecke.unit_group(O)
@test order(Cl) == 1
@@ -117,7 +117,7 @@ end
@test U.torsion_units_order == 2
@test contains(AF(0.88137358701),U.tentative_regulator)
@test order(Cl) == 1
-
+
O = Order(K, shuffle(basis(O)), isbasis = true)
O.ismaximal = 1
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
@@ -158,7 +158,7 @@ end
@test U.torsion_units_order == 2
@test contains(AF(2027.9289425180057),U.tentative_regulator)
@test order(Cl) == 5
-
+
O = Order(K, shuffle(basis(O)), isbasis = true)
O.ismaximal = 1
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
@@ -174,7 +174,7 @@ end
@test contains(AF(2027.9289425180057),U.tentative_regulator)
@test order(Cl) == 5
end
-
+
@testset "Cyclotomic Field 13" begin
K, a = cyclotomic_field(13, cached = false)
O = maximal_order(K)
@@ -188,7 +188,7 @@ end
@test order(U) == O
@test U.torsion_units_order == 26
@test order(Cl) == 1
-
+
O = Order(K, shuffle(basis(O)), isbasis = true, cached = false)
O.ismaximal = 1
Cl, mCl = Hecke.class_group(O, redo = true, do_lll = false)
@@ -202,7 +202,7 @@ end
@test U.torsion_units_order == 26
@test order(Cl) == 1
end
-
+
@testset "f = Q[x]/(f), f = x^18 + 18*x^16 + 135*x^14 + 192*x^12 - 2961*x^10 - 17334*x^8+ 20361*x^6 + 315108*x^4 + 514944*x^2 + 123904" begin
K, a = NumberField(x^18 + 18*x^16 + 135*x^14 + 192*x^12 - 2961*x^10 - 17334*x^8+ 20361*x^6 + 315108*x^4 + 514944*x^2 + 123904, "a")
O = maximal_order(K)
@@ -211,7 +211,7 @@ end
UU, mU = Hecke.unit_group(O)
@test order(Cl)== 36
-
+
O = Order(K, shuffle(basis(O)), isbasis = true)
O.ismaximal = 1
@@ -220,7 +220,7 @@ end
@test order(Cl)== 36
end
-
+
@testset "S3 field" begin
Qx, x = PolynomialRing(FlintQQ, "x")
f = x^6-24*x^4+157*x^2-162
diff --git a/test/NfOrd/Elem.jl b/test/NfOrd/Elem.jl
index b2370db28a..6b740649ca 100644
--- a/test/NfOrd/Elem.jl
+++ b/test/NfOrd/Elem.jl
@@ -66,7 +66,7 @@
b = O1(a1//2, false)
@test_throws ErrorException coordinates(b)
-
+
b = O1(a1)
c = @inferred K1(b)
@test c == a1
@@ -132,7 +132,7 @@
c = @inferred divexact(O1(a1^2), O1(a1))
@test c == O1(a1)
-
+
c = @inferred divexact(O1(a1^2), O1(a1), true)
@test c == O1(a1)
@@ -190,7 +190,7 @@
@test_throws ErrorException divexact(b, O1(4*a1))
end
-
+
@testset "Exponentiation" begin
b = O1(a1)
c = @inferred b^3
@@ -238,7 +238,7 @@
b = O1(a1)
c = @inferred tr(b)
@test c == 0
- end
+ end
@testset "Norm" begin
b = O1(a1)
@@ -319,7 +319,7 @@
fac = @inferred factor(b)
@test isunit(unit(fac)) == 1
@test b == unit(fac) * prod(p^e for (p, e) in fac)
-
+
K, a = NumberField(x^3 - 2, "a")
OK = maximal_order(K)
b = rand(OK, -10:10)
diff --git a/test/NfOrd/FracIdl.jl b/test/NfOrd/FracIdl.jl
index 58c6179880..e8477ed95c 100644
--- a/test/NfOrd/FracIdl.jl
+++ b/test/NfOrd/FracIdl.jl
@@ -1,7 +1,7 @@
Qx, x = PolynomialRing(FlintQQ, "x")
K2, a2 = NumberField(x^3 - 2, "a1")
K3, (a3,) = NumberField([x^3 - 2], "a2")
-@testset "Fractional ideals for $K1" for (K1, a1) in [(K2, a2), (K3, a3)]
+@testset "Fractional ideals for $K1" for (K1, a1) in [(K2, a2), (K3, a3)]
O1 = Order(K1, Hecke.FakeFmpqMat(FlintZZ[1 0 0; 0 2 0; 0 0 4], one(FlintZZ)))
i = ideal(O1, O1(2*a1))
diff --git a/test/NfOrd/Ideal.jl b/test/NfOrd/Ideal.jl
index 26b0db3cd9..fe6a361e66 100644
--- a/test/NfOrd/Ideal.jl
+++ b/test/NfOrd/Ideal.jl
@@ -32,7 +32,7 @@
@test I == J && J == K && K == M && M == L && L == I
I2 = @inferred ideal(O2, O2(1 + a2))
-
+
Ib = basis(I2)
II = ideal(O2, Ib)
@test I2 == II
@@ -190,7 +190,7 @@
I = @inferred pradical(O1, 2)
@test I == ideal(O1, FlintZZ[2 0 0; 0 1 0; 0 0 1])
end
-
+
@testset "Prime Decomposition" begin
L = NumberField(x^30-x^29+x^28-x^27+x^26+743*x^25-1363*x^24-3597*x^23-22009*x^22+458737*x^21+2608403*x^20+6374653*x^19-1890565*x^18-112632611*x^17-467834081*x^16-1365580319*x^15-1188283908*x^14+3831279180*x^13+28661663584*x^12+89106335984*x^11+226912479680*x^10+443487548480*x^9+719797891328*x^8+946994403328*x^7+1015828094976*x^6+878645952512*x^5+555353440256*x^4+124983967744*x^3+67515711488*x^2-5234491392*x+400505700352)[1]
OL = maximal_order(L)
@@ -212,7 +212,7 @@
lp = prime_decomposition(OK, 7)
P = lp[1][1]
@test Hecke.frobenius_automorphism(P) != id_hom(K)
- end
+ end
@testset "Minimum" begin
k, = number_field(x^2 - 2);
diff --git a/test/NfOrd/Ideal/Prime.jl b/test/NfOrd/Ideal/Prime.jl
index 0bcd9db32c..2b8030bcf5 100644
--- a/test/NfOrd/Ideal/Prime.jl
+++ b/test/NfOrd/Ideal/Prime.jl
@@ -19,13 +19,13 @@
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), indexdivisors = false, ramified = false)
@test @inferred length(collect(S)) == 33
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), indexdivisors = false, ramified = false, degreebound = 1)
- @test @inferred length(collect(S)) == 20
+ @test @inferred length(collect(S)) == 20
K, a = NumberField(x^5 - x + 1, "a")
O = maximal_order(K)
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100))
- @test @inferred length(collect(S)) == 51
+ @test @inferred length(collect(S)) == 51
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), degreebound = 1)
@test @inferred length(collect(S)) == 18
@@ -45,19 +45,19 @@
P = prime_decomposition(O, 2)[1][1]
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), coprimeto = P)
- @test @inferred length(collect(S)) == 50
-
+ @test @inferred length(collect(S)) == 50
+
el = Hecke.find_elem_of_valuation_1(P, P^2)
@test valuation(el, P) == 1
-
+
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), coprimeto = 2)
@test @inferred length(collect(S)) == 49
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), coprimeto = fmpz(6))
- @test @inferred length(collect(S)) == 48
+ @test @inferred length(collect(S)) == 48
S = @inferred PrimeIdealsSet(O, fmpz(2), fmpz(100), coprimeto = O(30))
- @test @inferred length(collect(S)) == 47
+ @test @inferred length(collect(S)) == 47
@test_throws ErrorException PrimeIdealsSet(O, fmpz(-1), fmpz(1))
@test_throws ErrorException PrimeIdealsSet(O, fmpz(1), -2)
diff --git a/test/NfOrd/LinearAlgebra.jl b/test/NfOrd/LinearAlgebra.jl
index c7a33f855f..5a50ce7b78 100644
--- a/test/NfOrd/LinearAlgebra.jl
+++ b/test/NfOrd/LinearAlgebra.jl
@@ -61,8 +61,8 @@
# Construct random pseudo-matrices over different fields and check if the
# pseudo hermite normal form span the same module
-
- @testset "Q[x]/x^$i - 10)" for i in 2:5
+
+ @testset "Q[x]/x^$i - 10)" for i in 2:5
K, a = NumberField(x^i - 10, "a")
O = maximal_order(K)
#println(" Testing over field $(x^i - 10)")
diff --git a/test/NfOrd/NfOrd.jl b/test/NfOrd/NfOrd.jl
index a709782a1b..03c6774006 100644
--- a/test/NfOrd/NfOrd.jl
+++ b/test/NfOrd/NfOrd.jl
@@ -63,7 +63,7 @@
#@test O7 == O77
#@test !(O7 === O77)
-
+
O8 = Order(K6, [a1])
@test O8 == EquationOrder(K1)
@@ -392,7 +392,7 @@
7222691559*x^80 + 31283828160*x^79 + 525642325551*x^78 +
1906118141542*x^77 + 24142920697938*x^76 + 79592960305643*x^75 +
838232263382574*x^74 + 2605205454422475*x^73 + 24565284675046150*x^72 +
- 70981918657774030*x^71 + 641054201228592185*x^70 +
+ 70981918657774030*x^71 + 641054201228592185*x^70 +
1734903783394973997*x^69 + 15495356543087563190*x^68 +
39815058831494401595*x^67 + 351972255697672269132*x^66 +
866446351271000834294*x^65 + 7284533695483449887998*x^64 +
@@ -450,9 +450,9 @@
132835684951238038126841006782845727573364179*x^7 +
101387674327323669504054265029073554782913385*x^6 -
12293053226599581249247685498068796993543192*x^5 +
- 1490584272544043051357580914905419718739398*x^4 -
+ 1490584272544043051357580914905419718739398*x^4 -
180650443636285117226206582673575773019341*x^3 +
- 21986977593862597199128608447146928784347*x^2 -
+ 21986977593862597199128608447146928784347*x^2 -
2582145971030886336723659422476783673912*x +
373314295307719514165340295548734564161
K, a = NumberField(f)
diff --git a/test/NfOrd/RayClassGroup.jl b/test/NfOrd/RayClassGroup.jl
index 095be804ed..f0d798dd93 100644
--- a/test/NfOrd/RayClassGroup.jl
+++ b/test/NfOrd/RayClassGroup.jl
@@ -11,12 +11,12 @@
end
@testset "quadratic fields" begin
-
+
Qx,x=PolynomialRing(FlintQQ,"x")
K,a=NumberField(x^2+199,"a")
O=maximal_order(K)
C,mC=class_group(O)
-
+
for i=9:13
R1,mR1=ray_class_group(ideal(O,i), n_quo=3)
for r in R1
@@ -26,12 +26,12 @@
q,mq=quo(R,3)
@test Hecke.isisomorphic(R1,q)
end
-
+
K,a=NumberField(x^2-5,"a")
O=maximal_order(K)
C,mC=class_group(O, redo = true)
inf_plc=real_places(K)
-
+
for i=9:13
R1,mR1=ray_class_group(ideal(O,i),inf_plc)
for r in R1
@@ -45,9 +45,9 @@
@test Hecke.isisomorphic(q1,R2)
end
end
-
+
@testset "infinite places" begin
-
+
Qx, x = PolynomialRing(FlintQQ, "x");
K, a = NumberField(x^4-4*x^3-11*x^2+30*x+20, cached = false)
O = maximal_order(K)
@@ -57,9 +57,9 @@
@test el == mr\(mr(el))
end
end
-
+
@testset "stable subgroups" begin
-
+
Qx,x=PolynomialRing(FlintQQ,"x");
f=x^2+1;
K,a=NumberField(f,"a");
@@ -78,7 +78,7 @@
end
end
@test length(x)==i
-
+
x=Hecke.stable_subgroups(r, act, op = quo, quotype = [2,4]);
y=subgroups(r, quotype=[2,4])
i=0
@@ -88,7 +88,7 @@
end
end
@test length(x)==i
-
+
r,mr=ray_class_group(ideal(O,9*19*29), n_quo=9);
act=Hecke.induce_action(mr, auts);
x=Hecke.stable_subgroups(r, act, op = quo, quotype = [9]);
@@ -100,7 +100,7 @@
end
end
@test length(x)==i
-
+
x=Hecke.stable_subgroups(r, act, op = quo, quotype = [3,9]);
y=subgroups(r, quotype=[3,9])
i=0
@@ -111,5 +111,5 @@
end
@test length(x)==i
end
-
+
end
diff --git a/test/NfOrd/ResidueField.jl b/test/NfOrd/ResidueField.jl
index 884101bc08..090364d197 100644
--- a/test/NfOrd/ResidueField.jl
+++ b/test/NfOrd/ResidueField.jl
@@ -15,7 +15,7 @@
@test order(F1) == order(F2)
@test order(F1) == order(F3)
@test order(F1) == order(F)
-
+
for b in B
a1 = mF(b)
a2 = mF1(b)
@@ -27,7 +27,7 @@
@test (mF3\(a4) - b) in P
end
end
-
+
lp = prime_decomposition(OK, 47)
for i = 1:length(lp)
P = lp[i][1]
@@ -38,7 +38,7 @@
@test order(F1) == order(F2)
@test order(F1) == order(F3)
@test order(F1) == order(F)
-
+
for b in B
a1 = mF(b)
a2 = mF1(b)
diff --git a/test/NumField/Elem.jl b/test/NumField/Elem.jl
index 9d813a8a9e..352400eba2 100644
--- a/test/NumField/Elem.jl
+++ b/test/NumField/Elem.jl
@@ -152,7 +152,7 @@
f = x^2 + 12x - 92
K, a = NumberField(f, "a")
Ky, y = K["y"]
- L, b = NumberField(y^2 + y + 1, "b")
+ L, b = NumberField(y^2 + y + 1, "b")
Lt, t = PolynomialRing(L)
L1, gL1 = number_field([t^3-2])
L1rel, mL1rel = relative_simple_extension(L1, K)
@@ -215,7 +215,7 @@ end
@test isone(mA(A[1])^6)
@test !isone(mA(A[1])^3)
@test !isone(mA(A[1])^2)
-
+
Kt, t = PolynomialRing(K, cached = false)
Ls, gLs = number_field(t^2+1)
G, mG = torsion_unit_group(Ls)
@@ -227,7 +227,7 @@ end
@test isone(g^12)
@test !isone(g^4)
@test !isone(g^3)
-
+
Lns, gLns = number_field([t^2+1, t^2+2])
G, mG = torsion_unit_group(Lns)
@test ngens(G) == 1
diff --git a/test/NumField/Hilbert.jl b/test/NumField/Hilbert.jl
index 4479ed92f2..d02c01a1d6 100644
--- a/test/NumField/Hilbert.jl
+++ b/test/NumField/Hilbert.jl
@@ -31,7 +31,7 @@
for P in prime_ideals_up_to(OK, 200)
@test hilbert_symbol(b, -3, P) == 1
end
-
+
# Test where Magma div(x, y) differs from julia div(x, y) (internally)
K, a = CyclotomicRealSubfield(8, "a") # x^2 - 2
z = 9278908160780559301//4*a+6561375391013480455//2
diff --git a/test/NumField/NfAbs/MPolyAbsFact.jl b/test/NumField/NfAbs/MPolyAbsFact.jl
index 138fcca4ca..01ed7e7d33 100644
--- a/test/NumField/NfAbs/MPolyAbsFact.jl
+++ b/test/NumField/NfAbs/MPolyAbsFact.jl
@@ -3,7 +3,7 @@
f = Hecke.MPolyFact.example(wildanger_field(3, 13)[1], 3, 5)
@test length(factor_absolute(f)) >= 2
- f = Hecke.MPolyFact.example(cyclotomic_field(4)[1], 3, 5)
+ f = Hecke.MPolyFact.example(cyclotomic_field(4)[1], 3, 5)
@test length(factor_absolute(f)) >= 2
@test length(factor(f, ComplexField(40)).fac) >= 2
diff --git a/test/QuadForm/Genus.jl b/test/QuadForm/Genus.jl
index f17a471953..22d8169ea9 100644
--- a/test/QuadForm/Genus.jl
+++ b/test/QuadForm/Genus.jl
@@ -13,7 +13,7 @@
GG = G[1]
u = @inferred uniformizer(GG)
@assert parent(u) == K
-
+
p = prime_decomposition(maximal_order(K), 17)[1][1]
G = @inferred local_genera_hermitian(L, p, 5, 5, 5)
@test length(G) == 7
@@ -21,7 +21,7 @@
@test rank(G[i]) == 5
@test (@inferred representative(G[i])) in G[i]
end
-
+
K, a = CyclotomicRealSubfield(8, "a")
Kt, t = K["t"]
L, b = number_field(t^2 - gen(K) * t + 1)
@@ -62,7 +62,7 @@
end
# Representatives
-
+
Qx, x = FlintQQ["x"]
K, a = NumberField(x - 1, "a")
Kt, t = K["t"]
@@ -108,7 +108,7 @@
@test length(Hecke.local_genera_quadratic(K, p, rank = 2, det_val = 1)) == 8
# Addition of genera
-
+
K, a = CyclotomicRealSubfield(8, "a")
Kt, t = PolynomialRing(K, "t")
L, b = number_field(t^2 - gen(K) * t + 1)
diff --git a/test/QuadForm/Lattices.jl b/test/QuadForm/Lattices.jl
index 924f43518a..5d9b22af75 100644
--- a/test/QuadForm/Lattices.jl
+++ b/test/QuadForm/Lattices.jl
@@ -56,7 +56,7 @@
V = hermitian_space(L, L(a) * identity_matrix(L, 3))
M = @inferred Hecke.maximal_integral_lattice(V)
@test Hecke.genus(M, p) == genus(HermLat, L, p, [(-2, 2, 1, 0), (0, 1, -1, 0)])
-
+
V = hermitian_space(L, L(10) * identity_matrix(L, 3))
M = @inferred Hecke.maximal_integral_lattice(V)
@test Hecke.genus(M, p) == genus(HermLat, L, p, [(-2, 2, 1, 0), (0, 1, 1, 0)])
diff --git a/test/QuadForm/Quad/GenusRep.jl b/test/QuadForm/Quad/GenusRep.jl
index b0646f9074..0e9d070a38 100644
--- a/test/QuadForm/Quad/GenusRep.jl
+++ b/test/QuadForm/Quad/GenusRep.jl
@@ -71,7 +71,7 @@
# Rank 2 case
# This is the Zlattice with basis [1 2; 3 4]
-
+
Qx, x = PolynomialRing(FlintQQ, "x", cached = false)
f = x - 1;
K, a = number_field(f)
diff --git a/test/QuadForm/Quad/NormalForm.jl b/test/QuadForm/Quad/NormalForm.jl
index 093c5384b3..43de81f0d4 100644
--- a/test/QuadForm/Quad/NormalForm.jl
+++ b/test/QuadForm/Quad/NormalForm.jl
@@ -22,25 +22,25 @@ end
for R in [ZZ, GF(3)]
W = R[1;]
V = R[0 1; 1 0]
-
+
L = diagonal_matrix([W, V])
@test (@inferred diagonal_matrix(Hecke.collect_small_blocks(L))) == L
-
+
L = diagonal_matrix([W, W])
@test diagonal_matrix(Hecke.collect_small_blocks(L)) == L
-
+
L = diagonal_matrix([W, V, W])
@test diagonal_matrix(Hecke.collect_small_blocks(L)) == L
-
+
L = diagonal_matrix([W])
@test diagonal_matrix(Hecke.collect_small_blocks(L)) == L
-
+
L = diagonal_matrix([V])
@test diagonal_matrix(Hecke.collect_small_blocks(L)) == L
-
+
L = diagonal_matrix([V, W, W, V, V, W, W])
@test diagonal_matrix(Hecke.collect_small_blocks(L)) == L
-
+
L = zero_matrix(ZZ, 0, 0)
@test Hecke.collect_small_blocks(L) == typeof(L)[]
end
diff --git a/test/QuadForm/Quad/ZGenus.jl b/test/QuadForm/Quad/ZGenus.jl
index 85daee7278..93b97febbb 100644
--- a/test/QuadForm/Quad/ZGenus.jl
+++ b/test/QuadForm/Quad/ZGenus.jl
@@ -247,7 +247,7 @@
G2 = genus(L2)
@test G==G2
end
-
+
for d in 1:(long_test ? 400 : 10)
for sig in [(2,0), (1,1), (0,3),(1,2), (4,0), (2,2)]
for G in genera(sig, d)
diff --git a/test/QuadForm/Torsion.jl b/test/QuadForm/Torsion.jl
index 182dfb645c..924556f7d3 100644
--- a/test/QuadForm/Torsion.jl
+++ b/test/QuadForm/Torsion.jl
@@ -74,7 +74,7 @@
@test Hecke.gram_matrix_quadratic(Hecke.rescale(t, 3)) == matrix(QQ, 2, 2, [1,0,0,1//3])
#The next form is defined modulo `4`
@test Hecke.gram_matrix_quadratic(Hecke.rescale(t, 4)) == matrix(QQ, 2, 2, [4//3,0,0,4//9])
-
+
#test for normal form
L1 = Zlattice(gram=matrix(ZZ, [[-2,0,0],[0,1,0],[0,0,4]]))
@@ -98,13 +98,13 @@
L3 = Zlattice(gram=matrix(ZZ, [[2,0,0,-1],[0,2,0,-1],[0,0,2,-1],[-1,-1,-1,2]]))
T=torsion_quadratic_module((1//6)*dual(L3), L3)
n3 = normal_form(T)[1]
- g3 = QQ[1//6 1//12 0 0 0 0 0 0;
- 1//12 1//6 0 0 0 0 0 0;
- 0 0 1//12 1//24 0 0 0 0;
- 0 0 1//24 1//12 0 0 0 0;
- 0 0 0 0 1//9 0 0 0;
- 0 0 0 0 0 1//9 0 0;
- 0 0 0 0 0 0 1//9 0;
+ g3 = QQ[1//6 1//12 0 0 0 0 0 0;
+ 1//12 1//6 0 0 0 0 0 0;
+ 0 0 1//12 1//24 0 0 0 0;
+ 0 0 1//24 1//12 0 0 0 0;
+ 0 0 0 0 1//9 0 0 0;
+ 0 0 0 0 0 1//9 0 0;
+ 0 0 0 0 0 0 1//9 0;
0 0 0 0 0 0 0 1//9]
@test Hecke.gram_matrix_quadratic(n3) == g3
T2 = torsion_quadratic_module((1//6)*dual(L3), L3, modulus=fmpq(1//36))
@@ -121,7 +121,7 @@
#test for brown invariant
L1 = Zlattice(gram=matrix(ZZ, [[2,-1,0,0],[-1,2,-1,-1],[0,-1,2,0],[0,-1,0,2]]))
- T1 = discriminant_group(L1)
+ T1 = discriminant_group(L1)
@test Hecke.brown_invariant(T1) == 4
L2 = Zlattice(matrix(ZZ, 2,2,[4,2,2,4]))
T2 = Hecke.discriminant_group(L2)
@@ -143,7 +143,7 @@
D = discriminant_group(L)
@test_throws ErrorException isgenus(D, (4,0))
L1 = Zlattice(gram=matrix(ZZ, [[2, -1, 0, 0, 0, 0],[-1, 2, -1, -1, 0, 0],[0, -1, 2, 0, 0, 0],[0, -1, 0, 2, 0, 0],[0, 0, 0, 0, 6, 3],[0, 0, 0, 0, 3, 6]]))
- T1 = discriminant_group(L1)
+ T1 = discriminant_group(L1)
@test isgenus(T1, (6,0)) == true
@test isgenus(T1, (4,2)) == false
@test isgenus(T1, (16,2)) == true
diff --git a/test/RCF/conductor_sieve.jl b/test/RCF/conductor_sieve.jl
index 2992217c7f..be9a34f38d 100644
--- a/test/RCF/conductor_sieve.jl
+++ b/test/RCF/conductor_sieve.jl
@@ -1,7 +1,7 @@
@testset "RCF" begin
@testset "abelian extensions && related examples" begin
-
+
Qx, x = PolynomialRing(FlintQQ, "x")
K, a = NumberField(x - 1, "a")
l = Hecke.abelian_normal_extensions(K, Int[2,2], fmpz(10)^4)
@@ -9,7 +9,7 @@
l1 = collect(Hecke.C22_extensions(10^4))
@test length(l1)==47
@test length(abelian_fields(FlintQQ, [3], fmpz(10)^3)) == 5
-
+
K, a = number_field(x^2+1, "a")
auts = small_generating_set(automorphisms(K, copy = false))
l = Hecke.abelian_normal_extensions(K, Int[2], fmpz(10)^5)
diff --git a/test/RCF/rcf.jl b/test/RCF/rcf.jl
index 3ead4c4ef3..d586e41608 100644
--- a/test/RCF/rcf.jl
+++ b/test/RCF/rcf.jl
@@ -42,13 +42,13 @@
L2 = number_field(H, using_stark_units = true, redo = true)
@test isisomorphic(Hecke.simplified_absolute_field(L1)[1], Hecke.simplified_absolute_field(L2)[1])[1]
@test length(closure(Hecke.absolute_automorphism_group(H), *)) == 10
-
+
r, mr = Hecke.ray_class_groupQQ(Z, 32, true, 8);
q, mq = quo(r, [r[1]])
C = ray_class_field(mr, mq)
KC = number_field(C)
auts = Hecke.rel_auto(C)
- @test length(closure(auts, *)) == 8
+ @test length(closure(auts, *)) == 8
k, a = wildanger_field(3, 13)
zk = maximal_order(k)
@@ -56,7 +56,7 @@
@test degree(r0) == 9
r1 = ray_class_field(4*zk, n_quo = 2)
r2 = ray_class_field(5*zk, n_quo = 2)
- @test isone(conductor(intersect(r1, r2))[1])
+ @test isone(conductor(intersect(r1, r2))[1])
@test conductor(r1 * r2)[1] == 20*zk
@test Hecke.issubfield(r1, r1*r2)
@test !Hecke.issubfield(r0, r1*r2)
@@ -88,7 +88,7 @@
K, _ = compositum(k, wildanger_field(3, 13)[1])
A = maximal_abelian_subfield(ClassField, K)
@test degree(A) == 2
- @test degree(intersect(A, cyclotomic_field(ClassField, 10))) == 1
+ @test degree(intersect(A, cyclotomic_field(ClassField, 10))) == 1
end
@testset "Some abelian extensions" begin
diff --git a/test/Sparse/Matrix.jl b/test/Sparse/Matrix.jl
index 5e7d28dd12..da6e4c2574 100644
--- a/test/Sparse/Matrix.jl
+++ b/test/Sparse/Matrix.jl
@@ -5,7 +5,7 @@ using SparseArrays
M = SMatSpace(R, 3, 3)
@test R == @inferred base_ring(M)
-
+
A = identity_matrix(FlintZZ, 3)
Asparse = sparse_matrix(A)
@@ -145,7 +145,7 @@ using SparseArrays
v = fmpz[1 1 1; 1 2 3; 0 0 4; 0 0 0]
w = @inferred mul(D, view(v, 2:4, :))
@test w == fmpz[1 2 23; 0 0 0; 0 0 4]
-
+
v = matrix(FlintZZ, fmpz[1 2 3; 0 0 4; 0 0 0])
w = @inferred mul(D, v)
@test w == matrix(FlintZZ, fmpz[1 2 23; 0 0 0; 0 0 4])