#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 kcrisman):
> > Really, in some sense the new version is 'better' because it keeps the
minus where the user put it. Do `(-I - 1/3*sqrt(2))^2` and `(I +
1/3*sqrt(2))^2` do anything different from before?
>
> They do.
> sage: (-I - 1/3*sqrt(2))^2
> 1/9*(-sqrt(2) - 3*I)^2
> # Was: 1/9*(sqrt(2) + 3*I)^2
Okay, that's what I figured would happen.
> sage: (I + 1/3*sqrt(2))^2
> 1/9*(sqrt(2) + 3*I)^2
> # Was: 1/9*(sqrt(2) + 3*I)^2
Okay, that is the same as before in any case.
> Really I don't understand where that comes from. Namely, as far as I
know, the sign of gcd or lcm did not change. The only difference in
gcd/lcm examples involving `I` and `sqrt(2)` is the fact that without my
patch an error would be raised.
Yes,
{{{
sage: gcd(I + 1/3*sqrt(2),I + 1/3*sqrt(2))
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
}}}
Interesting. Like I said earlier, Sage now sends such symbolic things to
Pynac/Ginac, which however needs to use Sage again in order to do certain
calculations like this (Mike Hansen explained it well in your thread on
sage-devel). So apparently in the past it decided to factor out a -1 in
certain cases based on some gcd - maybe just a default of 1 or something -
whereas now it does not, due to the new gcd. What does
{{{
sage: gcd(I + 1/3*sqrt(2),I + 1/3*sqrt(2))
}}}
do after the patch? What happens with this?
{{{
sage: gcd(4,2+2*I*sqrt(3))
}}}
Notice that I am purposely taking two things NOT in a polynomial or
extension thing, where it can be calculated whether it's a UFD. In the
symbolic ring, who knows what's "right"?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10771#comment:25>
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.