Opened 7 years ago
Closed 10 months ago
#12198 closed defect (wontfix)
is_squarefree() over multivariate rings does not work
Reported by: | MvanBeek | Owned by: | AlexGhitza |
---|---|---|---|
Priority: | critical | Milestone: | sage-duplicate/invalid/wontfix |
Component: | basic arithmetic | Keywords: | squarefree, singular |
Cc: | malb, burcin, jpflori | Merged in: | |
Authors: | Reviewers: | Travis Scrimshaw | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: | todo |
Description (last modified by )
The following examples demonstrate the problem:
sage: R.<x,y>=PolynomialRing(ZZ) sage: R(1).is_squarefree() False sage: R(x^2+y^2).is_squarefree() False sage: R(x^2+1).is_squarefree() False
Change History (17)
comment:1 Changed 7 years ago by
- Component changed from PLEASE CHANGE to algebraic geometry
- Owner changed from tbd to AlexGhitza
comment:2 Changed 7 years ago by
- Cc malb burcin added
comment:3 Changed 7 years ago by
- Component changed from algebraic geometry to basic arithmetic
- Keywords squarefree singular added
- Priority changed from major to critical
Integer coefficients are relatively new in Singular. Many fuctions do not work with them. In this case, Singular raises an error using a callback function (see sage.libs.singular.singular.libsingular_error_callback
). Unfortunately we do not check for it and return wrong results.
A workaround, suggested by Martin Lee, for this immediate problem is to change_ring(QQ)
and call is_squarefree()
there.
If there isn't a ticket already about handling errors raised in libsingular, we should open one. Note that the magical function interface (the one you get through sage.libs.singular.ff.*
) can handle Singular errors. It's only direct C library calls that should check explicitly if Singular raised an error. Perhaps we can solve it by wrapping the declarations in sage/libs/singular/singular-cdefs.pxi
in a preprocessor macro which calls PyErr_Occured()
after raising an exception in libsingular_error_callback()
.
comment:4 Changed 6 years ago by
the same problem happens over finite fields:
sage: R.<x,y> = GF(2)[] sage: f=x+y sage: f.is_squarefree() False
If is_squarefree
is wrong, it should be simply disabled.
See also #12404.
Paul
comment:5 Changed 6 years ago by
see also #12129.
Paul
comment:6 Changed 5 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:7 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:8 Changed 5 years ago by
The Singular error output has changed in 4.0.0:
SINGULAR / Development A Computer Algebra System for Polynomial Computations / version 4.0.0 0< by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ Dec 2013 FB Mathematik der Universitaet, D-67653 Kaiserslautern \ // ** executing /home/ralf/Sources-Singular_4.0.0/Singular/LIB/.singularrc > ring R = integer,(x,y), dp; > poly p = x^2+y^2; > sqrfree(p); ? not implemented for rings with rings as coeffients ? error occurred in or before STDIN line 3: `sqrfree(p);`
comment:9 Changed 4 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:10 Changed 4 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:11 Changed 3 years ago by
- Stopgaps set to todo
comment:12 Changed 2 years ago by
- Cc jpflori added
comment:13 Changed 11 months ago by
This can surely be closed since the incorrect results reported are now computed correctly. Same at #12129.
comment:14 Changed 11 months ago by
- Description modified (diff)
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Reviewers set to Travis Scrimshaw
- Status changed from new to needs_review
Agreed.
comment:15 Changed 11 months ago by
- Status changed from needs_review to positive_review
comment:16 Changed 11 months ago by
A doctest is being added at #12129 which covers this too.
comment:17 Changed 10 months ago by
- Resolution set to wontfix
- Status changed from positive_review to closed
Singular seems to have issues with square-free factorization over ZZ:
This might be implemented in a more recent version, don't know about that. Looking at the Singular source there is a
isSqrFreeZ
function in the factory that should do the right thing. Its not clear to me why the code path doesn't end up there.Over QQ it works fine:
I haven't found a way to test square-freeness (as opposed to compute the squarefree factorization) from the Singular command line, is this function not exposed to the Singular interpreter?