#13958: number of generators of number field ideal blows up under multiplication
-----------------------------+----------------------------------------------
   Reporter:  mstreng        |             Owner:  davidloeffler                
          
       Type:  defect         |            Status:  new                          
          
   Priority:  major          |         Milestone:  sage-5.7                     
          
  Component:  number fields  |          Keywords:  number field ideal 
multiplication power
Work issues:                 |   Report Upstream:  N/A                          
          
  Reviewers:                 |           Authors:                               
          
  Merged in:                 |      Dependencies:                               
          
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 With
 {{{
 K = QQ[sqrt(2)]
 I = K.ideal(2).factor()[0][0]
 I = I*I; I.ngens()
 4
 I = I*I; I.ngens()
 16
 I = I*I; I.ngens()
 256
 I = I*I; I.ngens()
 65536
 }}}
 the first three squarings are fast, the fourth starts to be a bit slower,
 and if you try a fifth, it will take up all your memory.
 The reason is that that the number of generators is multiplied with every
 multiplication and never reduced back to 1 or 2 with gens_reduced or
 gens_two, as you can see from the output.

 Addition suffers from the same problem, but the result is less dramatic
 {{{
 sage: I = K.ideal(2).factor()[0][0]
 sage: I = I+I; I.ngens()
 4
 sage: I = I+I; I.ngens()
 8
 sage: I = I+I; I.ngens()
 16
 sage: I = I+I; I.ngens()
 32
 sage: I = I+I; I.ngens()
 64
 sage: I = I+I; I.ngens()
 128
 sage: I = I+I; I.ngens()
 256
 }}}

 Solution: implement {{{__mul__}}} for {{{NumberFieldFractionalIdeal}}}
 (instead of inheriting the function from Ideal) and use gens_two or
 gens_reduced before giving the output. Or wrap functions from pari.

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