Opened 10 years ago

Closed 10 years ago

#11218 closed defect (fixed)

factor is broken for polynomials over relative number fields

Reported by: lftabera Owned by: tbd
Priority: major Milestone: sage-4.7.1
Component: factorization Keywords: factorization, tower of number fields
Cc: Merged in: sage-4.7.1.alpha3
Authors: Francis Clarke Reviewers: Luis Felipe Tabera Alonso
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

I suspect this is a regression, but I do not have and old sage copy right now

sage: K=QQ[I]['x,t']
sage: K.inject_variables()
Defining x, t
sage: f=t^2+1
sage: f.factor()
(t + (-I)) * (t + (I))
sage: K=QQ[sqrt(5),I]['t']  
sage: K.inject_variables()
Defining t
sage: f=t^2+1   
sage: f.factor()
(x + I) * (x - I)
sage: prod(f.factor())==f
False
sage: f.parent()
Univariate Polynomial Ring in t over Number Field in sqrt5 with defining polynomial x^2 - 5 over its base field
sage: prod(f.factor()).parent()
Univariate Polynomial Ring in x over Number Field in sqrt5 with defining polynomial x^2 - 5 over its base field

Factor of uni-variate polynomials in polynomial rings (uni and multivariate) over towers of number fields are broken, since the output variable is always 'x', so it the output is in the wrong ring.

Attachments (1)

trac_11218_factorization_fix.patch (1.5 KB) - added by fwclarke 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by fwclarke

comment:1 Changed 10 years ago by fwclarke

  • Authors set to Francis Clarke
  • Status changed from new to needs_review
  • Type changed from PLEASE CHANGE to defect

In the attached patch this defect is corrected very easily and a doctest is altered to demonstrate that the problem is solved.

comment:2 Changed 10 years ago by lftabera

  • Status changed from needs_review to positive_review

The problem has been solved. It was an easy mistake in the code. The doctest shows that the problem has disapeared and the documentation looks god.

Buildbot says that doctest pass.

Positive review.

comment:3 Changed 10 years ago by jdemeyer

  • Reviewers set to Luis Felipe Tabera Alonso

comment:4 Changed 10 years ago by jdemeyer

  • Merged in set to sage-4.7.1.alpha3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.