Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sagemathgh-36401: Allow lifting mvpolynomials over non-fields using singular
    
It seems singular now supports this, so pass this functionality on to
users

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36401
Reported by: Alex J Best
Reviewer(s): Alex J Best, Kwankyu Lee
  • Loading branch information
Release Manager committed Oct 18, 2023
2 parents e73e211 + 0c50d6a commit 77df29e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/sage/matrix/matrix0.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5813,10 +5813,11 @@ cdef class Matrix(sage.structure.element.Matrix):
Traceback (most recent call last):
...
ArithmeticError: self must be a square matrix
sage: matrix(RR, 1, 1, [2]).inverse_of_unit() # needs sage.libs.singular
Traceback (most recent call last):
...
NotImplementedError: Lifting of multivariate polynomials over non-fields is not implemented.
ArithmeticError: non-invertible matrix
sage: R = ZZ.cartesian_product(ZZ)
sage: m = matrix(R, 2, [R((2,1)), R((1,1)), R((1,1)), R((1,2))])
Expand Down
19 changes: 17 additions & 2 deletions src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4490,8 +4490,25 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
Traceback (most recent call last):
...
ValueError: polynomial is not in the ideal
Check that we can work over the integers::
sage: R.<x1,x2> = ZZ[]
sage: I = R.ideal(x2**2 + x1 - 2, x1**2 - 1)
sage: f = I.gen(0) + x2*I.gen(1)
sage: f.lift(I)
[1, x2]
sage: (f+1).lift(I)
Traceback (most recent call last):
...
ValueError: polynomial is not in the ideal
sage: A.<x,y> = PolynomialRing(ZZ,2,order='degrevlex')
sage: I = A.ideal([x^10 + x^9*y^2, y^8 - x^2*y^7 ])
sage: f = x*y^13 + y^12
sage: M = f.lift(I)
sage: M
[y^7, x^7*y^2 + x^8 + x^5*y^3 + x^6*y + x^3*y^4 + x^4*y^2 + x*y^5 + x^2*y^3 + y^4]
TESTS:
Expand All @@ -4509,8 +4526,6 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
"""
global errorreported
if not self._parent._base.is_field():
raise NotImplementedError("Lifting of multivariate polynomials over non-fields is not implemented.")

cdef ideal *fI = idInit(1,1)
cdef ideal *_I
Expand Down

0 comments on commit 77df29e

Please sign in to comment.