#1956: implement multivariate power series arithmetic
---------------------------------------------------------------------------------------------------+
Reporter: was
| Owner: pernici
Type: enhancement
| Status: needs_review
Priority: major
| Milestone: sage-4.6.1
Component: commutative algebra
| Keywords: multivariate power series
Author: Niles Johnson
| Upstream: N/A
Reviewer: Martin Albrecht, Simon King
| Merged:
Work_issues: multivariate series on 1 generator should remain different from a
univariate series |
---------------------------------------------------------------------------------------------------+
Comment(by pernici):
This is a follow-up of my previous mail on random_element
in multivariate series.
`R.random_element` calls `R.__poly_ring.random_element`.
From the documentation of `MPolynomialRing_generic.random_element`:
`First monomials are chosen uniformly random from the set of all
possible monomials of degree up to `d` (inclusive). This means
that it is more likely that a monomial of degree `d` appears than
a monomial of degree `d-1` because the former class is bigger.`
This argument is relevant also for multivariate series
{{{
sage: R.<a,b,c,d> = PowerSeriesRing(QQ,4)
sage: p = (1 + a + 2*b + 3*c + 4*d + R(0).O(16))^-5
sage: [len(x.exponents()) for x in p._bg_value]
[1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816]
}}}
There are many more terms with high degrees for the reason
given in the quote.
Take a random series of comparable length
{{{
sage: p1 = R.random_element(16,4000)
sage: [len(x.exponents()) for x in p1._bg_value]
[0, 4, 3, 13, 22, 44, 54, 75, 114, 150, 190, 236, 307, 371, 440, 554]
}}}
The distribution is fairly similar.
However taking `bound` small in R.random_element(prec,bound)
the lowest total degree is high
{{{
sage: p1 = R.random_element(16)
sage: [len(x.exponents()) for x in p1._bg_value]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1]
sage: p1 = R.random_element(16,16)
sage: [len(x.exponents()) for x in p1._bg_value]
[0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 3, 0, 2]
}}}
With a high number of variables the situation gets worse;
to get series starting with small lowest total degree
`bound` should be extremely high
{{{
sage: R = PowerSeriesRing(QQ,100,'t')
sage: p = R.random_element(10,100); sum(p.exponents()[0])
9
sage: p = R.random_element(10,1000); sum(p.exponents()[0])
7
sage: p = R.random_element(10,10000); sum(p.exponents()[0])
7
}}}
In power series with finite precision `prec`
lower degrees are more important than higher degrees;
if this were not so it would not make sense to throw away terms
with degree higher than prec-1. So I think that lower degrees
should weight more than high degrees in the choice of random
elements.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/1956#comment:73>
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.