#12404: is_squarefree() incorrect over imperfect fields
---------------------------------------------------------------+------------
Reporter: saraedum | Owner:
malb
Type: defect | Status:
needs_work
Priority: minor | Milestone:
Component: commutative algebra | Resolution:
Keywords: sd40.5 | Work issues:
coherence with squarefree_decomposition, fix error
Report Upstream: Not yet reported upstream; Will do shortly. | Reviewers:
Paul Zimmermann
Authors: Julian Rueth | Merged in:
Dependencies: #9054, #12988 | Stopgaps:
---------------------------------------------------------------+------------
Comment (by saraedum):
Replying to [comment:9 zimmerma]:
> the documentation of {{{is_squarefree}}} says that {{{f}}} is not
square-free if {{{g^2}}}
> divides {{{f}}} where {{{g}}} is a non-unit. In particular {{{4*x}}} is
not considered
> square free by {{{is_squarefree}}}, but it is by
{{{squarefree_decomposition}}}:
> {{{
> sage: R.<x> = ZZ[]
> sage: f = 4*x
> sage: f.is_squarefree()
> False
> sage: f.squarefree_decomposition()
> (4) * x
> }}}
>
> Sage should be coherent in that matter. Personally I prefer not to
decompose the coefficient content.
That is true. I also noted this inconsistency. To not break existing code,
I'd rather add a warning section in the docstring. Generally I agree that
having {{{squarefree_decomposition()}}} factor the content is not what one
wants for most purposes.
Would you be ok with just adding a warning and an example showing this
problem?
> Moreover the following produces an error:
> {{{
> sage: R.<x> = ZZ[]
> sage: f = 2*x^2
> sage: f.is_squarefree()
> ...
> AttributeError: 'int' object has no attribute 'is_zero'
> }}}
This should not happen when applying the dependency #12988.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12404#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.