#10771: gcd and lcm for fraction fields
--------------------------------+-------------------------------------------
Reporter: SimonKing | Owner: AlexGhitza
Type: defect | Status: needs_review
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: |
--------------------------------+-------------------------------------------
Comment(by SimonKing):
Hi Marco,
sorry, I forgot to explain how I addressed your complaints:
Replying to [comment:10 mstreng]:
> 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.
Yep, that was a mistake. We now have:
{{{
sage: M = Matrix(GF(3),2,2,[1,2,0,1]); M
[1 2]
[0 1]
sage: GF(2)(1).lcm(M)
---------------------------------------------------------------------------
ArithmeticError Traceback (most recent call
last)
...
ArithmeticError: The second argument can not be interpreted in the parent
of the first argument. Can't compute the lcm
sage: GF(2)(1).gcd(M)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (4, 0))
---------------------------------------------------------------------------
ArithmeticError Traceback (most recent call
last)
...
ArithmeticError: The second argument can not be interpreted in the parent
of the first argument. Can't compute the gcd
}}}
> * 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:
I changed the doc string to lower case.
> * 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.
Done.
> * Your tests with {{{R.<q> = ZZ.extension(x^2+5)}}} is unrelated to
fraction field:
You are right. My intention was to ''start'' with `R`, show that there is
no gcd in R, and then expose what happens in `Frac(R)`. The test is
changed accordingly.
Best regards,
Simon
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10771#comment:22>
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.