Opened 5 years ago

Closed 5 years ago

#20435 closed defect (fixed)

factorisation of polynomials over integers has wrong parent

Reported by: chapoton Owned by:
Priority: critical Milestone: sage-7.2
Component: algebra Keywords: factor, polynomial, parent
Cc: tscrim, jdemeyer Merged in:
Authors: Frédéric Chapoton Reviewers: Bruno Grenet
Report Upstream: N/A Work issues:
Branch: 3e28bfc (Commits, GitHub, GitLab) Commit: 3e28bfc536ac1b69c365213f4ff385874b6aee1e
Dependencies: Stopgaps:

Status badges

Description (last modified by chapoton)

sage: x,y=polygen(ZZ,'x,y')
sage: p=x**2-y**2
sage: p.parent()
Multivariate Polynomial Ring in x, y over Integer Ring
sage: factor(p)
(x - y) * (x + y)
sage: factor(p)[0][0].parent()
Multivariate Polynomial Ring in x, y over Multivariate Polynomial Ring in x, y over Integer Ring

but no problem over QQ

Change History (7)

comment:1 Changed 5 years ago by chapoton

  • Cc tscrim jdemeyer added
  • Description modified (diff)

comment:2 Changed 5 years ago by chapoton

  • Keywords factor polynomial parent added
  • Priority changed from major to critical

comment:3 Changed 5 years ago by chapoton

caused by the line

+                FF = [(f[0].change_ring(self._parent), f[1]) for f in F]

in #17840

comment:4 Changed 5 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to public/20435
  • Commit set to 5ec9040c9bbf46103eec0505cfec1e350f414dbf
  • Status changed from new to needs_review

New commits:

5ec9040trac #20435 fixing the parents in factorisation of integer multi-polynomials

comment:5 Changed 5 years ago by git

  • Commit changed from 5ec9040c9bbf46103eec0505cfec1e350f414dbf to 3e28bfc536ac1b69c365213f4ff385874b6aee1e

Branch pushed to git repo; I updated commit sha1. New commits:

3e28bfctrac #20435 correct link to trac

comment:6 Changed 5 years ago by bruno

  • Reviewers set to Bruno Grenet
  • Status changed from needs_review to positive_review

Sorry for that! The correction looks good to me.

P.S.: I suspected that using f[0].change_ring(self._parent.base_ring()) would have been faster than the conversion self._parent(f[0]) but it appears not to be the case!

comment:7 Changed 5 years ago by vbraun

  • Branch changed from public/20435 to 3e28bfc536ac1b69c365213f4ff385874b6aee1e
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.