Ticket #11218(closed defect: fixed)

Opened 2 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 N/A Luis Felipe Tabera Alonso Francis Clarke sage-4.7.1.alpha3

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.

Change History

comment:1 Changed 2 years ago by fwclarke

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

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 2 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 2 years ago by jdemeyer

• Reviewers set to Luis Felipe Tabera Alonso

comment:4 Changed 2 years ago by jdemeyer

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