On Jul 30, 7:36 am, mario <mario.pern...@gmail.com> wrote:
>
> I have not tried using other rings; can you give me an example to try?
>
Sure!  The patch works over any commutative ring that sage supports;
here are a couple:

sage: M.<a,b,c,d> = MPowerSeriesRing(GF(11),4); M
Multivariate Power Series Ring in a, b, c, d over Finite Field of size
11
sage: p = 3 + a + 7*b + 2*c^2 - 5*a^2*d - b^4 - 5*c*d^3 + 5*c^5 - c^8
+ 2*a^5*b^2*c^2 + M(0).O(10)
sage: %time p^(-30);

sage: P.<x,y,z> = PolynomialRing(ZZ,3); P
Multivariate Polynomial Ring in x, y, z over Integer Ring
sage: H.<f,g,h,k> = MPowerSeriesRing(P,4); H
Multivariate Power Series Ring in f, g, h, k over Multivariate
Polynomial Ring in x, y, z over Integer Ring
sage: q = 1 + H(-x*y - y^2 - 4*y*z + 3*z^2 + 1)*h + H(x*y + 3*x*z +
y)*k + H(-x^2 + y^2 + x*z - 2*z^2 + z)*f + H(-x*y + 4*x*z - z^2 +
2*x)*h*k + H(-y^2 + 2*z^2 + 12*y - 1)*f*g*h^2 + H(-x*y - 12*z^2 -
y)*f^2*g^2 + H(1 + 6*z)*f*k^3 + H(0).O(5)
sage: %time q^(-1);


Also, it might make more sense to compare your code with sage's
multivariate polynomial arithmetic directly; the multivariate power
series patch is mostly just a wrapper for the polynomial arithmetic,
and I haven't (yet) made any attempt to optimize it.  Here are the
commands to construct some relevant polynomial rings:

sage: Q.<x,y,z,w,v> = PolynomialRing(GF(7),5); Q
Multivariate Polynomial Ring in x, y, z, w, v over Finite Field of
size 7
sage: R.<a,b,c> = PolynomialRing(RR,3); R
Multivariate Polynomial Ring in a, b, c over Real Field with 53 bits
of precision

-Niles


-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to