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

MPolynomial_libsingular.is_squarefree fails with linear factors #12129

Closed
culler opened this issue Dec 9, 2011 · 13 comments
Closed

MPolynomial_libsingular.is_squarefree fails with linear factors #12129

culler opened this issue Dec 9, 2011 · 13 comments

Comments

@culler
Copy link
Contributor

culler commented Dec 9, 2011

sage: x, y = QQ['x','y'].gens()
sage: f = x*y
sage: f.is_squarefree()
False
sage: f = (x+y)*(x+3)
sage: f.is_squarefree()
False

This may be related to an inconsistency in the Singular sqrfree function, which sometimes includes a unit in the square free factorization, but other times does not.

CC: @sagetrac-jakobkroeker

Component: algebra

Keywords: square free

Stopgaps: todo

Author: Paul Zimmermann, John Cremona

Branch/Commit: u/cremona/12129 @ 17fdcc1

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/12129

@culler culler added this to the sage-5.11 milestone Dec 9, 2011
@zimmermann6
Copy link

comment:1

see also #12198 and #12404. Maybe some of those tickets can be removed as duplicate.

Paul

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Aug 25, 2015

Stopgaps: todo

@JohnCremona
Copy link
Member

comment:8

This can surely be closed as the examples posted are now computed correctly. Same as at #12198.

@tscrim
Copy link
Collaborator

tscrim commented Nov 13, 2017

Reviewer: Travis Scrimshaw

@tscrim tscrim removed this from the sage-6.4 milestone Nov 13, 2017
@zimmermann6
Copy link

comment:11

shouldn't we include a non-regression test?

@tscrim
Copy link
Collaborator

tscrim commented Nov 13, 2017

comment:12

I am not opposed. Feel free to use this ticket for that.

@zimmermann6
Copy link

comment:13

here is a corresponding patch:

--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
@@ -4734,6 +4734,18 @@ cdef class MPolynomial_libsingular(MPolynomial):
             sage: h = f^2
             sage: h.is_squarefree()
             False
+
+        TESTS::
+
+Check if :trac:`12129` is fixed::
+
+            sage: x, y = QQ['x','y'].gens()
+            sage: f = x*y
+            sage: f.is_squarefree()
+            True
+            sage: f = (x+y)*(x+3)
+            sage: f.is_squarefree()
+            True
         """
         # TODO:  Use Singular (4.x) intrinsics.  (Temporary solution from #17254.)
         return all([ e == 1 for (f, e) in self.factor() ])

@JohnCremona
Copy link
Member

comment:14

I agree that tests should be added, both here and at #12198, but was a little too lazy to do it myself.

@JohnCremona
Copy link
Member

comment:15

Travis could you re-review this? I thought that this doctest would do for both tickets. Thanks.


New commits:

17fdcc1#12129: add doctest to show issue has been fixed

@JohnCremona
Copy link
Member

Author: Paul Zimmermann, John Cremona

@JohnCremona
Copy link
Member

Branch: u/cremona/12129

@JohnCremona
Copy link
Member

Commit: 17fdcc1

@tscrim
Copy link
Collaborator

tscrim commented Nov 13, 2017

comment:16

I was also a little too lazy to do it as well. ^^;; Thanks Paul and John.

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

No branches or pull requests

7 participants