Ask Your Question

gen_lengendre_p bug

asked 2020-02-12 18:40:28 +0200

bso gravatar image

Hi, wonder if someone here familiar with associated Legendre function can verify:

sage: gen_legendre_P(2, 2, x)
3*x^2 - 3

I think it should be

3 - 3*x^2

In Sage 8.9


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-02-12 21:19:00 +0200

eric_g gravatar image

updated 2021-05-17 23:30:13 +0200

You are unfortunately facing a known issue, which is not solved yet:

Associated Legendre functions and spherical harmonics in Sage require someone to work of them. Would you volunteer to do it?

EDIT (17 May 2021): the bug has been fixed in SageMath 9.3 (released a week ago):

sage:  gen_legendre_P(2, 2, x)                                                                      
-3*x^2 + 3
edit flag offensive delete link more

answered 2020-02-13 02:38:42 +0200

bso gravatar image

Thanks, Eric_G. I am interested to help out. Is there a page with Sage volunteering process? I will sign up. I have computer science degrees but new to math (but seriously interested to learn).

Correct definition:

def legendre_function(l, m, f):
    return ((-1)^m * (1 - x^2)^(m/2) * diff(legendre_P(l, x), x, m)).subs(x = f)

sage: legendre_function(2, 2, x)
-3*x^2 + 3

sage: legendre_function(2, 2, cos(x))
-3*cos(x)^2 + 3
edit flag offensive delete link more


Thanks for signing up! The standard starting point for Sage development is the Developer's guide. You may find some summary here (it's focused on manifolds, but most of the content is valid for any project).

eric_g gravatar imageeric_g ( 2020-02-13 15:46:28 +0200 )edit

Like. Thanks.

bso gravatar imagebso ( 2020-02-13 18:07:59 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-12 18:40:28 +0200

Seen: 308 times

Last updated: May 17 '21