Opened 12 years ago

Closed 9 years ago

#4780 closed defect (worksforme)

relative number field constructor -- error message when given poly of degree < 1 is bad

Reported by: was Owned by: davidloeffler
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: number fields Keywords:
Cc: Merged in:
Authors: Reviewers: Mike Hansen, David Loeffler
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

sage: K.<a> = NumberField(x^2 + 1)
sage: L.<b> = NumberField(K['y'](1))
---------------------------------------------------------------------------
PariError                                 Traceback (most recent call last)

/Users/wstein/sage/build/sage-3.2.2.alpha0/<ipython console> in <module>()

/Users/wstein/sage/build/sage-3.2.2.alpha0/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in NumberField(polynomial, name, check, names, cache, embedding)
    374 
    375     if isinstance(R, NumberField_generic):
--> 376         S = R.extension(polynomial, name, check=check)
    377         if cache:
    378             _nf_cache[key] = weakref.ref(S)

/Users/wstein/sage/build/sage-3.2.2.alpha0/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in extension(self, poly, name, names, check, embedding)
   2570         if name is None:
   2571             raise TypeError, "the variable name must be specified."
-> 2572         return NumberField_relative(self, poly, str(name), check=check, embedding=embedding)
   2573 
   2574     def factor(self, n):

/Users/wstein/sage/build/sage-3.2.2.alpha0/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in __init__(self, base, polynomial, name, latex_name, names, check, embedding)
   4567 
   4568         self.__pari_relative_polynomial = pari(str(polynomial_y))
-> 4569         self.__rnf = self.__base_nf.rnfinit(self.__pari_relative_polynomial)
   4570         
   4571         self.__base_field = base

/Users/wstein/sage/build/sage-3.2.2.alpha0/local/lib/python2.5/site-packages/sage/libs/pari/gen.so in sage.libs.pari.gen._pari_trap (sage/libs/pari/gen.c:38578)()

PariError: not a polynomial (38)
> /Users/wstein/sage/build/sage-3.2.2.alpha0/gen.pyx(8050)sage.libs.pari.gen._pari_trap (sage/libs/pari/gen.c:38578)()

Change History (7)

comment:1 Changed 12 years ago by mhansen

This seems to be better now:

----------------------------------------------------------------------
| Sage Version 4.0.1.rc1, Release Date: 2009-06-04                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: sage: K.<a> = NumberField(x^2 + 1)
sage: sage: L.<b> = NumberField(K['y'](1))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/mhansen/.sage/temp/sage.math.washington.edu/25032/_home_mhansen__sage_init_sage_0.py in <module>()

/scratch/mhansen/release/4.0.1/rc1/sage-4.0.1.rc1/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in NumberField(polynomial, name, check, names, cache, embedding)
    415 
    416     if isinstance(R, NumberField_generic):
--> 417         S = R.extension(polynomial, name, check=check)
    418         if cache:
    419             _nf_cache[key] = weakref.ref(S)

/scratch/mhansen/release/4.0.1/rc1/sage-4.0.1.rc1/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in extension(self, poly, name, names, check, embedding)
   2920             raise TypeError, "the variable name must be specified."
   2921         from sage.rings.number_field.number_field_rel import NumberField_relative
-> 2922         return NumberField_relative(self, poly, str(name), check=check, embedding=embedding)
   2923 
   2924     def factor(self, n):

/scratch/mhansen/release/4.0.1/rc1/sage-4.0.1.rc1/local/lib/python2.5/site-packages/sage/rings/number_field/number_field_rel.pyc in __init__(self, base, polynomial, name, latex_name, names, check, embedding)
    274                 # future, is_irreducible should be made faster for
    275                 # polynomials over number fields -- see ticket #4724
--> 276                 raise ValueError, "defining polynomial (%s) must be irreducible"%polynomial
    277 
    278         self.__gens = [None]

ValueError: defining polynomial (1) must be irreducible

Comments?

comment:2 Changed 12 years ago by davidloeffler

  • Component changed from number theory to number fields
  • Owner changed from was to davidloeffler

comment:3 Changed 9 years ago by mhansen

  • Report Upstream set to N/A

Can this be closed now?

comment:4 Changed 9 years ago by davidloeffler

  • Status changed from new to needs_review

Yes, I think so.

comment:5 Changed 9 years ago by davidloeffler

  • Status changed from needs_review to positive_review

comment:6 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.0 to sage-duplicate/invalid/wontfix

comment:7 Changed 9 years ago by jdemeyer

  • Resolution set to worksforme
  • Reviewers set to Mike Hansen, David Loeffler
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.