#1951: [with patch, needs review] reducation map modulo a number field prime 
ideal
still not 100% done
--------------------------------------------------+-------------------------
 Reporter:  was                                   |        Owner:  was       
     Type:  defect                                |       Status:  new       
 Priority:  major                                 |    Milestone:  sage-3.1.3
Component:  number theory                         |   Resolution:            
 Keywords:  number field residue field reduction  |  
--------------------------------------------------+-------------------------
Comment (by cremona):

 It's a small thing but I just noticed that the number field function
 residue_field() has this definition:
 {{{
     def residue_field(self, prime, names = None, check = False):
 }}}
 where the "check" parameter claims to control whether  "prime" really is
 prime, but this is ignored.  It should be passed down through the call to
 {{{sage.rings.residue_field.ResidueField(prime, names = names)}}}
 which does honour the check parameter.

 Example:
 {{{
 sage: K.<i> = NumberField(x^2 + 1)
 sage: Q = K.ideal(5)
 sage: Q.is_prime()
 False
 sage: K.residue_field(Q, check=False)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/john/sage-3.1.2.rc1/devel/<ipython console> in <module>()

 /home/john/sage-3.1.2.rc1/local/lib/python2.5/site-
 packages/sage/rings/number_field/number_field.py in residue_field(self,
 prime, names, check)
    3000             raise ValueError, "prime must be a prime ideal of
 self"
    3001         import sage.rings.residue_field
 -> 3002         return sage.rings.residue_field.ResidueField(prime, names
 = names)
    3003
    3004     def signature(self):

 /home/john/sage-3.1.2.rc1/devel/residue_field.pyx in
 sage.rings.residue_field.ResidueField (sage/rings/residue_field.c:2778)()

 ValueError: p must be prime
 }}}

 The second patch fixes this.  Note that the default was "check=False",
 while the called function ResidueField() has its default as "check=True".
 I thought it safer to change the deafult to "check=True" since this makes
 the new default behaviour like the old behaviour.  (If you use check=False
 and the ideal is not prime, the first error which arises is a bit obscure:
 {{{
     AttributeError: 'NumberFieldFractionalIdeal' object has no attribute
 '_NumberFieldIdeal__smallest_integer'
 }}}
 since smallest_integer() is defined only for prime ideals.  But something
 has to go wrong at some point in this situation, and at least now it will
 only happen when the user has deliberately turned off checking.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/1951#comment:2>
SAGE <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to