#10464: m-th power residue symbol
------------------------------------+---------------------------------------
   Reporter:  katestange            |       Owner:  davidloeffler
       Type:  enhancement           |      Status:  needs_work   
   Priority:  minor                 |   Milestone:  sage-4.6.1   
  Component:  number fields         |    Keywords:  cubic residue
     Author:  Katherine Stange      |    Upstream:  N/A          
   Reviewer:                        |      Merged:               
Work_issues:  docstring formatting  |  
------------------------------------+---------------------------------------

Comment(by fwclarke):

 I think there are a couple of things which will make the ideal
 `residue_symbol` function a little faster:

  1. There should be no need to have the default `check=True` when
 recursively applying the function to the prime factors of the ideal since
 all the checks will have already been performed.
  1. The final loop can be avoided by calculating a discrete log in the
 residue field.

 Thus I think the last few lines of the definition should read something
 like:

 {{{
         if not self.is_prime():
             return prod(Q.residue_symbol(e, m, check=False)**i for Q, i in
 self.factor())
         k = self.residue_field()
         r = k(e)**((k.order() - 1)/m)
         resroot = primroot**(rootorder/m)
         from sage.groups.generic import discrete_log
         j = discrete_log(k(resroot), k(r), ord=m)
         return resroot**j
 }}}
 One other little thing.  I think it is safer to write
 `self.smallest_integer()` rather than `ZZ(self.gens()[0])`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10464#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