Opened 10 years ago

Closed 10 years ago

# factor is broken for polynomials over relative number fields

Reported by: Owned by: lftabera tbd major sage-4.7.1 factorization factorization, tower of number fields sage-4.7.1.alpha3 Francis Clarke Luis Felipe Tabera Alonso N/A

### 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.

### 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.