#13662: matrix() fails for polynomial quoutient rings over inexact rings
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner: roed
Type: defect | Status: needs_work
Priority: minor | Milestone: sage-6.3
Component: padics | Resolution:
Keywords: sd59 | Merged in:
Authors: Julian Rueth | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/ticket/13662 | 50132187410c11a5c4a5407a28453d14446b87d2
Dependencies: #14482 | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by saraedum:
Old description:
> Currently, the following code fails:
> {{{
> sage: R.<x> = Zp(3,2)[]
> sage: S.<xbar> = R.quo(x^2)
> sage: xbar.matrix()
> TypeError: cannot construct an element of Full MatrixSpace of 2 by 2
> dense matrices over 3-adic Ring with capped relative precision 2 from [0,
> 1 + O(3^2), 0, 0, O(3^2)]
> }}}
>
> The problem is that the p-adic quotient with remainder does not determine
> the degree of the result and therefore `p%f` might have (inexact zero)
> coefficients beyond its degree:
> {{{
> sage: R.<x> = Qp(3,5)[]
> sage: S.<xbar> = R.quo(x^2 + (O(3^2)*x) + (3+O(3^2)))
> sage: xbar^3
> (O(3^5))*xbar^3 + (O(3^2))*xbar^2 + (2*3 + O(3^2))*xbar
> }}}
>
> Just throwing away such coefficients would be wrong however. In the above
> example this would give `(2*3 + O(3^2))*xbar` with an *exact* constant
> coefficient `0` which is incorrect. The correct thing to do is to reduce
> any leading inexact zero coefficients with the defining equation of the
> quotient. This is done in this ticket and gives the correct result:
> {{{
> sage: R.<x> = Qp(3,5)[]
> sage: S.<xbar> = R.quo(x^2 + (O(3^2)*x) + (3+O(3^2)))
> sage: xbar^3
> (2*3 + O(3^2))*xbar + (O(3^3))
> }}}
New description:
Currently, the following code fails:
{{{
sage: R.<x> = Zp(3,2)[]
sage: S.<xbar> = R.quo(x^2+1)
sage: xbar.matrix()
TypeError: cannot construct an element of Full MatrixSpace of 2 by 2 dense
matrices over 3-adic Ring with capped relative precision 2 from [0, 1 +
O(3^2), 2 + 2*3 + O(3^2), 0, O(3^2)]!
}}}
The problem is that the p-adic quotient with remainder does not determine
the degree of the result and therefore `p%f` might have (inexact zero)
coefficients beyond its degree:
{{{
sage: R.<x> = Qp(3,5)[]
sage: S.<xbar> = R.quo(x^2 + (O(3^2)*x) + (3+O(3^2)))
sage: xbar^3
(O(3^5))*xbar^3 + (O(3^2))*xbar^2 + (2*3 + O(3^2))*xbar
}}}
Just throwing away such coefficients would be wrong however. In the above
example this would give `(2*3 + O(3^2))*xbar` with an *exact* constant
coefficient `0` which is incorrect. The correct thing to do is to reduce
any leading inexact zero coefficients with the defining equation of the
quotient. This is done in this ticket and gives the correct result:
{{{
sage: R.<x> = Qp(3,5)[]
sage: S.<xbar> = R.quo(x^2 + (O(3^2)*x) + (3+O(3^2)))
sage: xbar^3
(2*3 + O(3^2))*xbar + (O(3^3))
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/13662#comment:18>
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.