feat: initial implementation of HomotopyContinuation interface
julia> @variables x y z
julia> eqs = [
0 ~ x^2 + y^2 + 2x*y
0 ~ x^2 + 4x + 4
0 ~ y * z + 4x^2
]
julia> @mtkbuild sys = NonlinearSystem(eqs)
julia> prob = MTK.HomotopyContinuationProblem(sys, [x => 1.0, y => 1.0, z => 1.0], [])
julia> sol = HomotopyContinuation.solve(prob.hcsys; threading = false)
Checklist
- [ ] Appropriate tests were added
- [ ] Any code changes were done in a way that does not break public API
- [ ] All documentation related to code changes were updated
- [ ] The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC.
- [ ] Any new documentation only uses public API
Additional context
Add any other context about the problem here.
I think most of what's left now is documentation. It would also be nice to not require symbolic jacobians. I want to integrate that with ADTypes and DifferentationInterface, since they're "free" dependencies. ADTypes is pulled in via DI, and DI is pulled in via DiffEqCallbacks and NonlinearSolve, both of which are dependencies of MTK.
Leave any Jac change for a future PR. Contain the scope a bit here.
One thing that Catalyst does that might be nice is to also support rational functions by converting them into polynomial systems. I think @TorkelE set this up with @shashi at some point via a mix of stuff in Catalyst and Symbolics.
Could you point to what transformation you're referring to regarding rational functions?
You can always multiply through by the denominators to make the system polynomial.
If you look at the Catalyst extension you can see what @TorkelE did.
https://github.com/SciML/Catalyst.jl/blob/master/ext/CatalystHomotopyContinuationExtension/homotopy_continuation_extension.jl
Ah, I see what you mean now. Yeah that should be simple.
Note, there is no reason not to leave rational systems for a follow up. Just having it on polynomial systems to start is nice!
I haven't gone through properly, but one test case that def should be added is parametric exponents (e.g. x^n). If these are not handled properly (I.e. replaced with their value before sent to HC) HC will fail.
What's left for this to be ready?
Adding the parametric exponents test @TorkelE suggested, and figuring out why CI is failing