#13720: Scale legendre_P to [a,b]
------------------------------------+---------------------------------------
       Reporter:  mjo               |         Owner:  burcin    
           Type:  enhancement       |        Status:  needs_work
       Priority:  major             |     Milestone:  sage-5.6  
      Component:  symbolics         |    Resolution:            
       Keywords:                    |   Work issues:            
Report Upstream:  N/A               |     Reviewers:            
        Authors:  Michael Orlitzky  |     Merged in:            
   Dependencies:                    |      Stopgaps:            
------------------------------------+---------------------------------------

Comment (by mjo):

 Replying to [comment:5 fwclarke]:
 > Why force them to be symbolic?  Better, surely, to allow anything that
 will evaluate and let coercion handle it.
 [[BR]]

 I removed the RR check, so you can actually pass in anything you want now.
 I'm not convinced this isn't a foot-gun, but it's still a clear
 improvement over what we have now so I'm happy with it.

 [[BR]]
 > This is what results from using `^` rather than `**` in python.
 [[BR]]

 Ah, yes, I should have caught that, sorry.

 [[BR]]

 > I'm sorry my proposed code had only been testing in Sage, and therefore
 was being prepared.  This dealt with, my version does pass all the
 doctests, is faster when if the variable is a polynomial generator, and
 the error
 > {{{
 > sage: legendre_P(4, Zmod(5)(1), 3, 6)
 > ...
 > ArithmeticError: 0^0 is undefined.
 > }}}
 > is eliminated.  Apologies for mistyping this before.
 >
 [[BR]]
 I believe this is another bug, elsewhere. I've set out to fix it and am
 trapped in a rabbit hole at the moment, about four bugs from here. Once
 that's sorted out, I'll do some experiments.
 [[BR]]
 [[BR]]
 > > The `bool()` casts do have to stay, otherwise the tests just don't
 work.
 >
 > Another way of doing this is to introduce a polynomial variable.  Thus
 > {{{
 > sage: R.<x> = QQ[]
 > sage: legendre_P(1, x) == x
 > True
 > }}}
 > I know very little about the symbolic side of Sage, but I do find things
 like
 > {{{
 > sage: SR(1) == SR(1)
 > 1 == 1
 > }}}
 > very strange, and confusing when compared with
 > {{{
 > sage: 1 == 1
 > True
 > }}}
 [[BR]]

 You'll get no argument from me there. I do prefer to test with the default
 symbol `x` though just because that's what most people will use.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13720#comment:6>
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.

Reply via email to