Skip to content

Commit a3d35b4

Browse files
authored
Merge pull request #403 from SciML/trbasis2
Fixing the internal_ordering
2 parents 71c0013 + c4f01c5 commit a3d35b4

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ IterTools = "1"
4040
LinearAlgebra = "1.10, 1.11"
4141
Logging = "1.10, 1.11"
4242
MacroTools = "0.5"
43-
ModelingToolkit = "9.33"
43+
ModelingToolkit = "9.50"
4444
Nemo = "0.46, 0.47, 0.48, 0.49"
4545
ParamPunPam = "0.5"
4646
Pkg = "1.10, 1.11"

src/RationalFunctionFields/IdealMQS.jl

+11-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mutable struct IdealMQS{T} <: AbstractBlackboxIdeal
5353
sat_varname = "t",
5454
sat_var_position = :first,
5555
ordering = :degrevlex,
56-
extra_const_polys::Vector{PolyQQ}=Vector{PolyQQ}(),
56+
extra_const_polys::Vector{PolyQQ} = Vector{PolyQQ}(),
5757
) where {PolyQQ}
5858
# We are given polynomials of form
5959
# [[f1, f2, f3, ...], [g1, g2, g3, ...], ...]
@@ -207,7 +207,8 @@ function fractionfree_generators_raw(mqs::IdealMQS)
207207
nums_qq, dens_qq, const_polys = mqs.nums_qq, mqs.dens_qq, mqs.const_polys
208208
nums_y = map(num -> parent_ring_change(num, big_ring, matching = :byindex), nums_qq)
209209
dens_y = map(den -> parent_ring_change(den, big_ring, matching = :byindex), dens_qq)
210-
const_polys_y = map(p -> parent_ring_change(p, big_ring, matching = :byindex), const_polys)
210+
const_polys_y =
211+
map(p -> parent_ring_change(p, big_ring, matching = :byindex), const_polys)
211212
nums_x = map(num -> parent_ring_change(num, big_ring, matching = :byname), nums_qq)
212213
dens_x = map(den -> parent_ring_change(den, big_ring, matching = :byname), dens_qq)
213214
polys = Vector{elem_type(big_ring)}(undef, length(nums_qq) + length(const_polys))
@@ -238,10 +239,16 @@ function ParamPunPam.reduce_mod_p!(
238239
return nothing
239240
end
240241
nums_qq, dens_qq, const_polys = mqs.nums_qq, mqs.dens_qq, mqs.const_polys
241-
ring_ff, _ = Nemo.polynomial_ring(ff, map(var_to_str, gens(parent(first(const_polys)))))
242+
ring_qq = parent(first(const_polys))
243+
ring_ff, _ = Nemo.polynomial_ring(
244+
ff,
245+
map(var_to_str, gens(ring_qq)),
246+
internal_ordering = Nemo.internal_ordering(ring_qq),
247+
)
242248
nums_gf = map(poly -> map_coefficients(c -> ff(c), poly, parent = ring_ff), nums_qq)
243249
dens_gf = map(poly -> map_coefficients(c -> ff(c), poly, parent = ring_ff), dens_qq)
244-
const_polys_gf = map(poly -> map_coefficients(c -> ff(c), poly, parent = ring_ff), const_polys)
250+
const_polys_gf =
251+
map(poly -> map_coefficients(c -> ff(c), poly, parent = ring_ff), const_polys)
245252
mqs.cached_nums_gf[ff] = nums_gf
246253
mqs.cached_dens_gf[ff] = dens_gf
247254
mqs.cached_const_polys_gf[ff] = const_polys_gf

test/identifiable_functions.jl

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ push!(test_cases, (ode = ode, ident_funcs = ident_funcs))
216216

217217
# SLIQR
218218
# a^2 + 3*a*g - a*s + e*g*s + g^2 - 2*g*s ??
219+
# appears with internal_ordering being lex (or with strong simplification)
219220
ode = StructuralIdentifiability.@ODEmodel(
220221
S'(t) = -b * In(t) * S(t) * Ninv - S(t) * Ninv * u(t),
221222
In'(t) = -In(t) * g + s * Q(t) + a * L(t),

0 commit comments

Comments
 (0)