#13302: Matrix constructor does not return over padic field
--------------------------------+-------------------------------------------
Reporter: saraedum | Owner: jason, was
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-5.3
Component: padics | Resolution:
Keywords: matrix space | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Julian Rueth | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by mderickx):
I think the real problem is that your example is missing some parentheses
{{{
sage: MatrixSpace(Qp(3),1)([[Qp(3).zero()]])
[0]
sage: MatrixSpace(Qp(3),1,1)([[Qp(3)(4/3)]])
[3^-1 + 1 + O(3^19)]
}}}
This causes the matrix constructor to look if it can unpack the element
Qp(3).zero()] in the list [Qp(3).zero()] .
If you want it also to work with fewer parentheses I'd say that it's the
fault of MatrixSpace.__call__ not checking if Qp(3).zero() is a ring
element before just trying to unpack it.
Note that it's not only the p-adics that give rise to strange behaviour.
You can also use polynomials:
{{{
sage: K.<x>=QQ[]
sage: MatrixSpace(K,2)([x+2,3*x+4])
[2 1]
[4 3]
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13302#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.