#17671: Implement gcd for fraction fields
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.5
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/17671                 |  d8a03d7fa1dd0e401adbae8e2a16ccbfb1902392
   Dependencies:  #17673             |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:

Old description:

> As reported on [https://groups.google.com/forum/#!topic/sage-
> support/AYDqdxy5fTw sage-support], gcd and xgcd disagree on fraction
> fields
> {{{
> sage: gcd(6/1,2/1)
> 2
> sage: xgcd(6/1,2/1)
> (1, 1/6, 0)
> }}}
>
> We implement a `xgcd` for the `QuotientFields` category in order to fix
> that (there was a `gcd` here without a `xgcd`).

New description:

 As reported on [https://groups.google.com/forum/#!topic/sage-
 support/AYDqdxy5fTw sage-support], gcd and xgcd disagree on fraction
 fields
 {{{
 sage: gcd(6/1,2/1)
 2
 sage: xgcd(6/1,2/1)
 (1, 1/6, 0)
 }}}

 We implement a `xgcd` for the `QuotientFields` category in order to fix
 that (there was a `gcd` here without a `xgcd`). We also check that for PID
 the `gcd` and `xgcd` agree by implementing a `_test_gcd_vs_xgcd`. With
 that branch
 {{{
 sage: xgcd(6/1,2/1)
 (2, 0, 1)
 sage: xgcd(5/2, 3/4)
 (1/4, -1/2, 2)
 }}}
 which is consistent with `gcd`.

 QUESTIONS:

 1. In the previous implementation of gcd in `sage.categories.fields` there
 is a backward compatibility weirdness
   {{{
   sage: gcd(2.0, 4.0)
   2
   sage: gcd(2.0, 4.0).parent()
   Integer Ring
   }}}
   For the moment, I propagated this to `lcm` and `xgcd`.

 2. There is a method `xgcd` implemented for univariate polynomial over ZZ.
 This is not a proper name since it has nothing to do with `gcd` (see
 [https://groups.google.com/forum/#!topic/sage-devel/JV8fCPUqTzo this sage-
 devel thread])

--

--
Ticket URL: <http://trac.sagemath.org/ticket/17671#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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to