# Ticket #11890: 11890_reviewer.patch

File 11890_reviewer.patch, 1.9 KB (added by lftabera, 9 years ago)
• ## sage/rings/number_field/number_field.py

```# HG changeset patch
# User Luis Felipe Tabera Alonso <lftabera@yahoo.es>
# Parent 66fe307599046e23568dcc7347cd6f6d90c234a7
Reviewer patch to 11890 Sage cannot factor polynomials over number fields with unfactorable discriminant

diff --git a/sage/rings/number_field/number_field.py b/sage/rings/number_field/number_field.py```
 a - ``important`` -- (default:True) bool.  If False, raise a ``RuntimeError`` if we need to do a difficult discriminant factorization.  Useful when the PARI nf structure is useful factorization.  Useful when the integral basis is useful but not strictly required. EXAMPLES::
• ## sage/rings/polynomial/polynomial_element.pyx

`diff --git a/sage/rings/polynomial/polynomial_element.pyx b/sage/rings/polynomial/polynomial_element.pyx`
 a sage: f = (x+a)^50 - (a-1)^50 sage: len(factor(f)) 6 sage: pari(K.discriminant()).factor(limit=0) [-1, 1; 3, 15; 23, 1; 887, 1; 12583, 1; 2354691439917211, 1] sage: factor(K.discriminant()) -1 * 3^15 * 23 * 887 * 12583 * 6335047 * 371692813 x^2 + 1 sage: factor( (x - a) * (x + 2*a) ) (x - a) * (x + 2*a) A test where nffactor used to fail without a nf structure:: sage: x = polygen(QQ) sage: K = NumberField([x^2-1099511627777, x^3-3],'a') sage: x = polygen(K) sage: f = x^3 - 3 sage: factor(f) (x - a1) * (x^2 + a1*x + a1^2) """ # PERFORMANCE NOTE: #     In many tests with SMALL degree PARI is substantially