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 b  
    40114011       
    40124012        - ``important`` -- (default:True) bool.  If False, raise a
    40134013          ``RuntimeError`` if we need to do a difficult discriminant
    4014           factorization.  Useful when the PARI nf structure is useful
     4014          factorization.  Useful when the integral basis is useful
    40154015          but not strictly required.
    40164016       
    40174017        EXAMPLES::
  • sage/rings/polynomial/polynomial_element.pyx

    diff --git a/sage/rings/polynomial/polynomial_element.pyx b/sage/rings/polynomial/polynomial_element.pyx
    a b  
    27592759            sage: f = (x+a)^50 - (a-1)^50
    27602760            sage: len(factor(f))
    27612761            6
     2762            sage: pari(K.discriminant()).factor(limit=0)
     2763            [-1, 1; 3, 15; 23, 1; 887, 1; 12583, 1; 2354691439917211, 1]
    27622764            sage: factor(K.discriminant())
    27632765            -1 * 3^15 * 23 * 887 * 12583 * 6335047 * 371692813
    27642766
     
    27762778            x^2 + 1
    27772779            sage: factor( (x - a) * (x + 2*a) )
    27782780            (x - a) * (x + 2*a)
     2781
     2782        A test where nffactor used to fail without a nf structure::
     2783
     2784            sage: x = polygen(QQ)
     2785            sage: K = NumberField([x^2-1099511627777, x^3-3],'a')
     2786            sage: x = polygen(K)
     2787            sage: f = x^3 - 3
     2788            sage: factor(f)
     2789            (x - a1) * (x^2 + a1*x + a1^2)
    27792790        """
    27802791        # PERFORMANCE NOTE:
    27812792        #     In many tests with SMALL degree PARI is substantially