Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving system of polynomial equations #1

Open
blegat opened this issue Aug 18, 2017 · 9 comments
Open

Solving system of polynomial equations #1

blegat opened this issue Aug 18, 2017 · 9 comments

Comments

@blegat
Copy link
Member

blegat commented Aug 18, 2017

It would be nice to have an implementation independent interface for solving systems of polynomial equations. There will soon be an implementation here using the classical Groebner basis method and relying on MultivariatePolynomials to do all the work.
We have already a nice interface to build an algebraic set

@set x == 1 && y == 2

Now, we need an interface to query the solutions of the equations. Here these are the points of the sets so we could just iterate through the set and in case the set was not zero dimensional then throw an error

collect(@set x^2 == 1 && y == 2) # -> [(-1, 2), (1, 2)]
collect(@set x == y) # -> error not zero dimensional

The problem with the current interface is that we currently do not specify anywhere what will be the algorithm used to find the points.
The user should be able to say that he wants another library do deal with it, e.g.:

cc @saschatimme

@blegat
Copy link
Member Author

blegat commented Aug 18, 2017

We could have a function

algebraicset(p::AbstractVector{<:AbstractPolynomialLike}, lib=defaultlibrary(p))

The macro @set would call algebraicset and if a second argument is given to it, it gives it to algebraicset.

@saschatimme
Copy link

That would be doable, but at least my stuff has a lot of configuration parameters. So the second argument would need to take keyword arguments, depending on the algorithm or maybe something like a „configuration struct“.

@blegat
Copy link
Member Author

blegat commented Aug 19, 2017

The way the second argument is constructed is not limited. You can even do

lib = HomotopyContinuationLibrary(...)
@set x == 0 lib

@blegat
Copy link
Member Author

blegat commented Aug 31, 2017

@saschatimme I have set up the necessary infrastructure. If you define HomotopyContinuationSolver <: AbstractAlgebraicSolver, you can do

solver = HomotopyContinuationSolver(...)
@set x == 0 solver

@saschatimme
Copy link

That's nice, I will add that then soon

@chriscoey
Copy link

hey @blegat, I was asking this question over at JuliaHomotopyContinuation/HomotopyContinuation.jl#59: do you know of any methods for (or papers on) finding the critical points of a function that lie in a basic semi-algebraic set (BSS)?

say I have n variables and call the BSS S. then I could just pose it as finding the points (assume finitely many) in another BSS described by S and the n equalities defining the roots of the gradient. (if i wanted, i could add more inequalities forcing the critical points to be local minima, say.) ofc I could find all the critical points from the square system using existing methods discussed here, and then later exclude those points outside S. but this set of points could be much larger than its intersection with S, so it could be much faster to just search on the BSS, if there's some way to do that.

it's something i'm willing to work on if I can find some algorithms for it. obviously it's a very "hard" problem, but n and function degree and description of S will be small/constant.

thank you!

@chriscoey
Copy link

chriscoey commented Jun 15, 2018

one possible approach is to use the obvious idea from this slide (source):
image
that is, for each constraint that isn't an equality, to introduce an extra variable y and rewrite the constraint as an equality using y.

for my specific problem stated in the previous post, I already assumed that there are finitely many critical points of my function f(x) over R^n (the square system given by the gradient is zero-dimensional). what I care about is restricting my search for these points to S, i.e. I'm still looking for a finite number of points. unfortunately it seems that if I use this approach of converting each non-equality (!=, >, >= etc) constraint i from S to an equality with an extra variable y_i, the system can be non-zero-dimensional / underdetermined because of the extra variables y.

so i guess my question here is: is there some practical extension of your classical Groebner basis method that can restrict its search for the solutions to a zero-dimensional system (of equalities) according to some additional non-equality constraints (ie. semialgebraic not algebraic)? do you know of any implementations or papers I can look at? I will be interested to potentially contribute an implementation.

@saschatimme
Copy link

@blegat HomotopyContinuation 2.4 now supports this

@saschatimme
Copy link

saschatimme commented Jan 20, 2021

And I remember that somewhere this is used to extract measures, right? This could be a nice post on JuliaHomotopyContinuation.org if you are interested :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants