Opened 3 years ago
Last modified 3 months ago
#24554 needs_work defect
Refactoring in Chebyshev functions
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  symbolics  Keywords:  
Cc:  Merged in:  
Authors:  Ralf Stephan  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/rws/24554 (Commits)  Commit:  957ce14029a9ce8878fa66444f50f9b0372e7fa8 
Dependencies:  Stopgaps: 
Description (last modified by )
While other orthogonal polynomial functions (as well as almost all other symbolic functions) are simply BuiltinFunction
s or GinacFunction
s this ticket suffers from the fact that the Cheby functions in Sage allow the algorithm
keyword (by using a __call__
method in the superclass). The way such polymorphisms are resolved in other functions is by having the interface (the callable global function chebyshev_T()
) dispatching on the keyword, especially because doctests involving all kind of Sage objects as function argument are expected to work eternally.
The goal of this ticket is to move the __call__
method out of the Function
class (as well as other methods used as interface) into a separate interface class; to 2. make the remaining class inherit from BuiltinFunction
and, 3., to remove the ChebyshevFunction
superclass as it is then no longer used.
Change History (16)
comment:1 Changed 3 years ago by
 Description modified (diff)
comment:2 Changed 3 years ago by
comment:3 Changed 3 years ago by
 Description modified (diff)
 Summary changed from Remove __call__() usage in Chebyshev functions to Refactoring in Chebyshev functions
comment:4 Changed 3 years ago by
 Description modified (diff)
comment:5 Changed 3 years ago by
Also the usage chebyshev_T(...algorithm='maxima')
used normal evaluation. Maxima returns a polynomial in (x1)
which probably is useful so I'm changing doctests. In a later step this could be renamed to a more descriptive name and computed by Sage.
comment:6 Changed 3 years ago by
Also eval_formula()
should become algorithm='hypergeometric'
. The Maxima "algorithm" is variant of it, see https://en.wikipedia.org/wiki/Chebyshev_polynomials#Explicit_expressions
comment:7 Changed 3 years ago by
 Branch set to u/rws/remove___call_____usage_in_chebyshev_functions
comment:8 Changed 3 years ago by
 Commit set to 25823302e3769f6502fc208d72bb6635d48eeeb9
comment:9 Changed 3 years ago by
 Status changed from new to needs_review
comment:10 Changed 3 years ago by
 Status changed from needs_review to needs_work
Docs fail to build, doctest errors in three files:
sage t long src/sage/rings/polynomial/polynomial_element.pyx # 6 doctests failed
sage t long src/sage/rings/number_field/splitting_field.py # 2 doctests failed
sage t long src/sage/graphs/bipartite_graph.py # 1 doctest failed
comment:11 Changed 3 years ago by
 Branch changed from u/rws/remove___call_____usage_in_chebyshev_functions to u/rws/24554
comment:12 Changed 3 years ago by
 Commit changed from 25823302e3769f6502fc208d72bb6635d48eeeb9 to 957ce14029a9ce8878fa66444f50f9b0372e7fa8
 Status changed from needs_work to needs_review
New commits:
957ce14  24554: Refactoring in Chebyshev functions

comment:14 Changed 9 months ago by
 Milestone changed from sage8.2 to sage9.1
comment:15 Changed 7 months ago by
 Milestone changed from sage9.1 to sage9.2
Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.
comment:16 Changed 3 months ago by
 Milestone changed from sage9.2 to sage9.3
The usage
chebyshev_T(...algorithm='pari'
silently uses normal evaluation because there is no_eval_pari_
member, so Pari was never supported.