#10017: reduced_basis for number field multiples wrong
-----------------------------+----------------------------------------------
   Reporter:  schilly        |       Owner:  davidloeffler
       Type:  defect         |      Status:  new          
   Priority:  major          |   Milestone:  sage-4.6     
  Component:  number fields  |    Keywords:               
     Author:                 |    Upstream:  N/A          
   Reviewer:                 |      Merged:               
Work_issues:                 |  
-----------------------------+----------------------------------------------
 This was reported by the "report a problem" link:

 The reduced_basis for number fields applies LLL to basis of the maximal
 order in order to get a reduced basis. The problem is that after applying
 LLL, it multiples the transformation matrix by the vector [1,a,a^2,...],
 where 'a' is generator of the field - instead of using the vector it
 actually used for the maximal order.

 How to reproduce:
 {{{
 x = QQ['x'].0
 k = NumberField(x^6 + 2218926655879913714112*x^4 - \
 32507675650290949030789018433536*x^3 + \
 4923635504174417014460581055002374467948544*x^2 - \
 36066074010564497464129951249279114076897746988630016*x + \
 264187244046129768986806800244258952598300346857154900812365824,'a')
 new_basis = k.reduced_basis()
 print new_basis[0].minpoly()
 }}}
 This prints a crazy big polynomial. Looking a bit at what is returned it
 is clear that reduced_basis is multiplying the transformation matrix by
 the wrong vector.

 To solve you just need to multiply by the vector of generators of the
 maximal order:
 {{{
 mp = pari( k.Minkowski_embedding(k.maximal_order().gens(), prec=120) )
 ml = sage.libs.pari.gen.gen.qflll(mp)
 T = matrix([[ZZ(y) for y in list(x)] for x in list(ml)]).transpose()
 r = Matrix(O.gens())* T
 for rr in r[0]:
 print rr.minpoly()
 }}}
 This works fine.

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