- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Computing a point in a variety of a positive dimensional ideals #39682
Comments
@maxale, do you think variety() should return such a solution instead of "nothing"? Or should it be a different function such as "exampleSolution()" |
@DannyFeldman: I think the default behavior of Also, if computing one point can be extended to two, three, etc., it may be worth it to provide a method like |
Agreeing with the above comment: this should not modify |
Answering to #39475 (comment) , which I think belongs to this thread. Thank you for the comments and information! in case of struggle with integration into SageMath, feel free to post the code somewhere and ask here on this issue if anyone would be able to help for the integration. |
@vneiger Awesome! I will! Another comment regarding motivation: our main application is minimizing (approximately) a polynomial function under polynomial constraints. Using binary search on the search space, the problem reduces to the decision problem "give me any solution to this system unless it has no solution (empty variety)". Many optimization problems in computer science, and computer vision can be reduced to these cases, where we do benchmark for minimizing a function, and less care about the "arg min" set which might be infinite. |
In the minimisation setting, there are results saying that you should look at the gradient ideal of the polynomial you minimise: In general, a lot depends on extra properties of your ideal If your Also, in the approximate setting, there is a whole industry called "numerical algebraic geometry" which does just this - finding approximate solutions. See e.g. https://www3.nd.edu/~jhauenst/preprints/hsWhatIsNAG.pdf |
@dimpase , Wow, these are great research directions.
Unfortunately, it seems that this reference (as most of the SOS papers) satisfies the second condition. Also, I am not sure that SOS supports complex polynomial system.
The problems I have in mind (mainly from computer vision) involves <5 variables, equations and degree. So, I really hope to find a general solution for such "simple" cases. The approximation factor can be calibrated or improved iteratively via the binary search.
Sounds really cool idea. Even when
Sounds also very interesting. Although I am more suspiciuos. It sounds like Homotopy continuation (as in your last reference), which also satisfies the above conditions, as far as I know.
This is exactly the solution we implemented, following the references in the previous comments. I will appreciate your comments on the pseudo code (coming soon). |
@DannyFeldman you need to say explicitly whether you are after any solution (that is, in an algebraic extension of the field) or only a real one. The latter are much harder - there the notion of the dimension of the ideal is different, and harder to work with. Nothing I suggested is meant to address the real solutions specifically. For the real case, the reference would be Basu-Pollack-Roy book The "hidden assumptions" are typical for the SOS-based methods, which have to work around the theoretical complexity issues with SDP solving (they want it to be polynomial-time, but nothing like this is known in general) to get a complexity bound. On a practical side, msolve is the fastest of Groebner bases implementation available in SageMath (the interface is, as usual, not quite complete). |
@DannyFeldman |
Lexicographic is an overkill, though. An elimination order with appropriate block sizes will be much faster, in general. |
@dimpase and @antonleykin, I am very excited by your comments and have many questions and answers. However, I will try to be focused for start and refer to more issues later.
|
Attached is a description of a pseudo code for computing a single element in a given basis for an idea in complex variables.
|
Not at all. At least from my experience, and most of the papers I read. The running time of the SDP solvers is extremely fast in practice (and also in theory, after reasonable assumption on the input, such as conditioning). In fact, you can solve SOS without SDP: The main problem I have, both in theory and practice, is that the optimality is guaranteed only when the hierarchy-level approaches infinity. Even in this case, it is only using many more assumptions. In practice, the action matrix explodes after two or three levels. Unlike other heuristics, the magics are that: 1) If and when it works -- you get a certificate of optimality, and 2) There are some very few but famous examples that solving an NP-hard problem in only the first levels gives a provable approximation in polynomial time. However, all the examples I know are not new and based on really hard tailoring of an existing approximation. See: But, at least for systems of a few (constant <10) polynomials, in a small degree and few variables, I expect Groebner basis to give all the solutions of a zero-dimensional system. I am still failing to do it with SageMath (will open a new "issue") but believe it will happen soon with your help. |
yes, this is a standard procedure (not in Sage, though). Let |
@DannyFeldman : Did you try using |
No, the student is still struggling with the compilation. Will keep you updated.
Good point. In the context of this thread and the issue in the previous paragraph: any element in the variety in For example, , I would expect that groebner_basis()" would solve simple problem such as: Let When Any suggestions would be appreciated. |
Why is it a problem? I'd suggest to use Conda, that's the quickest way to get a development version of Sage ready. We'd be glad to help with this. By the way, I just posted a PR to upgrade msolve to the latest version #39738
Do you have a function
I suppose you checked that it's well-posed, etc. Cause Lagrange multipliers need not always work.
I'm not sure whether your example is a real one, or a toy, one, but just in case: |
In my research experience even solving LPs in "practice", e.g. while computing Delsarte bounds on binary code sizes, can be impossible (without a special arbitrary precision solvers) |
This is why I am so surprised that Groebner() gets lost already there. Hope that at least msolve would change it. Meanwhile I try to implement a solution or at least to understand why is it so hard. It must be related to the degenerate cases, but I am not sure why they cannot be removed in advance. |
@dimpase , thank you for the detailed reply.
Not sure. Alex writes a nice report for installation a complete version of Sagemath where you can actually debug the groebner_basis function (there were some bugs in the latest version). Will update with a summary that hopefully help others.
At least in the general (and interesting case), there are finite number of extremum and Lagrange seems ok.
It is a real problem but I am actually looking for a generic solution for future problems, not a trick. Here is the motivation: Variants to the simpler 2d case y=(0,1)^T can be found here:
This is too good to be true, so if you are right (see previous comment) I probably missed something in the problem. Since even when the smallest norm (distance) above is zero, the problem is the (noise-free) P3P which reduces to solving a single univariate quartic polynomial. |
Thank you so much for the willing to help. Dr. Verner is currently working on installing (the full version of) SageMath, and would appreciate your help. See: The goals are to: 1) add debug (or timer) info in groebner_basis, 2) Run msolve, 3) Implement the pseudo code that I uploaded above. |
please refrain from discussing at the discussion there, it on a different, concrete, topic! We teach our 1st year undergrads to not hijack existing topics like this :-) I've opened a new issue, #39740, to deal with this. |
So sorry about this. Alex opened it but we are both new in this business. Will be more careful next time.
Many thanks. Fingers crossed... |
Dear Dima,
I apologize for bothering you with this again and my ignorance.
Can you please confirm that the place for the question of Alex is:
#39740
Alex, I guess that Dima meant that you posted the question in the wrong
(existing) case. Not the wrong forum.
Your report and tutorial for the installation might also be used by the
community (after verification).
Thank you both,
Danny
…On Thu, 20 Mar 2025 at 11:41, Alexander Verner ***@***.***> wrote:
Yes, it appears here: #39740. But
this contradicts his disapproval of posting in the GitHub forum.
чт, 20 мар. 2025 г. в 11:37, Dan Feldman ***@***.***>:
> Hi, Alex
> Dima wrote below that he "opened a new issue to deal with this."
> Maybe this is why your new cases are being deleted.
>
> Do you find this new open case?
>
> ---------- Forwarded message ---------
> From: Dima Pasechnik ***@***.***>
> Date: Thu, 20 Mar 2025 at 00:09
> Subject: Re: [sagemath/sage] Computing a point in a variety of a positive
> dimensional ideals (Issue #39682)
> To: sagemath/sage ***@***.***>
> Cc: DannyFeldman ***@***.***>, Mention <
> ***@***.***>
>
>
> please refrain from discussing at the discussion there, it on a
> different, concrete, topic! We teach our 1st year undergrads to not hijack
> existing topics like this :-)
>
> I've opened a new issue to deal with this.
>
> —
> Reply to this email directly, view it on GitHub
> <#39682 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALAQHRMGD3ZAIDPGZK4JPVT2VHTHTAVCNFSM6AAAAABY35YZZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZYGI4DGOBZG4>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
> [image: dimpase]*dimpase* left a comment (sagemath/sage#39682)
> <#39682 (comment)>
>
> please refrain from discussing at the discussion there, it on a
> different, concrete, topic! We teach our 1st year undergrads to not hijack
> existing topics like this :-)
>
> I've opened a new issue to deal with this.
>
> —
> Reply to this email directly, view it on GitHub
> <#39682 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALAQHRMGD3ZAIDPGZK4JPVT2VHTHTAVCNFSM6AAAAABY35YZZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZYGI4DGOBZG4>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@DannyFeldman no worries, I actually opened #39740 myself - copying Alex's question there. Perhaps the title should be changed the, to reflect that there is also a building issue. |
Sorry for not answering earlier, it was very busy days. I see some help has been provided already, thank you @dimpase ; I'm subscribing to this other issue to keep informed if help is needed. |
Problem Description
variety() supports only ideal of dimension zero, i.e., finite number of solutions.
It would be helpful if it would return at least one solution in such cases.
For example, in optimization problems, even argmin is an infinite set, we could conclude the minimum value.
It seems that commercial CAS such as Mathematica (FindInstance) or Maple (solve) support this feature.
Proposed Solution
The solution for existing software seems to be based on:
Patrizia Gianni, Properties of Gr¨obner bases under specialization, Lect. N. Comp. Sci. Berlin, Heidelberg, New York: Springer 378 (1987), 293–297. MR1033305 (91g:13032)
Michael Kalkbrenner, Solving systems of algebraic equations using Gr¨obner bases, Lect. N. Comp. Sci. Berlin, Heidelberg, New York: Springer 378 (1987), 282–292.
Alternatives Considered
An alternative solution might be to return a decomposition of the space of solutions. For example, "Algorithms in Real Algebraic Geometry" by Basu, Pollack and Roy suggests such a decomposition into constructible sets in Theorem 1.22.
Additional Information
No response
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: