Opened 6 years ago

Last modified 6 years ago

#20003 new defect

Incorrect output of squarefree_decomposition for polynomials over finite fields

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

Status badges

Description (last modified by lackermans)

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 lackermans 6 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 years ago by lackermans

  • Description modified (diff)

comment:2 Changed 6 years ago by mstreng

  • Cc wbhart mstreng added

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

comment:3 Changed 6 years ago by lackermans

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

Changed 6 years ago by lackermans

Note: See TracTickets for help on using tickets.