#10771: gcd and lcm for fraction fields
--------------------------------+-------------------------------------------
   Reporter:  SimonKing         |       Owner:  AlexGhitza             
       Type:  defect            |      Status:  needs_work             
   Priority:  major             |   Milestone:  sage-4.7               
  Component:  basic arithmetic  |    Keywords:  gcd lcm fraction fields
     Author:  Simon King        |    Upstream:  N/A                    
   Reviewer:  Marco Streng      |      Merged:                         
Work_issues:                    |  
--------------------------------+-------------------------------------------
Changes (by mstreng):

  * status:  needs_review => needs_work


Comment:

 New complaints, sorry.

  * I don't really like this:
    {{{
    sage: M = Matrix(GF(3),2,2,[1,2,0,1]); M
    [1 2]
    [0 1]
    sage: GF(2)(1).lcm(M)
    1
    }}}
    I think you should first try to coerce other to self.parent() in gcd
 and lcm for Field elements.

  * Line 64 of quotient_fields.py "{{{both GCD and LCM, it is possible to
 be a bit more specific}}}"
    uses capital letters GCD and LCM, while the methods that it
 (quasi-)refers to are lower case:
    {{{AttributeError: 'sage.rings.rational.Rational' object has no
 attribute 'GCD'}}}

  * Next line: "define the GCD uniquely up to a unit in the base ring".
 Write "of" instead of "in"
    so that it is clear that you are not saying that the GCD is in the base
 ring.

  * Your tests with {{{R.<q> = ZZ.extension(x^2+5)}}} is unrelated to
 fraction field: q is 1
    {{{
    sage: R.<q> = ZZ.extension(x^2+5)
    sage: g = R.gens(); g
    [1, q]
    sage: q
    1
    sage: g[1]
    q
    sage: g[1] == q
    False
    }}}
    All your examples involving q get coerced to ZZ by the global GCD and
 LCM, so you should
    find other examples. This seems to work:
    {{{
    sage: gcd(g[1],1)
    TypeError: unable to find gcd of q and 1
    sage: gcd(g[1]/1,1)
    1
    }}}
    (Correct behaviour both times)

 Time to catch a bus, may have more comments later.

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