-
-
Notifications
You must be signed in to change notification settings - Fork 598
Return explicit polynomial in .in_subalgebra #39225
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
Labels
Comments
This is already possible as follows
(performance improvement might be possible) On an unrelated note, for some reason the following is not implemented
|
5 tasks
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 24, 2025
sagemathgh-39555: Added option to return explicit polynomial in .in_subalgebra <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#39225. Previously the function in_subalgebra in src/sage/rins/polynomial/multi_polynomial_libsingular.pyx returned True or False, depending on whether the polynomial was present in the provided subalgebra. When the parameter 'algorithm' was set to 'groebner' it would do this by generating a polynomial, but this polynomial would not be made available to the user. This function was enhanced by adding a key-word only argument 'certificate' to the function which defaults to False. When the value provided for this argument evaluates to False the function behaves as before. When the value provided evaluates to True and the Groebner algorithm is used the function returns the polynomial generated by the algorithm when it would have otherwise returned True, and returns None when it would have otherwise returned False. Additionally, if the value provided for the 'certificate' argument is a string which evaluates to True then that string will be used to name the variables in the generated polynomial. The existing example for this function has been modified to test this new functionality. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39555 Reported by: Caleb Van't Land Reviewer(s): Caleb Van't Land, Travis Scrimshaw
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 27, 2025
sagemathgh-39555: Added option to return explicit polynomial in .in_subalgebra <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#39225. Previously the function in_subalgebra in src/sage/rins/polynomial/multi_polynomial_libsingular.pyx returned True or False, depending on whether the polynomial was present in the provided subalgebra. When the parameter 'algorithm' was set to 'groebner' it would do this by generating a polynomial, but this polynomial would not be made available to the user. This function was enhanced by adding a key-word only argument 'certificate' to the function which defaults to False. When the value provided for this argument evaluates to False the function behaves as before. When the value provided evaluates to True and the Groebner algorithm is used the function returns the polynomial generated by the algorithm when it would have otherwise returned True, and returns None when it would have otherwise returned False. Additionally, if the value provided for the 'certificate' argument is a string which evaluates to True then that string will be used to name the variables in the generated polynomial. The existing example for this function has been modified to test this new functionality. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39555 Reported by: Caleb Van't Land Reviewer(s): Caleb Van't Land, Travis Scrimshaw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem Description
Given a polynomial f∈𝔽[x1,…,xn] which is an element of the subalgebra generated by f1,…,fk, calling
f.in_subalgebra([f1,...,fk])
should returnh(t1,…,tk)
such thatf=h(f1,…,fk)
. I believe that this would be a useful feature.Proposed Solution
The method is implemented in sage/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx. When
algorithm = "groebner"
is chosen, the polynomialz
should be returned together withTrue
. In case ofFalse
, 0 can be returned.Alternatives Considered
I'm not sure about feasible alternatives.
Additional Information
No response
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: