-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Dispersion #2679
Dispersion #2679
Conversation
|
For point 2 I'll need some advise from the people working on the poly submodule. |
better names? |
For what exactly? The two functions are named like |
Add doctests. |
..[3]: "Hypergeometric Summation: An Algorithmic Approach to Summationand Special Function Identities. | ||
..[4]: "Fast Polynomial Dispersion Computation and its Application to Indefinite Summation" | ||
""" | ||
# Check for valid input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first line should probably be something like p, q = Poly(p), Poly(q)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first line should probably be something like
p, q = Poly(p), Poly(q)
.
Yes, probably. Depending on where we put the code in the end.
If you put this in the polys, you can implement a low-level algorithm and implement the wrappers at the different layers (which do various levels of type checking). I'm not sure what the state of the polys is, though, i.e., using Poly vs. ring(). |
|
||
.. math:: | ||
J(f, g) & := \{a \in Z^{+} | gcd(f(x), g(x+a)) \neq 1\} \\ | ||
& = \{a \in Z^{+} | deg gcd(f(x), g(x+a)) \geq 1\} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So intuitively, the set of positive integers n
where the root of one polynomial can be shifted to the left by n
to get the root of another?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So intuitively, the set of positive integers
n
where the root of
one polynomial can be shifted to the left byn
to get the root of
another?
To cite from W. Koepf's book:
"Note that the dispersion of two polynomials gives information about
their shift structure (answering the question: Does a shift generate
a common divisor?)."
I'd rather talk about factors than roots but the difference is small.
In fact if you compute the dispersion by using resultants and solving
the polynomial for the shifts, this gives exactly your statement.
Is there a Wikipedia article for this? |
That would be the idea. But for that I'd need some guide I plan to do a p.dispersion() and p.dispersion(q) method |
I did not check. But there are at least two good If I find some articles on wiki, mathworld or |
Of course, the doc is not finished yet. |
Ok, this is in a state where we can move it to the poly module now. |
1 similar comment
Ok, this is in a state where we can move it to the poly module now. |
Unfortunately, I don't even know what the state of the polys module is now, because of Poly vs. ring. @mattpap would have to comment. I know how to put this in Poly, but it probably would be better to put new code in ring. Anyway, I don't think it's too bad to leave high-level algorithms like this as only using Poly (or ring). Ideally they should be fast enough to handle it. And that's kind of the whole point of having the objects in the first place. The Risch stuff for instance uses Poly for everything, and only at the highest level. |
There seem to be no articles on:
If someone finds a reference, please tell. |
I guess you'll have to write one :) |
Regardless, I would say this belongs in the polys module, not the concrete module. |
I'll leave it to you to verify that the LaTeX math renders correctly. |
Ok, then I'll move this file as it is to the poly |
Sure. I'll test this once the docs are imported into sphinx. |
Oh, poly is out? I did not know that.
Probably the factorization is the slowest part anyway. |
It seems travis had a timeout. |
I'd like to integrate this deeper within the polys. Each poly instance should get a |
Do you want to implement it completely layered, or just at the Poly level? It didn't strike me as an algorithm that would benefit much from a low level implementation. |
Let's just fix this as it is. It needs a doctest. Otherwise, assuming you fixed the definitional issues I pointed out, it should be fine. |
I'd like to have an additional OO public API like:
We can then just call the functions |
In that case I wouldn't bother with all the lower levels (unless you find yourself needing it there too). Just implement the method on Poly. |
Thanks. I added a high level OOP interface. Please review. There was a circular import, hence the imports inside the function definition. |
4. [Man93]_ | ||
""" | ||
J = dispersionset(p, q) | ||
if len(J) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not J
Just those comments. |
if p.degree() < 1 or q.degree() < 1: | ||
return set([0]) | ||
|
||
# Factor p and q over the rationals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's only the case if the domain of p and q is QQ
or ZZ
. What if there's an algebraic domain? Or a symbolic one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it does look like you tested those cases, so maybe it works.
Dispersion computation