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

Fix docstring for fmpz_poly_is_squarefree #2093

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

albinahlback
Copy link
Collaborator

Solves #2084

@fingolfin

@albinahlback
Copy link
Collaborator Author

@edgarcosta please make a suggestion here if you want one

Copy link
Collaborator

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me, thanks

Returns whether the polynomial ``(poly, len)`` is square-free.

.. function:: int fmpz_poly_is_squarefree(const fmpz_poly_t poly)
int fmpz_poly_is_squarefree(const fmpz_poly_t poly)

Returns whether the polynomial ``poly`` is square-free. A non-zero
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns whether the polynomial ``poly`` is square-free. A non-zero
Returns whether the polynomial ``poly`` is square-free.

Comment on lines +1491 to +1494
polynomial is defined to be square-free if its factorisation contains no
non-constant square factors. We also define the zero polynomial to be
square-free. This differs somewhat from the usual definition, e.g. we
consider the polynomial `4 x` in `\mathbb{Z}[x]` as square-free.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
polynomial is defined to be square-free if its factorisation contains no
non-constant square factors. We also define the zero polynomial to be
square-free. This differs somewhat from the usual definition, e.g. we
consider the polynomial `4 x` in `\mathbb{Z}[x]` as square-free.
A polynomial is square-free if it is the zero polynomial or it is not
divisible by a non-constant square polynomial.
Equivalently, if the polynomial has nontrivial double roots over the complex numbers.
This differs somewhat from the usual square-free definition, e.g.
we consider the polynomial `4 x \in \mathbb{Z}[x]` to be square-free.

@edgarcosta
Copy link
Member

I honestly find it confusing that the polynomial zero is square-free, but perhaps a change in the code now is too late.

@albinahlback
Copy link
Collaborator Author

I don't know. If people have a problem with it, I'm down for changing it.

@edgarcosta
Copy link
Member

@fredrik-johansson would it be okay to change the definition of square free?

@fredrik-johansson
Copy link
Collaborator

I'd be happy with 0 being considered not squarefree.

@thofma
Copy link
Contributor

thofma commented Oct 15, 2024

FWIW we came to the same conclusion for Nemo, see Nemocas/Nemo.jl#1510

@albinahlback
Copy link
Collaborator Author

Seems like a reasonable fix before releasing 3.2.0. However, we would have to make sure that this is consistent throughout FLINT. Moreover, it seems like some docstring do not provide the definition of square-free (see docstring for fq_poly_is_squarefree).

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

Successfully merging this pull request may close these issues.

5 participants