From 809b699136dea42257644824ab5542b7d16cdea7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 1 Nov 2023 17:38:48 +0100 Subject: [PATCH] Replace more uses of isFOO by is_foo --- docs/src/abelian/introduction.md | 4 +- src/AlgAss/AbsAlgAss.jl | 2 +- src/AlgAss/Ramification.jl | 28 ++++++------- src/AlgAssAbsOrd/Ideal.jl | 2 +- src/AlgAssAbsOrd/PIP.jl | 22 +++++----- src/AlgAssAbsOrd/UnitGroup.jl | 10 ++--- src/Aliases.jl | 1 - src/EllCrv/EllCrv.jl | 2 +- src/EllCrv/Heights.jl | 4 +- src/EllCrv/LocalData.jl | 2 +- src/EllCrv/ModularPolynomials.jl | 2 +- src/EllCrv/Torsion.jl | 2 +- src/GrpAb/GrpAbFinGen.jl | 18 ++++----- src/HypellCrv/HypellCrv.jl | 56 +++++++++++++------------- src/Misc/Poly.jl | 2 +- src/NumField/Selmer.jl | 24 +++++------ src/NumFieldOrd/NfOrd/Ideal/Prime.jl | 2 +- src/NumFieldOrd/NfOrd/LinearAlgebra.jl | 2 +- src/QuadForm/Herm/Lattices.jl | 6 +-- src/QuadForm/Quad/GenusRep.jl | 6 +-- src/QuadForm/Quad/Spaces.jl | 2 +- test/AlgAssAbsOrd/Order.jl | 12 +++--- test/GrpAb/GrpAbFinGen.jl | 8 ++-- test/Misc/Poly.jl | 4 +- 24 files changed, 110 insertions(+), 113 deletions(-) diff --git a/docs/src/abelian/introduction.md b/docs/src/abelian/introduction.md index 7ecb0cf277..ad6e1ba1ae 100644 --- a/docs/src/abelian/introduction.md +++ b/docs/src/abelian/introduction.md @@ -56,12 +56,12 @@ is_snf(A::GrpAbFinGen) ngens(A::GrpAbFinGen) nrels(G::GrpAbFinGen) rels(A::GrpAbFinGen) -isfinite(A::GrpAbFinGen) +is_finite(A::GrpAbFinGen) is_infinite(A::GrpAbFinGen) rank(A::GrpAbFinGen) order(A::GrpAbFinGen) exponent(A::GrpAbFinGen) -istrivial(A::GrpAbFinGen) +is_trivial(A::GrpAbFinGen) is_torsion(G::GrpAbFinGen) is_cyclic(G::GrpAbFinGen) elementary_divisors(G::GrpAbFinGen) diff --git a/src/AlgAss/AbsAlgAss.jl b/src/AlgAss/AbsAlgAss.jl index fca4840b99..0d52993b4d 100644 --- a/src/AlgAss/AbsAlgAss.jl +++ b/src/AlgAss/AbsAlgAss.jl @@ -469,7 +469,7 @@ Given an étale algebra $A$, return the simple components of $A$ as fields $K$ together with the projection $A \to K$. """ function components(::Type{Field}, A::AbsAlgAss) - @assert iscommutative(A) + @assert is_commutative(A) return as_number_fields(A) end diff --git a/src/AlgAss/Ramification.jl b/src/AlgAss/Ramification.jl index 39d6f1bd54..cbc6ac442d 100644 --- a/src/AlgAss/Ramification.jl +++ b/src/AlgAss/Ramification.jl @@ -56,7 +56,7 @@ function is_split(A::AbsAlgAss{nf_elem}) end function is_split(A::AbsAlgAss, P::InfPlc) - if iscomplex(P) + if is_complex(P) return true end return schur_index(A, P) == 1 @@ -116,8 +116,8 @@ Determine the Schur index of $A$ at $p$, where $p$ is either a prime or `inf`. schur_index(A::AbsAlgAss{QQFieldElem}, ::Union{IntegerUnion, PosInf}) function schur_index(A::AbsAlgAss{QQFieldElem}, ::PosInf) - @req iscentral(A) "Algebra must be central" - @req issimple(A) "Algebra must be simple" + @req is_central(A) "Algebra must be central" + @req is_simple(A) "Algebra must be simple" dim(A) % 4 == 0 || return 1 @@ -132,8 +132,8 @@ function schur_index(A::AbsAlgAss{QQFieldElem}, ::PosInf) end function schur_index(A::AbsAlgAss{nf_elem}, P::InfPlc) - @req iscentral(A) "Algebra must be central" - @req issimple(A) "Algebra must be simple" + @req is_central(A) "Algebra must be central" + @req is_simple(A) "Algebra must be simple" dim(A) % 4 == 0 && is_real(P) || return 1 @@ -150,8 +150,8 @@ end # Schur Index at p function schur_index(A::AbsAlgAss, p::IntegerUnion) - @req iscentral(A) "Algebra must be central" - @req issimple(A) "Algebra must be simple" + @req is_central(A) "Algebra must be central" + @req is_simple(A) "Algebra must be simple" d = discriminant(maximal_order(A)) v = valuation(d, p) @@ -164,8 +164,8 @@ function schur_index(A::AbsAlgAss, p::IntegerUnion) end function schur_index(A::AbsAlgAss{<: NumFieldElem}, p::NumFieldOrdIdl) - @req iscentral(A) "Algebra must be central" - @req issimple(A) "Algebra must be simple" + @req is_central(A) "Algebra must be central" + @req is_simple(A) "Algebra must be simple" M = maximal_order(A) d = discriminant(maximal_order(A)) @@ -206,7 +206,7 @@ end ################################################################################ function is_eichler(A::AbsAlgAss) - if issimple(A) && iscentral(A) + if is_simple(A) && is_central(A) return _is_eichler_csa(A) end d = decompose(A) @@ -222,8 +222,8 @@ end # Tests whether A fulfils the Eichler condition relative to the maximal Z-order # of base_ring(A) function _is_eichler_csa(A::AbsAlgAss{nf_elem}) - @assert issimple(A) - @assert iscentral(A) + @assert is_simple(A) + @assert is_central(A) if !istotally_real(base_ring(A)) return true @@ -244,8 +244,8 @@ function _is_eichler_csa(A::AbsAlgAss{nf_elem}) end function _is_eichler_csa(A::AbsAlgAss{QQFieldElem}) - @assert issimple(A) - @assert iscentral(A) + @assert is_simple(A) + @assert is_central(A) if dim(A) != 4 return true end diff --git a/src/AlgAssAbsOrd/Ideal.jl b/src/AlgAssAbsOrd/Ideal.jl index 4465dc422e..9aff85cc76 100644 --- a/src/AlgAssAbsOrd/Ideal.jl +++ b/src/AlgAssAbsOrd/Ideal.jl @@ -1781,7 +1781,7 @@ Returns the prime ideal factorization of $I$ as a dictionary. function factor(I::AlgAssAbsOrdIdl) @assert is_commutative(algebra(I)) O = order(I) - @hassert :AlgAssOrd ismaximal(O) + @hassert :AlgAssOrd is_maximal(O) A = algebra(O) fields_and_maps = as_number_fields(A) @hassert :AlgAssOrd _test_ideal_sidedness(I, O, :left) diff --git a/src/AlgAssAbsOrd/PIP.jl b/src/AlgAssAbsOrd/PIP.jl index 77f7ec64b9..84fe12c8f4 100644 --- a/src/AlgAssAbsOrd/PIP.jl +++ b/src/AlgAssAbsOrd/PIP.jl @@ -2439,7 +2439,7 @@ function __isprincipal(O, I, side = :right, _alpha = nothing) for (B, mB) in dec MinB = Order(B, elem_type(B)[(mB\(mB(one(B)) * elem_in_algebra(b))) for b in absolute_basis(M)]) - #@show ismaximal(MinC) + #@show is_maximal(MinC) #@show hnf(basis_matrix(MinC)) IMinB = ideal_from_lattice_gens(B, elem_type(B)[(mB\(b)) for b in absolute_basis(IM)]) IMinB_basis = [mB(u) for u in absolute_basis(IMinB)] @@ -2537,7 +2537,7 @@ function __isprincipal(O, I, side = :right, _alpha = nothing) indices_nonintegral = Vector{Int}[Int[] for i in 1:l] for j in 1:length(local_coeffs[end]) for i in o:(o + l - 1) - if isintegral(local_coeffs[end][j][i]) + if is_integral(local_coeffs[end][j][i]) push!(indices_integral[i - o + 1], j) else push!(indices_nonintegral[i - o + 1], j) @@ -2613,9 +2613,9 @@ function _old_optimization(dd, local_coeffs, dec, bases_offsets_and_lengths, H, end #@show vtemp #@assert vtemp == reduce(.+, (local_coeffs[j][idx[j]] for j in 1:length(dec) - 1)) - if any(!isintegral, @view vtemp[1:bases_offsets_and_lengths[end][1] - 1]) + if any(!is_integral, @view vtemp[1:bases_offsets_and_lengths[end][1] - 1]) l += 1 - j = findfirst([any(!isintegral, vtemp[bases_offsets_and_lengths[j][1]:bases_offsets_and_lengths[j + 1][1] - 1]) for j in 1:length(dec) - 1]) + j = findfirst([any(!is_integral, vtemp[bases_offsets_and_lengths[j][1]:bases_offsets_and_lengths[j + 1][1] - 1]) for j in 1:length(dec) - 1]) ll[j] += 1 continue else @@ -2623,7 +2623,7 @@ function _old_optimization(dd, local_coeffs, dec, bases_offsets_and_lengths, H, end o = bases_offsets_and_lengths[end][1] l = bases_offsets_and_lengths[end][2] - ids = reduce(intersect, [isintegral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i] for i in 1:l]) + ids = reduce(intersect, [is_integral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i] for i in 1:l]) _vtempcopy = deepcopy(vtemp) #@show length(ids) for j in ids @@ -2631,7 +2631,7 @@ function _old_optimization(dd, local_coeffs, dec, bases_offsets_and_lengths, H, # ccall((:fmpq_set, libflint), Ref{Nothing}, (Ref{QQFieldElem}, Ref{QQFieldElem}), vtemp[i], _vtempcopy[i]) #end _vtemp = deepcopy(vtemp) .+ local_coeffs[end][j] - if all(isintegral, _vtemp) + if all(is_integral, _vtemp) @vprintln :PIP "found x = $((idx...,j))" return true, A(_vtemp * (H * special_basis_matrix)) end @@ -2653,18 +2653,18 @@ function _recursive_iterator!(x, lengths, d, elts::Vector, bases_offsets, indice # We do something clever for the indices o = bases_offsets[end][1] l = bases_offsets[end][2] - ids = copy(isintegral(vtemp[o]) ? indices_integral[1] : indices_nonintegral[1]) + ids = copy(is_integral(vtemp[o]) ? indices_integral[1] : indices_nonintegral[1]) for i in 2:l - intersect!(ids, isintegral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i]) + intersect!(ids, is_integral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i]) end - #ids2 = reduce(intersect!, (isintegral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i] for i in 1:l)) + #ids2 = reduce(intersect!, (is_integral(vtemp[o - 1 + i]) ? indices_integral[i] : indices_nonintegral[i] for i in 1:l)) #@assert ids == ids2 for j in ids # 1:lengths[i] x[i] = j if _is_admissible(x, i, d, elts, bases_offsets, vtemp) - #@assert all(isintegral, reduce(.+, (elts[k][x[k]] for k in 1:length(elts)))) + #@assert all(is_integral, reduce(.+, (elts[k][x[k]] for k in 1:length(elts)))) return true end #if _is_admissible(x, i, d, elts, bases_offsets) @@ -2716,7 +2716,7 @@ function _is_admissible(x, i, d, elts, bases_offsets, vtemp) vvtemp = @view vtemp[bases_offsets[i][1]:(bases_offsets[i][1] + bases_offsets[i][2] - 1)] - if any(!isintegral, vvtemp) + if any(!is_integral, vvtemp) return false else return true diff --git a/src/AlgAssAbsOrd/UnitGroup.jl b/src/AlgAssAbsOrd/UnitGroup.jl index d748017cb7..a7380529a8 100644 --- a/src/AlgAssAbsOrd/UnitGroup.jl +++ b/src/AlgAssAbsOrd/UnitGroup.jl @@ -5,9 +5,9 @@ ################################################################################ function unit_group(O::AlgAssAbsOrd) - @assert iscommutative(O) + @assert is_commutative(O) mU = get_attribute!(O, :unit_group) do - if ismaximal(O) + if is_maximal(O) U, mU = _unit_group_maximal(O) else OK = maximal_order(O) @@ -20,9 +20,9 @@ function unit_group(O::AlgAssAbsOrd) end function unit_group_fac_elem(O::AlgAssAbsOrd) - @assert iscommutative(O) + @assert is_commutative(O) mU = get_attribute!(O, :unit_group_fac_elem) do - if ismaximal(O) + if is_maximal(O) U, mU = _unit_group_maximal_fac_elem(O) else OK = maximal_order(O) @@ -192,7 +192,7 @@ function unit_group_positive(O::AlgAssAbsOrd, rlpl) uinK = co[i][2](u) for r in rlpl[i] @assert number_field(r) === co[i][1] - if ispositive(uinK, r) + if is_positive(uinK, r) push!(imu, 0) else push!(imu, 1) diff --git a/src/Aliases.jl b/src/Aliases.jl index 2a36e7be37..d02747b20e 100644 --- a/src/Aliases.jl +++ b/src/Aliases.jl @@ -1,5 +1,4 @@ # make some Julia names compatible with our naming conventions -@alias is_trivial istrivial @alias is_hermitian ishermitian # for backwards compatibility diff --git a/src/EllCrv/EllCrv.jl b/src/EllCrv/EllCrv.jl index b68887b550..c9e88b081b 100644 --- a/src/EllCrv/EllCrv.jl +++ b/src/EllCrv/EllCrv.jl @@ -299,7 +299,7 @@ y^2 + x*y = x^3 + x + 1 ``` """ function elliptic_curve(f::PolyRingElem{T}, h::PolyRingElem{T} = zero(parent(f)); check::Bool = true) where T - @req ismonic(f) "First polynomial must be monic" + @req is_monic(f) "First polynomial must be monic" @req degree(f) == 3 "First polynomial must be of degree 3" @req degree(h) <= 1 "Second polynomial must be of degree at most 1" R = base_ring(f) diff --git a/src/EllCrv/Heights.jl b/src/EllCrv/Heights.jl index cff1143ae9..9220081e77 100644 --- a/src/EllCrv/Heights.jl +++ b/src/EllCrv/Heights.jl @@ -151,7 +151,7 @@ function local_height(P::EllCrvPt{QQFieldElem}, p, prec::Int = 100) return _real_height(P, prec) end - @req p > 0 && isprime(p) "p must be 0 or a non-negative prime" + @req p > 0 && is_prime(p) "p must be 0 or a non-negative prime" E = parent(P) F, phi = minimal_model(E) @@ -224,7 +224,7 @@ function local_height(P::EllCrvPt{nf_elem}, pIdeal::NfOrdIdl, prec::Int = 100) # return _real_height(P, prec) #end - @req #=p > 0 &&=# isprime(pIdeal) "p must be 0 or a non-negative prime" + @req #=p > 0 &&=# is_prime(pIdeal) "p must be 0 or a non-negative prime" E = parent(P) K = base_field(E) diff --git a/src/EllCrv/LocalData.jl b/src/EllCrv/LocalData.jl index 32ecfa27fa..3875802d1e 100644 --- a/src/EllCrv/LocalData.jl +++ b/src/EllCrv/LocalData.jl @@ -1138,7 +1138,7 @@ end Return the reduction of $E$ modulo the prime ideal p if p has good reduction """ function modp_reduction(E::EllCrv{nf_elem}, p::NfOrdIdl) - if !isprime(p) + if !is_prime(p) throw(DomainError(p,"p is not a prime ideal")) end diff --git a/src/EllCrv/ModularPolynomials.jl b/src/EllCrv/ModularPolynomials.jl index 50f9628320..60e142174e 100644 --- a/src/EllCrv/ModularPolynomials.jl +++ b/src/EllCrv/ModularPolynomials.jl @@ -58,7 +58,7 @@ function atkin_modular_polynomial(n::Int) end function atkin_modular_polynomial(R::MPolyRing, n::Int) - @req isprime(n) "Level ($n) must be prime" + @req is_prime(n) "Level ($n) must be prime" @req 1 <= n <= 400 "Database only contains Atkin modular polynomials up to level 400" get!(_atkin_modular_polynomial_cache, (R, n)) do open(joinpath(default_atkin_mod_pol_db, "$n")) do io diff --git a/src/EllCrv/Torsion.jl b/src/EllCrv/Torsion.jl index 6ff0179dd0..b3a9cab161 100644 --- a/src/EllCrv/Torsion.jl +++ b/src/EllCrv/Torsion.jl @@ -392,7 +392,7 @@ having found a basis that spans p^r points. """ function pr_torsion_basis(E::EllCrv{T}, p, r = typemax(Int)) where T <: Union{nf_elem, QQFieldElem} - if !isprime(p) + if !is_prime(p) error("p should be a prime number") end diff --git a/src/GrpAb/GrpAbFinGen.jl b/src/GrpAb/GrpAbFinGen.jl index f0b2e7fef7..9d468a5a65 100644 --- a/src/GrpAb/GrpAbFinGen.jl +++ b/src/GrpAb/GrpAbFinGen.jl @@ -32,10 +32,8 @@ # ################################################################################ -import AbstractAlgebra.GroupsCore: istrivial - export abelian_group, free_abelian_group, is_snf, ngens, nrels, rels, snf, isfinite, - is_infinite, rank, order, exponent, istrivial, is_isomorphic, + is_infinite, rank, order, exponent, is_trivial, is_isomorphic, direct_product, is_torsion, torsion_subgroup, sub, quo, is_cyclic, psylow_subgroup, is_subgroup, abelian_groups, flat, tensor_product, dual, chain_complex, is_exact, free_resolution, obj, map, @@ -563,11 +561,11 @@ exponent_gen(A::GrpAbFinGen) = exponent(snf(A)[1]) ################################################################################ @doc raw""" - istrivial(A::GrpAbFinGen) -> Bool + is_trivial(A::GrpAbFinGen) -> Bool Return whether $A$ is the trivial group. """ -istrivial(A::GrpAbFinGen) = isfinite(A) && isone(order(A)) +is_trivial(A::GrpAbFinGen) = isfinite(A) && isone(order(A)) ################################################################################ # @@ -644,7 +642,7 @@ For finite abelian groups, finite direct sums and finite direct products agree a they are therefore called biproducts. If one wants to obtain $D$ as a direct sum together with the injections $G_i \to D$, one should call `direct_sum(G...)`. -If one wants to obtain $D$ as a direct product together with the projections $D \to G_i$, +If one wants to obtain $D$ as a direct product together with the projections $D \to G_i$, one should call `direct_product(G...)`. Otherwise, one could also call `canonical_injections(D)` or `canonical_projections(D)` @@ -723,7 +721,7 @@ end ⊕(A::GrpAbFinGen...) = direct_sum(A..., task = :none) export ⊕ -#TODO: use matrices as above - or design special maps that are not tied +#TODO: use matrices as above - or design special maps that are not tied # to matrices but operate directly. @doc raw""" canonical_injections(G::GrpAbFinGen) -> Vector{GrpAbFinGenMap} @@ -736,7 +734,7 @@ function canonical_injections(G::GrpAbFinGen) D === nothing && error("1st argument must be a direct product") return [canonical_injection(G, i) for i=1:length(D)] end - + @doc raw""" canonical_injection(G::GrpAbFinGen, i::Int) -> GrpAbFinGenMap @@ -762,7 +760,7 @@ function canonical_projections(G::GrpAbFinGen) D === nothing && error("1st argument must be a direct product") return [canonical_projection(G, i) for i=1:length(D)] end - + @doc raw""" canonical_projection(G::GrpAbFinGen, i::Int) -> GrpAbFinGenMap @@ -2071,7 +2069,7 @@ end has_complement(f::GrpAbFinGenMap) -> Bool, GrpAbFinGenMap has_complement(U::GrpAbFinGen, G::GrpAbFinGen) -> Bool, GrpAbFinGenMap -Given a map representing a subgroup of a group $G$, +Given a map representing a subgroup of a group $G$, or a subgroup `U` of a group `G`, return either true and an injection of a complement in $G$, or false. diff --git a/src/HypellCrv/HypellCrv.jl b/src/HypellCrv/HypellCrv.jl index e92e263e3c..2e0d39833d 100644 --- a/src/HypellCrv/HypellCrv.jl +++ b/src/HypellCrv/HypellCrv.jl @@ -29,14 +29,14 @@ mutable struct HypellCrv{T} n = degree(f) m = degree(h) g = div(degree(f) - 1, 2) - if g < 0 + if g < 0 error("Curve has to be of positive genus") end if m > g + 1 error("h has to be of degree smaller than g + 2.") end R = base_ring(f) - + if characteristic(R) == 2 check = false end @@ -45,16 +45,16 @@ mutable struct HypellCrv{T} if d != 0 && check C = new{T}() - + C.f = f C.h = h C.g = g C.disc = d C.base_field = R - + coeff_f = coefficients(f) coeff_h = coefficients(h) - + Rxz, (x, z) = polynomial_ring(R, ["x", "z"]) f_hom = sum([coeff_f[i]*x^i*z^(2*g + 2 - i) for i in (0:n)];init = zero(Rxz)) h_hom = sum([coeff_h[i]*x^i*z^(g + 1 - i) for i in (0:m)];init = zero(Rxz)) @@ -84,40 +84,40 @@ mutable struct HypellCrvPt{T} error("Point is not on the curve") end end - - P.parent = C - if coords[3] == 0 + + P.parent = C + if coords[3] == 0 P.coordx = coords[1] P.coordy = coords[2] P.coordz = coords[3] P.is_infinite = true else P.is_infinite = false - + #Don't have numerators, denominators and gcd over finite fields if T <: FinFieldElem - + scalar = inv(coords[3]) - + P.coordx = coords[1]*scalar P.coordy = coords[2]*scalar^(g+1) P.coordz = coords[3]*scalar else - + #Eliminate denominators x = numerator(coords[1]) * denominator(coords[3]) y = coords[2] * (denominator(coords[3]) * denominator(coords[1]))^(g + 1) z = numerator(coords[3]) * denominator(coords[1]) - + c = gcd(x, z) - + #Eliminate gcd - if c!= 1 + if c!= 1 x = divexact(x, c) - y = divexact(y, c^(g+1)) + y = divexact(y, c^(g+1)) z = divexact(z, c) end - + P.coordx = K(x) P.coordy = K(y) P.coordz = K(z) @@ -129,7 +129,7 @@ end function Base.getindex(P::HypellCrvPt, i::Int) @req 1 <= i <= 3 "Index must be 1, 2 or 3" - + if i == 1 return P.coordx elseif i == 2 @@ -148,12 +148,12 @@ end @doc raw""" HyperellipticCurve(f::PolyRingElem, g::PolyRingElem; check::Bool = true) -> HypellCrv -Return the hyperelliptic curve $y^2 + h(x)y = f(x)$. The polynomial $f$ -must be monic of degree 2g + 1 > 3 or of degree 2g + 2 > 4 and the +Return the hyperelliptic curve $y^2 + h(x)y = f(x)$. The polynomial $f$ +must be monic of degree 2g + 1 > 3 or of degree 2g + 2 > 4 and the polynomial h must be of degree < g + 2. Here g will be the genus of the curve. """ function HyperellipticCurve(f::PolyRingElem{T}, h::PolyRingElem{T}; check::Bool = true) where T <: FieldElem - @req ismonic(f) "Polynomial must be monic" + @req is_monic(f) "Polynomial must be monic" @req degree(f) >= 3 "Polynomial must be of degree 3" return HypellCrv{T}(f, h, check) @@ -166,7 +166,7 @@ Return the hyperelliptic curve $y^2 = f(x)$. The polynomial $f$ must be monic of degree larger than 3. """ function HyperellipticCurve(f::PolyRingElem{T}; check::Bool = true) where T <: FieldElem - @req ismonic(f) "Polynomial must be monic" + @req is_monic(f) "Polynomial must be monic" @req degree(f) >= 3 "Polynomial must be of degree 3" R = parent(f) return HypellCrv{T}(f, zero(R), check) @@ -323,10 +323,10 @@ end ################################################################################ function (C::HypellCrv{T})(coords::Vector{S}; check::Bool = true) where {S, T} - if !(2 <= length(coords) <= 3) + if !(2 <= length(coords) <= 3) error("Points need to be given in either affine coordinates (x, y) or projective coordinates (x, y, z)") end - + if length(coords) == 2 push!(coords, 1) end @@ -363,20 +363,20 @@ Return the points at infinity. function points_at_infinity(C::HypellCrv{T}) where T K = base_field(C) equ = homogeneous_equation(C) - + infi = HypellCrvPt{T}[] if equ(one(K),zero(K), zero(K)) == 0 push!(infi, C([one(K),zero(K), zero(K)])) end - + if equ(one(K),one(K), zero(K)) == 0 push!(infi, C([one(K),one(K), zero(K)])) if characteristic(K)!= 2 push!(infi, C([one(K),- one(K), zero(K)])) end end - + return infi end @@ -444,7 +444,7 @@ function is_on_curve(C::HypellCrv{T}, coords::Vector{T}) where T x = coords[1] y = coords[2] z = coords[3] - + equ = homogeneous_equation(C) equ(x, y, z) if equ(x, y, z) == 0 diff --git a/src/Misc/Poly.jl b/src/Misc/Poly.jl index 9c51860704..355b5b7f1a 100644 --- a/src/Misc/Poly.jl +++ b/src/Misc/Poly.jl @@ -730,7 +730,7 @@ function _roots(f::QQPolyRingElem, ::PosInf; prec::Int=64) g = squarefree_part(f) all_rts = _roots(g, prec) rl_rts = real.(filter(isreal, all_rts)) - compl_rts = filter(x -> !isreal(x) && ispositive(imag(x)), all_rts) + compl_rts = filter(x -> !isreal(x) && is_positive(imag(x)), all_rts) @assert length(rl_rts) + 2 * length(compl_rts) == degree(g) return all_rts, rl_rts, compl_rts end diff --git a/src/NumField/Selmer.jl b/src/NumField/Selmer.jl index 134d572b08..6af4bd2d45 100644 --- a/src/NumField/Selmer.jl +++ b/src/NumField/Selmer.jl @@ -12,7 +12,7 @@ function Base.push!(C::GrpAbFinGen, a::GrpAbFinGenElem) return sub(parent(a), g) end -#TODO: should be exported, but at this point, index is not yet a symbol, so it can't be extended. +#TODO: should be exported, but at this point, index is not yet a symbol, so it can't be extended. #Should move to GrpAb function index(G::GrpAbFinGen, U::GrpAbFinGen; check::Bool = true) return divexact(order(G), order(U)) @@ -57,7 +57,7 @@ true """ function pselmer_group_fac_elem(p::Int, S::Vector{<:NfOrdIdl}; check::Bool = true, algo::Symbol = :raw) @assert all(x->order(x) == order(S[1]), S) - @assert isprime(p) #maybe not necessary + @assert is_prime(p) #maybe not necessary #TODO: need primes above p as well? ZK = order(S[1]) @@ -79,7 +79,7 @@ function pselmer_group_fac_elem(p::Int, S::Vector{<:NfOrdIdl}; check::Bool = tru end p, pos = iterate(P, pos) end - + if length(D) + length(S) == 0 U, mU = Hecke.unit_group_fac_elem(ZK) else @@ -103,9 +103,9 @@ function pselmer_group_fac_elem(p::Int, S::Vector{<:NfOrdIdl}; check::Bool = tru #the forward map has a couple of possibilities: # - take any lift to k, map to U map to K # - U and when mapping to K, reduce exponents - # - use comp. rep. + # - use comp. rep. # - # the backward map is more tricky, but the indirect route via + # the backward map is more tricky, but the indirect route via # class field theory (Frobenius) works for Magma - it should work here. function toK(x::GrpAbFinGenElem; algo::Symbol = algo) @@ -174,14 +174,14 @@ function pselmer_group_fac_elem(p::Int, S::Vector{<:NfOrdIdl}; check::Bool = tru isa(e, BadPrime) || rethrow(e) nothing end - va === nothing && continue + va === nothing && continue disc_log_data[pi] = (mF*pseudo_inv(mu), va) v = try preimage(mu, mF(x))[1] catch e isa(e, Hecke.BadPrime) || rethrow(e) -1 end - v == -1 && continue + v == -1 && continue dx = vcat(dx, matrix(Fp, 1, 1, [v])) dl = vcat(dl, matrix(Fp, 1, ngens(Sel), va)) end @@ -192,15 +192,15 @@ function pselmer_group_fac_elem(p::Int, S::Vector{<:NfOrdIdl}; check::Bool = tru return Sel(map(lift, vec(collect(sol)))) end - return Sel, MapFromFunc(Sel, codomain(mU), toK, toSel) + return Sel, MapFromFunc(Sel, codomain(mU), toK, toSel) end @doc raw""" pselmer_group(p::Int, S::Vector{NfOrdIdl}; check::Bool = true, algo::Symbol = :raw) -Similar to the `pselmer_group_fac_elem`, the difference is that the elements here are evaluated, +Similar to the `pselmer_group_fac_elem`, the difference is that the elements here are evaluated, ie. returned explicitly wrt the basis of the number field. -""" +""" function pselmer_group(p::Int, S::Vector{NfOrdIdl}; check::Bool = true, algo::Symbol = :raw) G, mp = pselmer_group_fac_elem(p, S, check = check, algo = algo) return G, MapFromFunc(G, number_field(order(S[1])), x->evaluate(mp(x)), y->preimage(mp, FacElem([y], ZZRingElem[1]))) @@ -231,7 +231,7 @@ julia> k, mk = kernel(h); """ function pselmer_group_fac_elem(p::Int, S::Vector{ZZRingElem}; algo::Symbol = :raw, check::Bool = true) R = FacElemMon(QQ) - @assert all(x->(x == -1) || isprime(x), S) + @assert all(x->(x == -1) || is_prime(x), S) if -1 in S @assert p == 2 end @@ -274,7 +274,7 @@ function Hecke.is_power(a::FacElem{QQFieldElem, QQField}, p::Int) if v % p != 0 return false end - if !is_power(k, p)[1] + if !is_power(k, p)[1] return false end end diff --git a/src/NumFieldOrd/NfOrd/Ideal/Prime.jl b/src/NumFieldOrd/NfOrd/Ideal/Prime.jl index 1b03dbee66..197a181fc7 100644 --- a/src/NumFieldOrd/NfOrd/Ideal/Prime.jl +++ b/src/NumFieldOrd/NfOrd/Ideal/Prime.jl @@ -1269,7 +1269,7 @@ function primary_decomposition(A::NfOrdIdl) for p = keys(lp) pp = prime_ideals_over(order(A), p) for x = pp - if !iscoprime(x, A) + if !is_coprime(x, A) #TODO: what is the correct exponent here? push!(P, (x^(div(degree(order(A)), flog(norm(x), p))*lp[p]) + A, x)) end diff --git a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl index 0ff99adcb3..79185f0ea7 100644 --- a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl +++ b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl @@ -777,7 +777,7 @@ function _matrix_for_reduced_span(P::PMat, m::NfAbsOrdIdl) @vtime :PseudoHnf 4 I, a = _coprime_norm_integral_ideal_class(P.coeffs[i], m) @hassert :PseudoHnf 1 a * P.coeffs[i] == I @hassert :PseudoHnf is_integral(a * P.coeffs[i]) - @hassert :PseudoHnf iscoprime(norm(I), norm(m)) + @hassert :PseudoHnf is_coprime(norm(I), norm(m)) n = norm(I, copy = false) qq = Om(invmod(n, minimum(m, copy = false))) @hassert :PseudoHnf isone(Om(n) * Om(qq)) diff --git a/src/QuadForm/Herm/Lattices.jl b/src/QuadForm/Herm/Lattices.jl index 07225d6ffe..1d34b1ba52 100644 --- a/src/QuadForm/Herm/Lattices.jl +++ b/src/QuadForm/Herm/Lattices.jl @@ -457,7 +457,7 @@ end # Checks whether L is p-maximal integral. If not, a minimal integral # over-lattice at p is returned -function _ismaximal_integral(L::HermLat, p) +function _is_maximal_integral(L::HermLat, p) R = base_ring(L) E = nf(R) D = prime_decomposition(R, p) @@ -646,7 +646,7 @@ function _maximal_integral_lattice(L::HermLat, p, minimal = true) B, G, S = jordan_decomposition(L, p) end v = valuation(volume(L), P) - ok, x = _ismaximal_integral(L, p) + ok, x = _is_maximal_integral(L, p) while !ok LL = L LLL = pseudo_matrix(x, fractional_ideal_type(R)[invP]) @@ -659,7 +659,7 @@ function _maximal_integral_lattice(L::HermLat, p, minimal = true) return false, L end is_max = false - ok, x = _ismaximal_integral(L, p) + ok, x = _is_maximal_integral(L, p) end @assert iseven(v) v = div(v, 2) diff --git a/src/QuadForm/Quad/GenusRep.jl b/src/QuadForm/Quad/GenusRep.jl index 811656c9c3..876bbbbbe9 100644 --- a/src/QuadForm/Quad/GenusRep.jl +++ b/src/QuadForm/Quad/GenusRep.jl @@ -437,7 +437,7 @@ function maximal_norm_splitting(L, p) sL, aL, uL, wL = _scales_and_norms(G, p, uni) failset_old = failset - b, i, failset = __ismaximal_norm_splitting(G, sL, aL, p) + b, i, failset = __is_maximal_norm_splitting(G, sL, aL, p) @assert isempty(failset_old) || length(failset_old) > length(failset) if b break @@ -1123,7 +1123,7 @@ function _scales_and_norms(G, p, uni) # scales, norm generators, norm valuations, weight valuations of a (Jordan) decomposition of L end -function __ismaximal_norm_splitting(gram_matrices, scales, norms, p) +function __is_maximal_norm_splitting(gram_matrices, scales, norms, p) # Scales: list of valuations of scales # Norms: list of generators of norms # occurring in a Genus symbol of L at p, as calculated by GenusSymbol(L, p). @@ -1165,7 +1165,7 @@ function __ismaximal_norm_splitting(gram_matrices, scales, norms, p) return true, 0, Int[] end -function _ismaximal_norm_splitting(G, p) +function _is_maximal_norm_splitting(G, p) sL, aL, _, _ = scales_and_norms(G, p, uniformizer(p)) return __is_maximal_norm_splitting(G, sL, aL, p) end diff --git a/src/QuadForm/Quad/Spaces.jl b/src/QuadForm/Quad/Spaces.jl index 6273171a4c..a0b0f42ac0 100644 --- a/src/QuadForm/Quad/Spaces.jl +++ b/src/QuadForm/Quad/Spaces.jl @@ -1248,7 +1248,7 @@ function _isotropic_subspace(q::QuadSpace{QQField, QQMatrix}) return false, zero_matrix(QQ, 0, dim(q)) end # treat the degenerate case - if !isregular(q) + if !is_regular(q) g = gram_matrix(q) r, B = left_kernel(g) C = _basis_complement(B) diff --git a/test/AlgAssAbsOrd/Order.jl b/test/AlgAssAbsOrd/Order.jl index 2d4ac451e6..e9d7591f8c 100644 --- a/test/AlgAssAbsOrd/Order.jl +++ b/test/AlgAssAbsOrd/Order.jl @@ -136,11 +136,11 @@ G = small_group(6, 1) QG = QQ[G] ZG = Order(QG, basis(QG)) - @test !ismaximal(ZG) + @test !is_maximal(ZG) # This is not ZG, so we need to also make it maximal at 5 O = Order(QG, [one(QG), 5 * QG(gens(G)[1]), 5 * QG(gens(G)[2])]) - @test !ismaximal(O) + @test !is_maximal(O) @test discriminant(maximal_order(ZG)) == -1 S = overorders(ZG) @@ -150,16 +150,16 @@ for R in S _ = maximal_order(R) end - @test count(ismaximal, S) == 2 + @test count(is_maximal, S) == 2 # Trigger multiple maximal orders in the AlgAss case A, AtoQG = AlgAss(QG) ZG = Order(A, basis(A)) - @test !ismaximal(ZG) + @test !is_maximal(ZG) # This is not ZG, so we need to also make it maximal at 5 O = Order(A, [one(A), 5 * (AtoQG\(QG(gens(G)[1]))), (5 * (AtoQG\(QG(gens(G)[2]))))]) - @test !ismaximal(O) + @test !is_maximal(O) @test discriminant(maximal_order(ZG)) == -1 S = overorders(ZG) @@ -169,7 +169,7 @@ for R in S _ = maximal_order(R) end - @test count(ismaximal, S) == 2 + @test count(is_maximal, S) == 2 A = matrix_algebra(QQ, 6) O = Order(A, basis(A), isbasis = true) diff --git a/test/GrpAb/GrpAbFinGen.jl b/test/GrpAb/GrpAbFinGen.jl index ff5442d452..54cf7022d3 100644 --- a/test/GrpAb/GrpAbFinGen.jl +++ b/test/GrpAb/GrpAbFinGen.jl @@ -160,13 +160,13 @@ @testset "Trivial" begin G = abelian_group([1]) - @test @inferred istrivial(G) + @test @inferred is_trivial(G) G = abelian_group([1, 1, 1]) - @test @inferred istrivial(G) + @test @inferred is_trivial(G) G = abelian_group([3, 3]) - @test @inferred !istrivial(G) + @test @inferred !is_trivial(G) G = abelian_group([3, 5]) - @test @inferred !istrivial(G) + @test @inferred !is_trivial(G) end @testset "Isomorphism" begin diff --git a/test/Misc/Poly.jl b/test/Misc/Poly.jl index 7a809fc8e5..e3cfeaf059 100644 --- a/test/Misc/Poly.jl +++ b/test/Misc/Poly.jl @@ -21,8 +21,8 @@ while p < 4096 l = roots(ArbField(p, cached = false), f) - sgtpos = count(ispositive, l) - sgtneg = count(isnegative, l) + sgtpos = count(is_positive, l) + sgtneg = count(is_negative, l) sgtz = count(iszero, l) if sgtpos + sgtneg + sgtz != length(l) p *= 2