-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
Macaulay matrix for Sequence Multivariate Polynomials #39511
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 50c83b7; changes) is ready! 🎉 |
Thanks for this nice addition! I will review soon. A first (too long) note on a non-programming-related point, but following our discussion concerning what reference to show for Macaulay matrices. The Macaulay 1902 paper that you refer to in your method's documentation may look like a sufficient reference by itself. Another reference, similar but maybe more to the point concerning the construction of the matrices, could be the chapter I of the book with SageMath reference [Mac1916] (F.S. Macaulay, The algebraic theory of modular systems, 1916, chapter I available here). As we discussed, picking a more recent presentation of these matrices could have some advantage, for example one that would also cover non-homogeneous polynomials... but finding "the right" reference is tricky (among others, because putting a 21th century reference for something already described more than 100 years before seems somewhat odd). The reference you introduced (Bardet & Faugère & Salvy, 2015) in fact refers directly to Macaulay's 1902 paper you listed: It is classical that the computation of Gröbner bases can be performed by linear algebra on a large matrix that has been described precisely by Macaulay (1902). A suggestion could be Lazard's 1983 paper "Gröbner bases, Gaussian elimination and resolution of systems of algebraic equations", which defines the Macaulay matrix for non-homogeneous polynomials in section 2; another suggestion (my preference, I think) could be to put no reference other than Macaulay 1902/1916. |
@@ -420,6 +420,10 @@ REFERENCES: | |||
.. [Baer2020] Christian Bär. *The Faddeev-LeVerrier algorithm and the Pfaffian*. | |||
:arxiv:`2008.04247`, 2020. | |||
.. [BFS2015] M. Bardet, J-C. Faugère, B. Salvy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on the decision for the suggestion about references, this might have to be removed for the moment (to avoid a reference that is currently not being referred to in Sage).
Mentioning this to @robinkouba who might have some comments since he recently dealt with Macaulay matrices in SageMath. |
add reference for macaulay matrix Co-authored-by: Vincent Neiger <[email protected]>
I think it would be great to add an option for ordering the columns and rows. For the columns, this is straightforward: one can simply provide a monomial order as input, possibly along with a choice between increasing or decreasing order. For the rows, the situation is more complex since they are indexed by elements of the form (m,i), where m is a monomial and i indexes the polynomials in the input. This indexing corresponds to monomials in a free K[x1,…,xn]-module, so perhaps an ordering could also be provided as input, but I think sagemath currently does not have monomial orderings for modules. At least, providing the choice between position over term and term over position could be easy to implement (the current ordering seems to correspond to position over term). |
Co-authored-by: robinkouba <[email protected]>
Co-authored-by: robinkouba <[email protected]>
Thanks for the feedback. I could indeed add an option for the order. I was also hesitating to add an option to make a Macaulay matrix with the reduced equations modulo the field equations. This is often useful in cryptography on F2, for example. |
Co-authored-by: Vincent Neiger <[email protected]>
Co-authored-by: Vincent Neiger <[email protected]>
when ``None`` the Macaulay matrix is constructed | ||
using all the variables of the base ring of polynomials. | ||
when ``set_variables`` is a list of variables, it is | ||
used instead of all the variables of the base ring of polynomials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be an input restriction to indicate here (this set must consist of variables from the parent of the input polynomials). More importantly: it is not very clear what this set is impacting. Is this about variables for the monomials that are constructed to multiply the input polynomials? or is this also about monomials that index the columns and appear in the input polynomials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for all the suggestions. I modified the word 'system' in 'sequence' and specified that set_variables was used to multiply the polynomials of the starting system by this set.
I hope I got the push right.
I'll have a look at your other suggestions.
Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some more comments with suggested changes or improvements. (I have not yet tried to compile the documentation to see the html form, but I think there will be some things to fix there as well.)
Co-authored-by: Vincent Neiger <[email protected]>
Co-authored-by: Vincent Neiger <[email protected]>
Co-authored-by: Vincent Neiger <[email protected]>
Co-authored-by: Vincent Neiger <[email protected]>
Two comments:
|
There were two redundant computations that impacted performance:
Combining both improvements does speed things up:
|
Please forget this comment, it seems I had not understood well what this option does, judging from the documentation. I'll make a suggestion for improving the description. |
…terator over exp-coeffs
Concerning performance, it makes a big difference to store in some dictionary the indices of column monomials, and then use this to populate the matrix (see MercedesHaiech@8496a77 ). This would allow the build matrices for much larger instances in a reasonable time, e.g. the timings below improve from ~1sec to ~40msec, and from ~5sec to ~90msec.
|
Short summary: I have collected many suggestions in MercedesHaiech#1, to finalize this review/comments/suggestions, my plan is to give a try to the suggestion about ordering the rows and columns, and also make the option of specifying variables more robust. The third remaining point (if I don't forget one?) is about the field equations, which I will leave aside for the moment (it could also be a task for later in another PR). |
We implemented the Macaulay matrix for Sequence of multivariate polynomials
📝 Checklist