-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make sparsity a decision of the user #34636
Comments
Changed keywords from none to LazyPowerSeries |
Author: Martin Rubey |
This comment has been minimized.
This comment has been minimized.
Commit: |
Last 10 new commits:
|
Dependencies: #34552 |
comment:4
A sparse representation does not make sense also for |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
From #34611: it may make sense to make
Another question: it may make sense to make The benefit of a dense representation of In cases when we apply a very simple function to each coefficient, as in |
comment:9
I am wondering how much we even want the sparsity in the streams. We want it for the exact series in some cases (sparse versus dense for the (Laurent) polynomial ring), but it seems more like extra weight we are carrying around for the streams, which should instead simply be as dense or sparse as is most effective for them. Or maybe just for multiplication, which might be the only one that could matter? Do you remember if in any place we take advantage of the dense or sparse implementation currently? |
comment:10
I don't think we can decide for the user. For multiplication it makes a big difference, whether you are only interested in Exact series are neither sparse nor dense in the sense of I am not completely sure whether I understand your question. I think that The only two reasons for
I am guessing (but I am not sure) that it makes sense to use either only the sparse versions or only the dense versions of the operations here. |
comment:11
You’re right; for multiplication, we should have both a sparse and dense version. Ah, right, we don’t store the polynomials themselves in the I am mostly wondering how much we should drop within the streams to carry around the I will have to look at the code we currently have more closely I think to get a more clear picture. I don’t remember some of the details regarding this. Perhaps you already have a clear picture about this though. |
comment:12
Creating z10000 is not a problem:
however, z100000-1 is:
Curiously, it takes a very long time to create, all of which is spent in the polynomial exponentiation - this is, because the underlying polynomial ring, for some reason is always dense: class LazyLaurentSeriesRing(LazySeriesRing):
def __init__(self, base_ring, names, sparse=True, category=None):
self._sparse = sparse
# We always use the dense because our CS_exact is implemented densely
self._laurent_poly_ring = LaurentPolynomialRing(base_ring, names)
self._internal_poly_ring = self._laurent_poly_ring There are actually two easy improvements:
and, orthogonal to this,
I can imagine that having only sparse addition is bad. I can try to create an example if you want. What I'd be interested in is some help with van der Hoeven's algorithm in #34616. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
I made the internal polynomial rings sparse or dense according to the lazy series ring, although this really is of very little consequence. Essentially, creating z100000 is now fast in the sparse case, and some computations for exact series (powers, compositions) are now carried out with sparse polynomials. I did not check, however, whether this makes sense. We actually do not use the polynomial rings so much, not even for multiplication. A completely sparse version of |
comment:16
Although having a sparse version of I very much doubt that it is worth the effort right now. |
comment:17
The dense Laurent polynomials might be a bit better at creating z10000 than the usual polynomials as they factor out the valuation portion. It might not be so prudent to spend time implementing a sparse version of |
comment:19
Let us move along. This is definitely an improvement, and we can do further work on subsequent tickets. |
Reviewer: Travis Scrimshaw |
Changed branch from u/mantepse/make_sparsity_a_decision_of_the_user to |
The decision whether a Stream_XXX class uses a dense or a sparse cache should not depend on the input streams.
For example, for
Stream_add
it is actually irrelevant whether the input streams left and right are dense or sparse.For
Stream_zero
andStream_exact
, a separate cache never makes sense.This also makes the need to implement a conversion between sparse and dense less important.
Depends on #34552
Depends on #34653
CC: @tscrim @fchapoton
Component: combinatorics
Keywords: LazyPowerSeries
Author: Martin Rubey
Branch/Commit:
de424bd
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/34636
The text was updated successfully, but these errors were encountered: