-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Symbolic Chebyshev polynomials #9706
Comments
Attachment: orthogonal_polys.py.gz A new version of the orthogonal_polys.py file. |
Newer version, with legendre_P, and faster evaluation of symbolic expressions |
Attachment: orthogonal_polys.2.py.gz Attachment: orthogonal_polys.3.py.gz Version from 10. August 2010 |
Latest version. It holds classes of all polys (but not all completed yet) |
comment:1
Attachment: orthogonal_polys.4.py.gz All Polys now have their own class. |
comment:2
Replying to @sagetrac-maldun:
orthogonal_polys4.py hold all changes but is not a patch yet, because it holds old code fragments, |
comment:4
I added in the latest patch (and orthogonal_polys.4.py contains these changes also) a new symbolic evaluation method for the orthogonal polynomials: Instead of call Maxima or use of the recursion, the polynomial is evaluated just using explicit formulas from Abramowitz and Stegun. This is an O(n) algorithm of course. a little comparison on my machine: sage: time chebyshev_T(10,x); sage: time gegenbauer(10,5,x); New Version sage: time gegenbauer(10,5,x); A little bit faster :) I also don't need to spawn an instance of maxima which makes the initialisation faster. And now also wider symbolic evaluation is possible: old version: new version: The code needs now some cleanup, especially the documentations. |
comment:5
Care to elaborate? |
Attachment: orthogonal_polys.5.py.gz Latest version from 12. August 2010 (with bugfix in legendre_P) |
comment:6
Killed bug in legendre_P |
comment:7
Replying to @fredrik-johansson:
Sorry for the late answer, I was on holidays. In mpmath I have probs with the legenp and legenq functions. For some inputs I get this error:
|
comment:8
That looks strange. I get:
|
comment:9
Replying to @fredrik-johansson:
Hm strange. Today I install the new Sage version, perhaps it will then work again |
comment:10
Replying to @fredrik-johansson:
It was the old version!a Thanx for pointing that out, I will continue soon =) |
Version from 19. August 2010 |
comment:11
Attachment: orthogonal_polys.6.py.gz So now a "beta" is ready with full support of all classes. Only the Legendre functions are still using Maxima. some advances for the future: -Zernike polys (this should be done in the next time, since explicit formulas are available) Now I need some people for testing this out =) |
comment:12
And there was an interisting bug: the import of mpmath at the beginning of the file caused the whole trouble I had with the numeric evaluation of the legendre functions.... I think I should report this.. |
Added numpy support, eliminated some bugs (19.08.2010) |
comment:14
Attachment: orthogonal_polys.7.py.gz
I decided to give at least some numpy support for compability reasons. |
comment:17
Some of the old doctests fail. see: #9769 |
comment:117
Something like that looks right indeed. maldun: what do you think? Perhaps the only code so far that could be truly generic is the |
comment:118
after some thinking, I guess you are right. A General OrthogonalPolynomial is sophisticated, but it needs too much tweaking, and too much exception cathing, which makes the code unsafe. @ I propose the following
|
Attachment: trac_9706_new_base_classes.patch.gz proposed new structure |
comment:119
I added an intermediate class between OrthogonalPolynomials and the Chebyshev polynomals namely ChebyshevPolynomial. Any comments on that? |
This comment has been minimized.
This comment has been minimized.
comment:120
Sorry for lagging behind on reviewing this, but I think the class structure is good. I'll write a small review patch tomorrow afternoon (in the US Pacific timezone) on a few tweaks (and pet peeves of mine). |
comment:121
I am currently working on finishing the Sage 5.13 release, so I don't feel like reviewing this now. |
This comment has been minimized.
This comment has been minimized.
comment:122
Okay, I've made the tweaks I wanted to. So it's a positive review from me, and someone will just need to review my changes. |
comment:123
Okay thanks. I set it on positive review then. |
comment:124
Replying to @sagetrac-maldun:
This has been a rumour that didn't pan out. I don't think a time line has been set towards actual deprecation of %. The possibility of deprecation is mentioned in |
comment:125
Travis: are you sure you applied the dependency #15422? I am suspicious because you added - (2^7 + O(2^8))*t^5 + (O(2^8))*t^4 + (2^6 + O(2^8))*t^3 + (O(2^8))*t^2 + (1 + 2^6 + O(2^8))*t + (O(2^8))
+ (2^7 + O(2^8))*t^5 + (2^6 + O(2^8))*t^3 + (1 + 2^6 + O(2^8))*t which seems to be a doctest failure. |
comment:126
I also don't agree with all changes of
to
but I guess that's one of your pet peeves. I personally prefer
if there are clearly two cases and the code might as well have been written as
So I personally would keep the
would be a lot better that what you did:
The first feels much better to me because you put the normal case outside the (Of course these are all personal preferences, I'm not asking you to change this, maybe just think about it.) |
Attachment: trac_9706-review-ts.patch.gz |
comment:128
I had missed the #15422 dependency. Fixed. As for the |
comment:130
First stage done. Next step: Legendre Polys. I will keep up the new design + incorporate more doc tests next time. I guess it is important to look at the algebraic aspects too concerning doc tests. Thank all reviewers for their hard work and the good input! |
Commit: |
Branch: u/vbraun/chebyshev |
* develop: (101 commits) Updated Sage version to 6.1.beta2 fix latex fix documentation minor typography Trac 13101: mark doctest as "long time" trac 13101 better doctest Trac 13101: Fix bug in enumerate_totallyreal_fields_all sagemath#9706: review patch. trac 9706: Propose new class structure Symbolic Chebyshev polynomials: reviewer patch trac 9706: Collective patch. Bugfixes, extensions, optimizations, documentation, doctests for chebyshev_T, chebyshev_U and base class for ortho polys Fixing Whitespace errors Use bash as SHELL for build/Makefile allow numpy arrays in list_plot, line, points Trac sagemath#12322: Add a doctest for the correct behavior introduced in trac sagemath#12737. Trac sagemath#14186 coerce_binop errors with keyword arguments trac sagemath#15553: Broken links in the doc of graph/ and numerical/ Improve handling of make targets sage, csage, extcode, scripts Reorded all.py to match original (so fewer changes). Fixed minor typo in cobminat/crystals/letters.pyx. ...
Apply:
Depends on #864
Depends on #9640
Depends on #10018
Depends on #11868
Depends on #15422
CC: @fredrik-johansson @sagetrac-fstan @kcrisman
Component: symbolics
Keywords: orthogonal polynomials, symbolics
Author: Stefan Reiterer
Branch/Commit: u/vbraun/chebyshev @
bb227b6
Reviewer: Burcin Erocal, Travis Scrimshaw, Stefan Reiterer, Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/9706
The text was updated successfully, but these errors were encountered: