diff --git a/src/RationalFunctionFields/IdealMQS.jl b/src/RationalFunctionFields/IdealMQS.jl index 519254fa..95b9fa06 100644 --- a/src/RationalFunctionFields/IdealMQS.jl +++ b/src/RationalFunctionFields/IdealMQS.jl @@ -229,7 +229,7 @@ end function ParamPunPam.reduce_mod_p!( mqs::IdealMQS, ff::Field, -) where {Field <: Union{Nemo.GaloisField, Nemo.FpField}} +) where {Field <: Union{Nemo.fpField, Nemo.FpField}} @debug "Reducing MQS ideal modulo $(ff)" # If there is a reduction modulo this field already, if haskey(mqs.cached_nums_gf, ff) @@ -251,7 +251,7 @@ function ParamPunPam.specialize_mod_p( mqs::IdealMQS, point::Vector{T}; saturated = true, -) where {T <: Union{fpFieldElem, gfp_fmpz_elem}} +) where {T <: Union{fpFieldElem, FpFieldElem}} K_1 = parent(first(point)) @debug "Evaluating MQS ideal over $K_1 at $point" @assert haskey(mqs.cached_nums_gf, K_1) diff --git a/src/discrete.jl b/src/discrete.jl index 3c2db3dc..9d911793 100644 --- a/src/discrete.jl +++ b/src/discrete.jl @@ -239,7 +239,7 @@ function _assess_local_identifiability_discrete_aux( @debug "Building the matrices" Jac = zero( - Nemo.MatrixSpace( + Nemo.matrix_space( bring, length(dds.x_vars) + length(dds.parameters), 1 + prec * length(dds.y_vars) + length(known_ic), diff --git a/src/elimination.jl b/src/elimination.jl index 24978ca1..426bd924 100644 --- a/src/elimination.jl +++ b/src/elimination.jl @@ -65,7 +65,7 @@ function Bezout_matrix(f::P, g::P, var_elim::P) where {P <: MPolyRingElem} n = max(deg_f, deg_g) coeffs_f = [coeff(f, [var_elim], [i]) for i in 0:n] coeffs_g = [coeff(g, [var_elim], [i]) for i in 0:n] - GL = AbstractAlgebra.MatrixSpace(parent_ring, n, n) + GL = AbstractAlgebra.matrix_space(parent_ring, n, n) M = zero(GL) for i in 1:n for j in 1:n @@ -96,7 +96,7 @@ function Sylvester_matrix(f::P, g::P, var_elim::P) where {P <: MPolyRingElem} deg_f = Nemo.degree(f, var_elim) deg_g = Nemo.degree(g, var_elim) n = deg_f + deg_g - GL = AbstractAlgebra.MatrixSpace(parent_ring, n, n) + GL = AbstractAlgebra.matrix_space(parent_ring, n, n) M = zero(GL) for i in 1:deg_f for j in 0:deg_g @@ -384,7 +384,7 @@ Output: flush(_si_logger[].stream) M_simp, matrix_factors = simplify_matrix(M) @debug "Removed factors $(map(length, matrix_factors))" - M_size = zero(Nemo.MatrixSpace(Nemo.ZZ, ncols(M_simp), ncols(M_simp))) + M_size = zero(Nemo.matrix_space(Nemo.ZZ, ncols(M_simp), ncols(M_simp))) for i in 1:ncols(M_simp) for j in 1:ncols(M_simp) M_size[i, j] = length(M_simp[i, j]) diff --git a/src/local_identifiability.jl b/src/local_identifiability.jl index 2580d2de..875fe7dd 100644 --- a/src/local_identifiability.jl +++ b/src/local_identifiability.jl @@ -41,12 +41,12 @@ function differentiate_solution( @debug "Building the variational system at the solution" # Y' = AY + B vars = vcat(ode.x_vars, ode.parameters) - SA = AbstractAlgebra.MatrixSpace(ps_ring, length(ode.x_vars), length(ode.x_vars)) + SA = AbstractAlgebra.matrix_space(ps_ring, length(ode.x_vars), length(ode.x_vars)) A = SA([ eval_at_dict(derivative(ode.x_equations[vars[i]], vars[j]), ps_sol) for i in 1:length(ode.x_vars), j in 1:length(ode.x_vars) ]) - SB = AbstractAlgebra.MatrixSpace(ps_ring, length(ode.x_vars), length(vars)) + SB = AbstractAlgebra.matrix_space(ps_ring, length(ode.x_vars), length(vars)) B = zero(SB) for i in 1:length(ode.x_vars) for j in (length(ode.x_vars) + 1):length(vars) @@ -55,7 +55,7 @@ function differentiate_solution( end # TODO: make use of one() function (problems modulo prime) initial_condition = - zero(Nemo.MatrixSpace(base_ring(ode.poly_ring), length(ode.x_vars), length(vars))) + zero(Nemo.matrix_space(base_ring(ode.poly_ring), length(ode.x_vars), length(vars))) for i in 1:length(ode.x_vars) initial_condition[i, i] = 1 end @@ -247,7 +247,7 @@ function _assess_local_identifiability( num_exp = 0 # rows are the "parameters": parameters and initial conditions # columns are "observations": derivatives of the outputs - Jac = zero(Nemo.MatrixSpace(F, length(ode.parameters), 1)) + Jac = zero(Nemo.matrix_space(F, length(ode.parameters), 1)) output_derivatives = undef # the while loop is primarily for ME-deintifiability, it is adding replicas until the rank stabilizes # in the SE case, it will exit right away @@ -261,10 +261,10 @@ function _assess_local_identifiability( output_derivatives = differentiate_output(ode_red, params_vals, ic, inputs, prec) @debug "Building the matrices" - newJac = vcat(Jac, zero(Nemo.MatrixSpace(F, length(ode.x_vars), ncols(Jac)))) + newJac = vcat(Jac, zero(Nemo.matrix_space(F, length(ode.x_vars), ncols(Jac)))) newJac = hcat( newJac, - zero(Nemo.MatrixSpace(F, nrows(newJac), prec * length(ode.y_vars))), + zero(Nemo.matrix_space(F, nrows(newJac), prec * length(ode.y_vars))), ) xs_params = vcat(ode_red.x_vars, ode_red.parameters) for (i, y) in enumerate(ode.y_vars) @@ -300,7 +300,7 @@ function _assess_local_identifiability( if !isnothing(trbasis) @debug "Transcendence basis computation requested" - reverted_Jac = zero(Nemo.MatrixSpace(F, size(Jac)[2], size(Jac)[1])) + reverted_Jac = zero(Nemo.matrix_space(F, size(Jac)[2], size(Jac)[1])) for i in 1:size(Jac)[1] for j in 1:size(Jac)[2] reverted_Jac[j, i] = Jac[size(Jac)[1] - i + 1, j] diff --git a/src/power_series_utils.jl b/src/power_series_utils.jl index 0e2e8e61..ac442924 100644 --- a/src/power_series_utils.jl +++ b/src/power_series_utils.jl @@ -205,7 +205,7 @@ function ps_matrix_linear_de( ) where {T <: Generic.FieldElem} prec = (prec == -1) ? precision(A[1, 1]) : prec n = nrows(A) - identity = one(AbstractAlgebra.MatrixSpace(base_ring(parent(Y0)), n, n)) + identity = one(AbstractAlgebra.matrix_space(base_ring(parent(Y0)), n, n)) Yh, Zh = ps_matrix_homlinear_de(A, identity, prec) matrix_set_precision!(Zh, prec) return _variation_of_constants(A, B, Yh, Zh, Y0, prec) @@ -234,9 +234,9 @@ function ps_ode_solution( ) where {T <: Generic.FieldElem, P <: MPolyRingElem{T}} n = length(equations) ring = parent(equations[1]) - S = AbstractAlgebra.MatrixSpace(ring, n, n) - Sv = AbstractAlgebra.MatrixSpace(ring, n, 1) - Svconst = AbstractAlgebra.MatrixSpace(base_ring(ring), n, 1) + S = AbstractAlgebra.matrix_space(ring, n, n) + Sv = AbstractAlgebra.matrix_space(ring, n, 1) + Svconst = AbstractAlgebra.matrix_space(base_ring(ring), n, 1) eqs = Sv(equations) x_vars = filter(v -> ("$(v)_dot" in map(string, gens(ring))), gens(ring)) @@ -246,7 +246,7 @@ function ps_ode_solution( Jac_dots = S([derivative(p, xd) for p in equations, xd in x_dot_vars]) Jac_xs = S([derivative(p, x) for p in equations, x in x_vars]) - ps_ring, t = PowerSeriesRing(base_ring(ring), prec, "t"; model = :capped_absolute) + ps_ring, t = power_series_ring(base_ring(ring), prec, "t"; model = :capped_absolute) solution = Dict() for (u, coeffs) in inputs solution[u] = sum(coeffs[i] * t^(i - 1) for i in 1:length(coeffs)) diff --git a/src/primality_check.jl b/src/primality_check.jl index e236849d..acccf0eb 100644 --- a/src/primality_check.jl +++ b/src/primality_check.jl @@ -4,7 +4,7 @@ function check_primality_zerodim(J::Array{QQMPolyRingElem, 1}) J = Groebner.groebner(J, loglevel = _groebner_loglevel[]) basis = Groebner.kbase(J, loglevel = _groebner_loglevel[]) dim = length(basis) - S = Nemo.MatrixSpace(Nemo.QQ, dim, dim) + S = Nemo.matrix_space(Nemo.QQ, dim, dim) matrices = [] @debug "$J $basis" @debug "Dim is $dim" @@ -25,7 +25,7 @@ function check_primality_zerodim(J::Array{QQMPolyRingElem, 1}) R, t = Nemo.polynomial_ring(Nemo.QQ, "t") @debug "$(Nemo.charpoly(R, generic_multiplication))" - return Nemo.isirreducible(Nemo.charpoly(R, generic_multiplication)) + return Nemo.is_irreducible(Nemo.charpoly(R, generic_multiplication)) end #------------------------------------------------------------------------------ diff --git a/src/util.jl b/src/util.jl index 5ed81731..919c2bb6 100644 --- a/src/util.jl +++ b/src/util.jl @@ -333,7 +333,7 @@ function uncertain_factorization(f::MPolyRingElem{QQFieldElem}) f = divexact(f, factor_out) f_uni = divexact(f_uni, gcd(f_uni, derivative(f_uni))) end - is_irr = Nemo.isirreducible(f_uni) + is_irr = Nemo.is_irreducible(f_uni) break end end diff --git a/src/wronskian.jl b/src/wronskian.jl index 85bee687..cca62bc5 100644 --- a/src/wronskian.jl +++ b/src/wronskian.jl @@ -240,7 +240,7 @@ Computes the Wronskians of io_equations for (i, tlist) in enumerate(termlists) n = length(tlist) evaled = massive_eval(tlist, ps_ext) - S = Nemo.MatrixSpace(F, n, n) + S = Nemo.matrix_space(F, n, n) W = zero(S) for (i, ps) in enumerate(evaled) for j in 1:n diff --git a/test/det_minor_expansion.jl b/test/det_minor_expansion.jl index b21509f5..42a84069 100644 --- a/test/det_minor_expansion.jl +++ b/test/det_minor_expansion.jl @@ -2,7 +2,7 @@ if GROUP == "All" || GROUP == "Core" @testset "Determinant by minor expansion" begin for d in 1:5 for testcase in 1:10 - mat_space = Nemo.MatrixSpace(Nemo.QQ, d, d) + mat_space = Nemo.matrix_space(Nemo.QQ, d, d) rnd_matrix = mat_space([mod(rand(Int), 1000) for i in 1:d, j in 1:d]) @test det(rnd_matrix) == det_minor_expansion(rnd_matrix) end diff --git a/test/ps_diff.jl b/test/ps_diff.jl index c0c1795d..9368ac85 100644 --- a/test/ps_diff.jl +++ b/test/ps_diff.jl @@ -1,6 +1,6 @@ if GROUP == "All" || GROUP == "Core" @testset "Power Series Differentiation" begin - T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute) + T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute) @test ps_diff(zero(T)) == zero(T) diff --git a/test/ps_integrate.jl b/test/ps_integrate.jl index cca7e34f..79ae5b69 100644 --- a/test/ps_integrate.jl +++ b/test/ps_integrate.jl @@ -1,6 +1,6 @@ if GROUP == "All" || GROUP == "Core" @testset "Power series integration" begin - T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute) + T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute) @test ps_integrate(zero(T)) == zero(T) diff --git a/test/ps_inverse.jl b/test/ps_inverse.jl index 282e9bf0..076e891a 100644 --- a/test/ps_inverse.jl +++ b/test/ps_inverse.jl @@ -1,6 +1,6 @@ if GROUP == "All" || GROUP == "Core" @testset "Power series matrix inverse" begin - T, t = Nemo.PowerSeriesRing( + T, t = Nemo.power_series_ring( Nemo.Native.GF(2^31 - 1), 50, "t"; @@ -8,7 +8,7 @@ if GROUP == "All" || GROUP == "Core" ) for d in 1:5 - S = Nemo.MatrixSpace(T, d, d) + S = Nemo.matrix_space(T, d, d) for case in 1:20 M = S([random_ps(T) for i in 1:d, j in 1:d]) while isequal( diff --git a/test/ps_matrix_homlinear.jl b/test/ps_matrix_homlinear.jl index be2aebaf..dfb3a916 100644 --- a/test/ps_matrix_homlinear.jl +++ b/test/ps_matrix_homlinear.jl @@ -1,6 +1,6 @@ if GROUP == "All" || GROUP == "Core" @testset "Homogeneous linear differential equations" begin - T, t = Nemo.PowerSeriesRing( + T, t = Nemo.power_series_ring( Nemo.Native.GF(2^31 - 1), 300, "t"; @@ -9,9 +9,9 @@ if GROUP == "All" || GROUP == "Core" for d in 1:5 for c in 1:5 - S = Nemo.MatrixSpace(T, d, d) + S = Nemo.matrix_space(T, d, d) A = random_ps_matrix(T, S) - Sconst = Nemo.MatrixSpace(Nemo.Native.GF(2^31 - 1), d, d) + Sconst = Nemo.matrix_space(Nemo.Native.GF(2^31 - 1), d, d) Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d]) while StructuralIdentifiability.LinearAlgebra.det(Y0) == 0 Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d]) diff --git a/test/ps_matrix_linear.jl b/test/ps_matrix_linear.jl index 31d5a282..ead2add4 100644 --- a/test/ps_matrix_linear.jl +++ b/test/ps_matrix_linear.jl @@ -1,6 +1,6 @@ if GROUP == "All" || GROUP == "Core" @testset "Linear differential equations" begin - T, t = Nemo.PowerSeriesRing( + T, t = Nemo.power_series_ring( Nemo.Native.GF(2^31 - 1), 300, "t"; @@ -9,10 +9,10 @@ if GROUP == "All" || GROUP == "Core" for d in 1:5 for c in 1:5 - S = Nemo.MatrixSpace(T, d, d) + S = Nemo.matrix_space(T, d, d) A = random_ps_matrix(T, S) B = random_ps_matrix(T, S) - Sconst = Nemo.MatrixSpace(Nemo.Native.GF(2^31 - 1), d, d) + Sconst = Nemo.matrix_space(Nemo.Native.GF(2^31 - 1), d, d) Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d]) @time sol = ps_matrix_linear_de(A, B, Y0) to_be_zero = map(ps_diff, sol) - A * sol - B diff --git a/test/ps_matrix_log.jl b/test/ps_matrix_log.jl index b4a27aa6..b01a95ad 100644 --- a/test/ps_matrix_log.jl +++ b/test/ps_matrix_log.jl @@ -1,10 +1,10 @@ if GROUP == "All" || GROUP == "Core" @testset "Logarith of power series matrices" begin - T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute) + T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute) for d in 1:5 diag_elements = [1 + t * random_ps(T) for i in 1:d] - S = Nemo.MatrixSpace(T, d, d) + S = Nemo.matrix_space(T, d, d) M = S([(i == j ? diag_elements[i] : T(0)) for i in 1:d, j in 1:d]) result = ps_matrix_log(M) correct = S([(i == j ? log(diag_elements[i]) : T(0)) for i in 1:d, j in 1:d]) @@ -13,7 +13,7 @@ if GROUP == "All" || GROUP == "Core" for c in 1:5 f = random_ps(T) * t - S = Nemo.MatrixSpace(T, 2, 2) + S = Nemo.matrix_space(T, 2, 2) m = S([ T(1) f T(0) T(1) @@ -27,7 +27,7 @@ if GROUP == "All" || GROUP == "Core" for c in 1:5 f, g = random_ps(T) * t, random_ps(T) * t - S = Nemo.MatrixSpace(T, 3, 3) + S = Nemo.matrix_space(T, 3, 3) m = S([ T(1) f g T(0) T(1) f