#7870: dozens of failures in magma optional test suite on skynet (eno) with
sage-4.3
-----------------------------+----------------------------------------------
Reporter: was | Owner: cremona
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.4
Component: interfaces | Keywords: Magma
Author: William Stein | Upstream: N/A
Reviewer: John Cremona | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Comment(by was):
John,
I think you should give my patch a positive review anyways. The problem
above is that in Magma V2.16-7, this works fine:
{{{
[wst...@eno ~]$ magma
Magma V2.16-7 Mon Apr 26 2010 22:51:34 on eno [Seed = 294390646]
Type ? for help. Type <Ctrl>-D to quit.
> R<x> := PolynomialRing(Integers());
> x*1.0;
$.1
>
}}}
However, in older versions of Magma, it doesn't:
{{{
flat:~ wstein$ magma
Magma V2.15-11 Mon Apr 26 2010 19:53:21 on flat [Seed = 4201111680]
Type ? for help. Type <Ctrl>-D to quit.
> R<x> := PolynomialRing(Integers());
> x*1.0;
>> x*1.0;
^
Runtime error in '*': Bad argument types
Argument types given: RngUPolElt[RngInt], FldReElt
}}}
Since Magma's capabilities, etc., change a *lot* -- even from minor
version to version -- I think the Sage optional doctests should be
targeted at the latest released version of Magma.
Note that the computation is multiplying a polynomial over ZZ[x] by a
floating point numbers. In Sage, there is a beautiful coercion model that
makes most such things "just work". In Magma, one implements the '*'
function for every conceivable choice of pairs of types... and I guess
somebody got around to eventually implementing this one.
Just to emphasize how totally arbitrary (and sad) Magma's system still is
after all these years, notice that even in Magma V2.16-7, the same
computation with polynomials over ZZ and rational numbers doesn't work!
{{{
> x + 1/2;
>> x + 1/2;
^
Runtime error in '+': Bad argument types
Argument types given: RngUPolElt[RngInt], FldRatElt
> x*(1/2);
>> x*(1/2);
^
Runtime error in '*': Bad argument types
Argument types given: RngUPolElt[RngInt], FldRatElt
>
}}}
Sage had the same sort of silly anomalies until people like David Harvey,
Craig Citro, David Roe, and *Robert Bradshaw* and others stepped in and
greatly improved the situation.
{{{
sage: R.<x> = ZZ[]
sage: x * 1.0
x
sage: parent(x * 1.0)
Univariate Polynomial Ring in x over Real Field with 53 bits of precision
sage: x + 1/2
x + 1/2
sage: (1/2)*x
1/2*x
}}}
Sage coercion is still of course far from perfect. But it's also far from
sucking.
-- William
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7870#comment:7>
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.