#11586: bug in p-adic extension norm method
-------------------------------------+--------------------------------------
   Reporter:  was                    |          Owner:  roed           
       Type:  defect                 |         Status:  positive_review
   Priority:  major                  |      Milestone:  sage-4.7.2     
  Component:  padics                 |       Keywords:  padic          
Work_issues:                         |       Upstream:  N/A            
   Reviewer:  Jennifer Balakrishnan  |         Author:  David Roe      
     Merged:                         |   Dependencies:  #8241          
-------------------------------------+--------------------------------------

Old description:

> {{{
> R.<x> = QQ[]
> f = x^2 + 3*x + 1
> K = Qp(7)
> M.<a> = K.extension(f)
> M(7).norm()
> }}}
> The above outputs {{{1 + O(7^20)}}}, which is completely wrong.  The norm
> should be {{{7^2 + O(7^20)}}}, I think -- anyways, it should be divisible
> by 7.
>
> The problem is that the actual code for the norm, which ones sees by
> typing {{{a.norm??}}} assumes that the generator for M is in fact a
> generator for the maximal ideal of the ring of integers.  However, this
> assumption is just completely false.
>
> Typing {{{a.norm???}}} we see
> {{{
> ...
>     norm_of_uniformizer = (-1)**self.parent().degree() *
> self.parent().defining_polynomial()[0]
>     if self.valuation() == 0:
>         return
> self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det())
>     else:
>         return
> self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det()) *
> norm_of_uniformizer**self.valuation()
> }}}
>
> The above is wrong as mentioned above.  Moreover, it is nonoptimal in
> that norm_of_uniformizer is computed but never used in the case when
> {{{self.valuation()==0}}}.
>
> This bug caused some confusion when computing with p-adic L-series for a
> research paper...

New description:

 {{{
 R.<x> = QQ[]
 f = x^2 + 3*x + 1
 K = Qp(7)
 M.<a> = K.extension(f)
 M(7).norm()
 }}}
 The above outputs {{{1 + O(7^20)}}}, which is completely wrong.  The norm
 should be {{{7^2 + O(7^20)}}}, I think -- anyways, it should be divisible
 by 7.

 The problem is that the actual code for the norm, which ones sees by
 typing {{{a.norm??}}} assumes that the generator for M is in fact a
 generator for the maximal ideal of the ring of integers.  However, this
 assumption is just completely false.

 Typing {{{a.norm???}}} we see
 {{{
 ...
     norm_of_uniformizer = (-1)**self.parent().degree() *
 self.parent().defining_polynomial()[0]
     if self.valuation() == 0:
         return
 self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det())
     else:
         return
 self.parent().ground_ring()(self.unit_part().matrix_mod_pn().det()) *
 norm_of_uniformizer**self.valuation()
 }}}

 The above is wrong as mentioned above.  Moreover, it is nonoptimal in that
 norm_of_uniformizer is computed but never used in the case when
 {{{self.valuation()==0}}}.

 This bug caused some confusion when computing with p-adic L-series for a
 research paper...

 ----

 Apply [attachment:http://11586.patch] to the Sage library.

--

Comment(by leif):

 Make someone review #8241...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11586#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
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