Opened 7 years ago

Last modified 7 years ago

#20003 new defect

Incorrect output of squarefree_decomposition for polynomials over finite fields

Reported by: Lennart Ackermans Owned by:
Priority: major Milestone: sage-7.1
Component: factorization Keywords:
Cc: wbhart, Marco Streng Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Lennart Ackermans)

When using squarefree_decomposition on linear polynomials over a finite field, the coefficients are not divided by the unit part, resulting in an incorrect output.

sage: K.<x> = GF(7)[]
sage: (6*x+3).squarefree_decomposition()
(6) * (6*x + 3)
sage: (6*x+3).squarefree_decomposition().expand()
x + 4
sage: K.<x> = GF(5)[]
sage: (2*x).squarefree_decomposition()
(2) * 2*x

Attachments (1)

nmod_poly_linkage.pxi.patch (679 bytes) - added by Lennart Ackermans 7 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 7 years ago by Lennart Ackermans

Description: modified (diff)

comment:2 Changed 7 years ago by Marco Streng

Cc: wbhart Marco Streng added

Is this a bug in Flint or does Sage wrap Flint incorrectly in factor_helper?

comment:3 Changed 7 years ago by Lennart Ackermans

It seems Flint doesn't return a monic factor in case of a linear input. I attached a patch to "fix" it.

Changed 7 years ago by Lennart Ackermans

Attachment: nmod_poly_linkage.pxi.patch added
Note: See TracTickets for help on using tickets.